X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm%2Fao_arch_funcs.h;h=9922513be007bf005c19c9d9d1cd5021e3266300;hb=1760bec9ed19c64f35ea28904cea433d39dead07;hp=d2cc11201a7e7c550d36985d9ef0df871d61764e;hpb=ac2003b9556595db12e1fc671ef6226c56b777ad;p=fw%2Faltos diff --git a/src/stm/ao_arch_funcs.h b/src/stm/ao_arch_funcs.h index d2cc1120..9922513b 100644 --- a/src/stm/ao_arch_funcs.h +++ b/src/stm/ao_arch_funcs.h @@ -92,6 +92,9 @@ ao_spi_get(uint8_t spi_index, uint32_t speed); void ao_spi_put(uint8_t spi_index); +void +ao_spi_put_pins(uint8_t spi_index); + void ao_spi_send(const void *block, uint16_t len, uint8_t spi_index); @@ -148,7 +151,7 @@ ao_spi_recv_byte(uint8_t spi_index) stm_spi->dr = 0xff; while (!(stm_spi->sr & (1 << STM_SPI_SR_RXNE))) ; - return stm_spi->dr; + return (uint8_t) stm_spi->dr; } void @@ -200,15 +203,15 @@ ao_spi_try_get_mask(struct stm_gpio *reg, uint16_t mask, uint8_t bus, uint32_t s #define ao_disable_port(port) do { \ if ((port) == &stm_gpioa) \ - stm_rcc.ahbenr &= ~(1 << STM_RCC_AHBENR_GPIOAEN); \ + stm_rcc.ahbenr &= ~(1UL << STM_RCC_AHBENR_GPIOAEN); \ else if ((port) == &stm_gpiob) \ - stm_rcc.ahbenr &= ~(1 << STM_RCC_AHBENR_GPIOBEN); \ + stm_rcc.ahbenr &= ~(1UL << STM_RCC_AHBENR_GPIOBEN); \ else if ((port) == &stm_gpioc) \ - stm_rcc.ahbenr &= ~(1 << STM_RCC_AHBENR_GPIOCEN); \ + stm_rcc.ahbenr &= ~(1UL << STM_RCC_AHBENR_GPIOCEN); \ else if ((port) == &stm_gpiod) \ - stm_rcc.ahbenr &= ~(1 << STM_RCC_AHBENR_GPIODEN); \ + stm_rcc.ahbenr &= ~(1UL << STM_RCC_AHBENR_GPIODEN); \ else if ((port) == &stm_gpioe) \ - stm_rcc.ahbenr &= ~(1 << STM_RCC_AHBENR_GPIOEEN); \ + stm_rcc.ahbenr &= ~(1UL << STM_RCC_AHBENR_GPIOEEN); \ } while (0)