mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 19:50:30 +01:00
ports: Modify mp_hal_pin_write macro so it can be used as a function.
Even though it doesn't return anything it could still be used like a function. Addresses issue #5501.
This commit is contained in:
@@ -125,4 +125,4 @@ struct _pin_obj_t;
|
||||
#define mp_hal_pin_high(p) (((p)->gpio->PSOR) = (p)->pin_mask)
|
||||
#define mp_hal_pin_low(p) (((p)->gpio->PCOR) = (p)->pin_mask)
|
||||
#define mp_hal_pin_read(p) (((p)->gpio->PDIR >> (p)->pin) & 1)
|
||||
#define mp_hal_pin_write(p, v) do { if (v) { mp_hal_pin_high(p); } else { mp_hal_pin_low(p); } } while (0)
|
||||
#define mp_hal_pin_write(p, v) ((v) ? mp_hal_pin_high(p) : mp_hal_pin_low(p))
|
||||
|
||||
Reference in New Issue
Block a user