From bc7117e04cddfd67c99c859757c691bd50b62143 Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Fri, 20 Mar 2015 21:38:01 +0100 Subject: 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. --- os/hal/ports/TIVA/LLD/st_lld.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'os/hal/ports') 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 */ -- cgit v1.2.3