Skip to content

Commit

Permalink
fixup: only one return
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm authored Jan 14, 2025
1 parent b06ba1d commit 8014027
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cores/arduino/wiring_digital.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ int digitalRead(uint32_t ulPin)
{
PinName p = digitalPinToPinName(ulPin);

if (p == NC) {
return 0;
}
return digitalReadFast(p);
return (p == NC) ? 0 : digitalReadFast(p);
}

void digitalToggle(uint32_t ulPin)
Expand Down

0 comments on commit 8014027

Please sign in to comment.