diff --git a/apps/plugin.h b/apps/plugin.h index a95d80b7aa..3b9ca03e32 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -334,7 +334,7 @@ struct plugin_api { #ifdef HAVE_PRIORITY_SCHEDULING void (*priority_yield)(void); #endif - long* current_tick; + volatile long* current_tick; long (*default_event_handler)(long event); long (*default_event_handler_ex)(long event, void (*callback)(void *), void *parameter); struct thread_entry* threads; diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index a77ca312bd..9e3a8d25df 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h @@ -93,7 +93,7 @@ struct mutex the current_tick variable */ #define current_tick (signed)(USEC_TIMER/10000) #else -extern long current_tick; +extern volatile long current_tick; #endif #ifdef SIMULATOR diff --git a/firmware/kernel.c b/firmware/kernel.c index 5841f8975e..fcee53f331 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c @@ -26,7 +26,7 @@ #include "panic.h" #if !defined(CPU_PP) || !defined(BOOTLOADER) -long current_tick NOCACHEDATA_ATTR = 0; +volatile long current_tick NOCACHEDATA_ATTR = 0; #endif static void (*tick_funcs[MAX_NUM_TICK_TASKS])(void);