Question
Systick delay weird behavior. [STM32F103CB] [GNUArmEclipse]
Posted on December 26, 2015 at 00:51
I am experiencing weird behavior from my systick delay function.
The following code does not work.void delay_ms(int time_ms){ uint32_t time_done = SystemUptime+time_ms; while(SystemUptime < time_done) { }}However this one does:void dummy(void){ asm volatile(''NOP''); asm volatile(''NOP'');}void delay_ms(int time_ms){ uint32_t time_done = SystemUptime+time_ms; while(SystemUptime < time_done) { dummy(); }}If i use only one nop or do the nop without it being in a function it won't work. What am I doing wrong? #systick-stm32-f1