diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2017-05-27 17:10:15 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2017-05-27 17:10:15 +0200 |
| commit | 5430bd30906ca270bceec5912b94d81f0f854769 (patch) | |
| tree | 527b4b9527cd057e81d86e07b5ee7e3fd806bb49 /Source/System.c | |
| parent | 656eec576e46bf80da052710508e93b26ec8bdb5 (diff) | |
* Added more aircraft on LEVEL1.PLT.
* Unboarding state now totally implemented.
* (Bugfix): Incorrect aircraft was selected on ShowAircraftData.
* Gfx1HzFlash() and Gfx2HzFlash() were incorrectly implemented, causing multiple ticks on a single cycle.
Diffstat (limited to 'Source/System.c')
| -rw-r--r-- | Source/System.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/System.c b/Source/System.c index 5ecafbb..5d7f4de 100644 --- a/Source/System.c +++ b/Source/System.c @@ -20,7 +20,7 @@ * Local Prototypes * *************************************/ -static void SystemCheckTimer(bool * timer, uint64_t * last_timer, uint8_t step); +static void SystemCheckTimer(bool* timer, uint64_t* last_timer, uint8_t step); static void SystemSetStackPattern(void); static void SystemEnableVBlankInterrupt(void); static void SystemDisableVBlankInterrupt(void); @@ -238,11 +238,12 @@ bool System500msTick(void) return five_hundred_ms_timer; } -void SystemRunTimers(void) -{ - static uint64_t last_one_second_tick; +static uint64_t last_one_second_tick; static uint64_t last_100_ms_tick; static uint64_t last_500_ms_tick; + +void SystemRunTimers(void) +{ SystemCheckTimer(&one_second_timer, &last_one_second_tick, REFRESH_FREQUENCY); @@ -255,18 +256,18 @@ void SystemRunTimers(void) } -void SystemCheckTimer(bool * timer, uint64_t * last_timer, uint8_t step) +void SystemCheckTimer(bool* timer, uint64_t* last_timer, uint8_t step) { if(*timer == true) { *timer = false; - *last_timer = global_timer; } if(global_timer >= (*last_timer + step) ) { *timer = true; - } + *last_timer = global_timer; + } } bool SystemLoadFileToBuffer(char * fname, uint8_t* buffer, uint32_t szBuffer) |
