From: arighi Date: Fri, 23 Apr 2010 15:37:26 +0000 (+0000) Subject: lm3s1968: add a busy wait sleep when enabling or disabling the UART peripheral. X-Git-Tag: 2.5.0~395 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=dbe46a961b80ff6d37dfd4238c2bd75a087daaf6;p=bertos.git lm3s1968: add a busy wait sleep when enabling or disabling the UART peripheral. This is an enforcement to be sure the peripheral is actually enabled or disabled on return from lm3s_uartEnable()/lm3s_uartDisable(). git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3513 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cpu/cortex-m3/drv/ser_lm3s.c b/bertos/cpu/cortex-m3/drv/ser_lm3s.c index 717ffa58..b326a058 100644 --- a/bertos/cpu/cortex-m3/drv/ser_lm3s.c +++ b/bertos/cpu/cortex-m3/drv/ser_lm3s.c @@ -36,7 +36,6 @@ */ #include /* for BV() */ -#include /* lm3s_busyWait() */ #include #include #include diff --git a/bertos/cpu/cortex-m3/drv/ser_lm3s.h b/bertos/cpu/cortex-m3/drv/ser_lm3s.h index 27da414b..9485b1f8 100644 --- a/bertos/cpu/cortex-m3/drv/ser_lm3s.h +++ b/bertos/cpu/cortex-m3/drv/ser_lm3s.h @@ -40,6 +40,7 @@ #include #include /* cpu_relax() */ +#include /* lm3s_busyWait() */ #include /* Serial hardware numbers */ @@ -76,6 +77,7 @@ INLINE void lm3s_uartDisable(uint32_t base) /* Disable the UART */ HWREG(base + UART_O_CTL) &= ~(UART_CTL_UARTEN | UART_CTL_TXE | UART_CTL_RXE); + lm3s_busyWait(512); } INLINE void lm3s_uartEnable(uint32_t base) @@ -86,6 +88,7 @@ INLINE void lm3s_uartEnable(uint32_t base) /* Enable RX, TX, and the UART */ HWREG(base + UART_O_CTL) |= UART_CTL_UARTEN | UART_CTL_TXE | UART_CTL_RXE; + lm3s_busyWait(512); } INLINE bool lm3s_uartTxDone(uint32_t base)