mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-25 04:43:02 +00:00
Refactor writePin to work with statements (#16738)
This commit is contained in:
parent
03f9b8db15
commit
119abc4375
@ -31,7 +31,14 @@ typedef ioline_t pin_t;
|
||||
|
||||
#define writePinHigh(pin) palSetLine(pin)
|
||||
#define writePinLow(pin) palClearLine(pin)
|
||||
#define writePin(pin, level) ((level) ? (writePinHigh(pin)) : (writePinLow(pin)))
|
||||
#define writePin(pin, level) \
|
||||
do { \
|
||||
if (level) { \
|
||||
writePinHigh(pin); \
|
||||
} else { \
|
||||
writePinLow(pin); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define readPin(pin) palReadLine(pin)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user