altos/stm: Minor cleanups in ao_arch_funcs.h
authorKeith Packard <keithp@keithp.com>
Sun, 19 Sep 2021 05:44:19 +0000 (22:44 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 19 Sep 2021 06:17:41 +0000 (23:17 -0700)
Fix ao_gpio_set_output_mode to actually work again.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm/ao_arch_funcs.h

index 083f7a2beb7ad394e57c200d9b1f13dd2ff5f020..d2cc11201a7e7c550d36985d9ef0df871d61764e 100644 (file)
@@ -182,8 +182,8 @@ ao_spi_try_get_mask(struct stm_gpio *reg, uint16_t mask, uint8_t bus, uint32_t s
                ao_spi_put(bus);                \
        } while (0)
 
-#define ao_spi_get_bit(reg,bit,bus,speed) ao_spi_get_mask(reg,(1<<bit),bus,speed)
-#define ao_spi_put_bit(reg,bit,bus) ao_spi_put_mask(reg,(1<<bit),bus)
+#define ao_spi_get_bit(reg,bit,bus,speed) ao_spi_get_mask(reg,1<<(bit),bus,speed)
+#define ao_spi_put_bit(reg,bit,bus) ao_spi_put_mask(reg,1<<(bit),bus)
 
 #define ao_enable_port(port) do {                                      \
                if ((port) == &stm_gpioa)                               \
@@ -239,7 +239,7 @@ ao_spi_try_get_mask(struct stm_gpio *reg, uint16_t mask, uint8_t bus, uint32_t s
 #define AO_OUTPUT_PUSH_PULL    STM_OTYPER_PUSH_PULL
 #define AO_OUTPUT_OPEN_DRAIN   STM_OTYPER_OPEN_DRAIN
 
-#define ao_gpio_set_output_mode(port,bit,mode) \
+#define ao_gpio_set_output_mode(port,pin,mode) \
        stm_otyper_set(port, pin, mode)
 
 #define ao_gpio_set_mode(port,bit,mode) do {                           \