diff --git a/src/tinyhw.h b/src/tinyhw.h index 5d3a260..9eff925 100644 --- a/src/tinyhw.h +++ b/src/tinyhw.h @@ -17,7 +17,12 @@ void px_set(const void *data, uint32_t index, uint8_t intensity, uint32_t color) #define PX_WORDS(NUM_PIXELS) (((NUM_PIXELS)*9 + 8) / 4) // pins.c -void pin_set(int pin, int v); +void _pin_set(int pin, int v); +static inline void pin_set(int pin, int v) { + if ((uint8_t)pin == 0xff) + return; + _pin_set(pin, v); +} void pin_setup_output(int pin); void pin_toggle(int pin); int pin_get(int pin); diff --git a/stm32/pins.c b/stm32/pins.c index 22ccd41..978104d 100644 --- a/stm32/pins.c +++ b/stm32/pins.c @@ -66,9 +66,7 @@ void pin_pulse(int pin, int times) { } } -void pin_set(int pin, int v) { - if ((uint8_t)pin == 0xff) - return; +void _pin_set(int pin, int v) { if (v) LL_GPIO_SetOutputPin(PORT(pin), PIN(pin)); else