Global variables shared between an interrupt and the main code should be volatile
See: https://www.embedded.com/electronics-blogs/beginner-s-corner/4023801/Introduction-to-the-Volatile-Keyword
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "fsl_pit.h"
|
||||
#include "timer.h"
|
||||
|
||||
uint32_t CurrentTime;
|
||||
volatile uint32_t CurrentTime;
|
||||
|
||||
void PIT_TIMER_HANDLER(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user