Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8f1711f

Browse filesBrowse files
committed
Fix compilation warning
Add 'const' declaration to avoid: cores/arduino/pulse.c: In function 'pulseIn': cores/arduino/pulse.c:44:29: warning: initialization discards 'const' qualifier from pointer target type [enabled by default] volatile uint32_t *port = &(PORT->Group[p.ulPort].IN.reg); ^
1 parent 54be8f0 commit 8f1711f
Copy full SHA for 8f1711f

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎cores/arduino/pulse.c

Copy file name to clipboardExpand all lines: cores/arduino/pulse.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ uint32_t pulseIn(uint32_t pin, uint32_t state, uint32_t timeout)
4141
* No assembly required, no conversion of loop counts to times (which is
4242
* worrisome in the presence of cache.)
4343
*/
44-
volatile uint32_t *port = &(PORT->Group[p.ulPort].IN.reg);
44+
const volatile uint32_t *port = &(PORT->Group[p.ulPort].IN.reg);
4545
uint32_t usCallStart; // microseconds at start of call, for timeout.
4646
uint32_t usPulseStart; // microseconds at start of measured pulse.
4747
usCallStart = usPulseStart = micros();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.