1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 08:15:17 +03:00

Try to keep perMain() execution period of 20ms

This commit is contained in:
Damjan Adamic 2014-12-04 21:23:09 +01:00
parent 0d1362e476
commit 271dae71f7

View file

@ -147,6 +147,8 @@ void mixerTask(void * pdata)
}
}
#define MENU_TASK_PERIOD_TICKS 10 // 20ms
extern void opentxClose();
extern void opentxInit();
void menusTask(void * pdata)
@ -154,9 +156,16 @@ void menusTask(void * pdata)
opentxInit();
while (pwrCheck() != e_power_off) {
U64 start = CoGetOSTime();
perMain();
// 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();