diff options
author | marcoveeneman <marco-veeneman@hotmail.com> | 2015-03-20 21:38:01 +0100 |
---|---|---|
committer | marcoveeneman <marco-veeneman@hotmail.com> | 2015-03-20 21:38:01 +0100 |
commit | bc7117e04cddfd67c99c859757c691bd50b62143 (patch) | |
tree | 70b8b54e5347119c30d3ad3f97ba874af2e6a3cd | |
parent | 273b1fa5252480926d8db2a87efd6d7956cf0e6c (diff) | |
download | ChibiOS-Contrib-bc7117e04cddfd67c99c859757c691bd50b62143.tar.gz ChibiOS-Contrib-bc7117e04cddfd67c99c859757c691bd50b62143.tar.bz2 ChibiOS-Contrib-bc7117e04cddfd67c99c859757c691bd50b62143.zip |
Wait until the timer peripheral is ready to continue. When built with -O0 this was not needed, but with -O2 the peripheral was not ready when it was accessed.
-rw-r--r-- | os/hal/ports/TIVA/LLD/st_lld.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/os/hal/ports/TIVA/LLD/st_lld.c b/os/hal/ports/TIVA/LLD/st_lld.c index bd744a6..23235d3 100644 --- a/os/hal/ports/TIVA/LLD/st_lld.c +++ b/os/hal/ports/TIVA/LLD/st_lld.c @@ -214,6 +214,10 @@ void st_lld_init(void) /* Enabling timer clock.*/ ST_ENABLE_CLOCK(); + /* TODO: dynamic for all timers instead of hardcoded.*/ + while (!(SYSCTL->PRWTIMER & (1 << 5))) + ; + /* Initializing the counter in free running down mode.*/ TIVA_ST_TIM->CTL = 0; TIVA_ST_TIM->CFG = GPTM_CFG_CFG_SPLIT; /* Timer split mode */ |