[X7] Telemetry scripts terminated with [EXIT Long] - #4143

This commit is contained in:
Bertrand Songis
2016-12-19 17:50:03 +01:00
parent aabbc375a3
commit eb3da74331
+21
View File
@@ -440,6 +440,24 @@ bool displayCustomTelemetryScreen(uint8_t index)
bool displayTelemetryScreen()
{
#if defined(LUA)
if (TELEMETRY_SCREEN_TYPE(s_frsky_view) == TELEMETRY_SCREEN_TYPE_SCRIPT) {
uint8_t state = isTelemetryScriptAvailable(s_frsky_view);
switch (state) {
case SCRIPT_OK:
return true; // contents will be drawed by Lua Task
case SCRIPT_NOFILE:
return false; // requested lua telemetry screen not available
case SCRIPT_SYNTAX_ERROR:
case SCRIPT_PANIC:
case SCRIPT_KILLED:
luaError(lsScripts, state, false);
return true;
}
return false;
}
#endif
#if defined(CPUARM)
if (TELEMETRY_SCREEN_TYPE(s_frsky_view) == TELEMETRY_SCREEN_TYPE_NONE) {
return false;
@@ -504,6 +522,9 @@ void menuViewTelemetryFrsky(event_t event)
switch (event) {
case EVT_KEY_FIRST(KEY_EXIT):
#if defined(LUA)
case EVT_KEY_LONG(KEY_EXIT):
#endif
killEvents(event);
chainMenu(menuMainView);
break;