Skip to content

Commit a08cb3f

Browse files
committed
Make assigning PULLEN value in digitalWrite a bit clearer
1 parent bf454d8 commit a08cb3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/wiring_digital.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void digitalWrite( uint32_t ulPin, uint32_t ulVal )
8888

8989
if ( (PORT->Group[port].DIRSET.reg & pinMask) == 0 ) {
9090
// the pin is not an output, disable pull-up if val is LOW, otherwise enable pull-up
91-
PORT->Group[port].PINCFG[pin].bit.PULLEN = (ulVal != LOW) ;
91+
PORT->Group[port].PINCFG[pin].bit.PULLEN = ((ulVal == LOW) ? 0 : 1) ;
9292
}
9393

9494
switch ( ulVal )

0 commit comments

Comments
 (0)