X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm%2Fao_serial_stm.c;h=88f2d0299ecf65f1b350dde44e0ede1d744c7c1f;hb=7348cc4736c9a94f9ad299edd78199b544d0e95a;hp=e356b9441c3e4bce2381e07ee1b88556534bf63e;hpb=0e7d1c89fea98eabca738f10cbfebec631be3bb7;p=fw%2Faltos diff --git a/src/stm/ao_serial_stm.c b/src/stm/ao_serial_stm.c index e356b944..88f2d029 100644 --- a/src/stm/ao_serial_stm.c +++ b/src/stm/ao_serial_stm.c @@ -86,9 +86,9 @@ ao_usart_getchar(struct ao_stm_usart *usart) } static inline uint8_t -_ao_usart_sleep(struct ao_stm_usart *usart) +_ao_usart_sleep_for(struct ao_stm_usart *usart, uint16_t timeout) { - return ao_sleep(&usart->rx_fifo); + return ao_sleep_for(&usart->rx_fifo, timeout); } void @@ -217,9 +217,9 @@ _ao_serial1_pollchar(void) } uint8_t -_ao_serial1_sleep(void) +_ao_serial1_sleep_for(uint16_t timeout) { - return _ao_usart_sleep(&ao_stm_usart1); + return _ao_usart_sleep_for(&ao_stm_usart1, timeout); } void @@ -260,9 +260,9 @@ _ao_serial2_pollchar(void) } uint8_t -_ao_serial2_sleep(void) +_ao_serial2_sleep_for(uint16_t timeout) { - return _ao_usart_sleep(&ao_stm_usart2); + return _ao_usart_sleep_for(&ao_stm_usart2, timeout); } void @@ -303,9 +303,9 @@ _ao_serial3_pollchar(void) } uint8_t -_ao_serial3_sleep(void) +_ao_serial3_sleep_for(uint16_t timeout) { - return _ao_usart_sleep(&ao_stm_usart3); + return _ao_usart_sleep_for(&ao_stm_usart3, timeout); } void @@ -348,7 +348,7 @@ ao_serial_init(void) stm_nvic_set_enable(STM_ISR_USART1_POS); stm_nvic_set_priority(STM_ISR_USART1_POS, 4); -#if USE_SERIAL_1_STDIN +#if USE_SERIAL_1_STDIN && !DELAY_SERIAL_1_STDIN ao_add_stdio(_ao_serial1_pollchar, ao_serial1_putchar, NULL); @@ -395,7 +395,7 @@ ao_serial_init(void) stm_nvic_set_enable(STM_ISR_USART2_POS); stm_nvic_set_priority(STM_ISR_USART2_POS, 4); -#if USE_SERIAL_2_STDIN +#if USE_SERIAL_2_STDIN && !DELAY_SERIAL_2_STDIN ao_add_stdio(_ao_serial2_pollchar, ao_serial2_putchar, NULL); @@ -439,7 +439,7 @@ ao_serial_init(void) stm_nvic_set_enable(STM_ISR_USART3_POS); stm_nvic_set_priority(STM_ISR_USART3_POS, 4); -#if USE_SERIAL_3_STDIN +#if USE_SERIAL_3_STDIN && !DELAY_SERIAL_3_STDIN ao_add_stdio(_ao_serial3_pollchar, ao_serial3_putchar, NULL);