Skip to content

Commit 8f1711f

Browse 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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/pulse.c

Lines 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)