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.
This commit is contained in:
parent
273b1fa525
commit
bc7117e04c
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue