X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Fcortex-m3%2Fdrv%2Fser_stm32.h;h=03a94fecb01e5b1f3ca16c487d7a41aac120c9f4;hb=854199db6c8a6aee9b131095a8c3d7934ebcc1ae;hp=2da1b09e44a1464ae82afa4a6d821a8947d09df0;hpb=e70c73c7eedf8644b88a66acacf913335e3395a9;p=bertos.git diff --git a/bertos/cpu/cortex-m3/drv/ser_stm32.h b/bertos/cpu/cortex-m3/drv/ser_stm32.h index 2da1b09e..03a94fec 100644 --- a/bertos/cpu/cortex-m3/drv/ser_stm32.h +++ b/bertos/cpu/cortex-m3/drv/ser_stm32.h @@ -55,17 +55,17 @@ enum }; /* Software errors */ -#define SERRF_RXFIFOOVERRUN BV(0) //< Rx FIFO buffer overrun -#define SERRF_RXTIMEOUT BV(1) //< Receive timeout -#define SERRF_TXTIMEOUT BV(2) //< Transmit timeout +#define SERRF_RXFIFOOVERRUN BV(6) //< Rx FIFO buffer overrun +#define SERRF_RXTIMEOUT BV(5) //< Receive timeout +#define SERRF_TXTIMEOUT BV(4) //< Transmit timeout /* * Hardware errors. */ -#define SERRF_RXSROVERRUN 0 //< Input overrun -#define SERRF_FRAMEERROR 0 //< Stop bit missing -#define SERRF_PARITYERROR 0 //< Parity error -#define SERRF_NOISEERROR 0 //< Noise error +#define SERRF_RXSROVERRUN SR_ORE //< Input overrun +#define SERRF_FRAMEERROR SR_FE //< Stop bit missing +#define SERRF_PARITYERROR SR_PE //< Parity error +#define SERRF_NOISEERROR SR_NE //< Noise error /* Serial error/status flags */ typedef uint32_t serstatus_t; @@ -98,13 +98,13 @@ INLINE bool stm32_uartTxDone(uint32_t base) INLINE bool stm32_uartTxReady(uint32_t base) { struct stm32_usart *_base = (struct stm32_usart *)base; - return (_base->SR & (BV(7) | BV(6))); + return (_base->SR & (BV(CR1_TXEIE) | BV(CR1_TCIE))); } INLINE bool stm32_uartRxReady(uint32_t base) { struct stm32_usart *_base = (struct stm32_usart *)base; - return (_base->SR & BV(5)); + return (_base->SR & BV(CR1_RXNEIE)); } INLINE int stm32_uartPutChar(uint32_t base, unsigned char c)