mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 16:55:20 +03:00
Try to keep perMain() execution period of 20ms
This commit is contained in:
parent
0d1362e476
commit
271dae71f7
1 changed files with 10 additions and 1 deletions
|
@ -147,6 +147,8 @@ void mixerTask(void * pdata)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MENU_TASK_PERIOD_TICKS 10 // 20ms
|
||||||
|
|
||||||
extern void opentxClose();
|
extern void opentxClose();
|
||||||
extern void opentxInit();
|
extern void opentxInit();
|
||||||
void menusTask(void * pdata)
|
void menusTask(void * pdata)
|
||||||
|
@ -154,9 +156,16 @@ void menusTask(void * pdata)
|
||||||
opentxInit();
|
opentxInit();
|
||||||
|
|
||||||
while (pwrCheck() != e_power_off) {
|
while (pwrCheck() != e_power_off) {
|
||||||
|
U64 start = CoGetOSTime();
|
||||||
perMain();
|
perMain();
|
||||||
// TODO remove completely massstorage from sky9x firmware
|
// TODO remove completely massstorage from sky9x firmware
|
||||||
CoTickDelay(5); // 5*2ms for now
|
U32 runtime = (U32)(CoGetOSTime() - start);
|
||||||
|
if (runtime >= MENU_TASK_PERIOD_TICKS) {
|
||||||
|
//no delay
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CoTickDelay(MENU_TASK_PERIOD_TICKS - runtime); // 5*2ms for now
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd_clear();
|
lcd_clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue