Skip to content

Commit 5ad321d

Browse files
Roy, ElizabethWalberg, Irun
authored andcommitted
pinMode() added check that port pointer is not NULL
1 parent d62ba0c commit 5ad321d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cores/arduino/wiring_digital.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ void pinMode(uint8_t pin, PinMode mode)
3333
if ((bit_pos == NOT_A_PIN)||(mode > INPUT_PULLUP)) return;
3434

3535
PORT_t* port = digitalPinToPortStruct(pin);
36+
if(port == NULL) return;
37+
3638
uint8_t bit_mask = (1 << bit_pos);
3739

3840
if(mode == OUTPUT){

0 commit comments

Comments
 (0)