From cdaa0d7b272505c49017f409b7c0b8e3240608f0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 11 Sep 2018 10:40:24 -0700 Subject: altos: Eliminate 'pin' field from GPIO functions This was used with the 8051 bit-addressing mode to provide single-instruction access to GPIO pins. Signed-off-by: Keith Packard --- src/stm/ao_arch_funcs.h | 18 +++++++++--------- src/stm/ao_led.c | 8 ++++---- src/stm/ao_serial_stm.c | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/stm') diff --git a/src/stm/ao_arch_funcs.h b/src/stm/ao_arch_funcs.h index 522059bc..9bb598f6 100644 --- a/src/stm/ao_arch_funcs.h +++ b/src/stm/ao_arch_funcs.h @@ -166,8 +166,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,pin,bus,speed) ao_spi_get_mask(reg,(1<bsrr = (colors & ao_led_enable); @@ -105,7 +105,7 @@ ao_led_off(AO_LED_TYPE colors) AO_LED_TYPE i; for (i = 0; i < N_LED; i++) if (colors & (1 << i)) - ao_gpio_set(ao_leds[i].port, ao_leds[i].pin, foo, 0); + ao_gpio_set(ao_leds[i].port, ao_leds[i].pin, 0); #else #ifdef LED_PORT LED_PORT->bsrr = (uint32_t) (colors & ao_led_enable) << 16; @@ -137,7 +137,7 @@ ao_led_toggle(AO_LED_TYPE colors) AO_LED_TYPE i; for (i = 0; i < N_LED; i++) if (colors & (1 << i)) - ao_gpio_set(ao_leds[i].port, ao_leds[i].pin, foo, ~ao_gpio_get(ao_leds[i].port, ao_leds[i].pin, foo)); + ao_gpio_set(ao_leds[i].port, ao_leds[i].pin, ~ao_gpio_get(ao_leds[i].port, ao_leds[i].pin)); #else #ifdef LED_PORT LED_PORT->odr ^= (colors & ao_led_enable); @@ -173,7 +173,7 @@ ao_led_init(AO_LED_TYPE enable) ao_led_enable = enable; #if LED_PER_LED for (bit = 0; bit < N_LED; bit++) - ao_enable_output(ao_leds[bit].port, ao_leds[bit].pin, foo, 0); + ao_enable_output(ao_leds[bit].port, ao_leds[bit].pin, 0); #else #ifdef LED_PORT stm_rcc.ahbenr |= (1 << LED_PORT_ENABLE); diff --git a/src/stm/ao_serial_stm.c b/src/stm/ao_serial_stm.c index 2afee5b5..c1a2f1bd 100644 --- a/src/stm/ao_serial_stm.c +++ b/src/stm/ao_serial_stm.c @@ -33,7 +33,7 @@ _ao_usart_tx_start(struct ao_stm_usart *usart) { if (!ao_fifo_empty(usart->tx_fifo)) { #if HAS_SERIAL_SW_FLOW - if (usart->gpio_cts && ao_gpio_get(usart->gpio_cts, usart->pin_cts, foo) == 1) { + if (usart->gpio_cts && ao_gpio_get(usart->gpio_cts, usart->pin_cts) == 1) { ao_exti_enable(usart->gpio_cts, usart->pin_cts); return 0; } @@ -73,7 +73,7 @@ _ao_usart_rx(struct ao_stm_usart *usart, int is_stdin) * for it to drain a bunch */ if (usart->gpio_rts && ao_fifo_mostly(usart->rx_fifo)) { - ao_gpio_set(usart->gpio_rts, usart->pin_rts, usart->pin_rts, 1); + ao_gpio_set(usart->gpio_rts, usart->pin_rts, 1); usart->rts = 0; } #endif @@ -118,7 +118,7 @@ _ao_usart_pollchar(struct ao_stm_usart *usart) #if HAS_SERIAL_SW_FLOW /* If we've cleared RTS, check if there's space now and turn it back on */ if (usart->gpio_rts && usart->rts == 0 && ao_fifo_barely(usart->rx_fifo)) { - ao_gpio_set(usart->gpio_rts, usart->pin_rts, foo, 0); + ao_gpio_set(usart->gpio_rts, usart->pin_rts, 0); usart->rts = 1; } #endif @@ -403,7 +403,7 @@ ao_serial_set_sw_rts_cts(struct ao_stm_usart *usart, { /* Pull RTS low to note that there's space in the FIFO */ - ao_enable_output(port_rts, pin_rts, foo, 0); + ao_enable_output(port_rts, pin_rts, 0); usart->gpio_rts = port_rts; usart->pin_rts = pin_rts; usart->rts = 1; -- cgit v1.2.3