@@ -157,9 +157,6 @@ void menuModelCustomScripts(event_t event)
|
||||
case SCRIPT_SYNTAX_ERROR:
|
||||
lcdDrawText(30*FW+2, y, "(error)");
|
||||
break;
|
||||
case SCRIPT_KILLED:
|
||||
lcdDrawText(29*FW+2, y, "(killed)");
|
||||
break;
|
||||
default:
|
||||
lcdDrawNumber(34*FW, y, luaGetCpuUsed(scriptIndex), RIGHT);
|
||||
lcdDrawChar(34*FW, y, '%');
|
||||
|
||||
@@ -177,7 +177,6 @@ bool displayTelemetryScreen()
|
||||
return false; // requested lua telemetry screen not available
|
||||
case SCRIPT_SYNTAX_ERROR:
|
||||
case SCRIPT_PANIC:
|
||||
case SCRIPT_KILLED:
|
||||
luaError(lsScripts, state, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -150,9 +150,6 @@ void menuModelCustomScripts(event_t event)
|
||||
case SCRIPT_SYNTAX_ERROR:
|
||||
lcdDrawText(30*FW+2, y, "(error)");
|
||||
break;
|
||||
case SCRIPT_KILLED:
|
||||
lcdDrawText(29*FW+2, y, "(killed)");
|
||||
break;
|
||||
default:
|
||||
lcdDrawNumber(34*FW, y, luaGetCpuUsed(scriptIndex), RIGHT);
|
||||
lcdDrawChar(34*FW, y, '%');
|
||||
|
||||
@@ -179,7 +179,6 @@ bool displayTelemetryScreen()
|
||||
return false; // requested lua telemetry screen not available
|
||||
case SCRIPT_SYNTAX_ERROR:
|
||||
case SCRIPT_PANIC:
|
||||
case SCRIPT_KILLED:
|
||||
luaError(lsScripts, state, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,6 @@ class ScriptEditWindow : public Page {
|
||||
};
|
||||
|
||||
constexpr char SCRIPT_STATUS_ERROR[] = "(error)";
|
||||
constexpr char SCRIPT_STATUS_KILLED[] = "(killed)";
|
||||
|
||||
class ScriptLineButton : public Button
|
||||
{
|
||||
@@ -204,10 +203,6 @@ class ScriptLineButton : public Button
|
||||
dc->drawSizedText(x, y, SCRIPT_STATUS_ERROR,
|
||||
sizeof(SCRIPT_STATUS_ERROR), textColor);
|
||||
break;
|
||||
case SCRIPT_KILLED:
|
||||
dc->drawSizedText(x, y, SCRIPT_STATUS_KILLED,
|
||||
sizeof(SCRIPT_STATUS_KILLED), textColor);
|
||||
break;
|
||||
default:
|
||||
dc->drawNumber(x, y, runtimeData->instructions, textColor, 0, nullptr, "%");
|
||||
break;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#if defined(SPLASH)
|
||||
|
||||
const uint8_t __bmp_splash[] {
|
||||
#include "big_logo.lbm"
|
||||
#include "splash.lbm"
|
||||
};
|
||||
|
||||
void drawSplash()
|
||||
|
||||
@@ -155,20 +155,23 @@ void StandaloneLuaWindow::runLua(event_t evt)
|
||||
// Set global LUA LCD buffer
|
||||
luaLcdBuffer = &lcdBuffer;
|
||||
|
||||
TRACE("evt = 0x%x", evt);
|
||||
|
||||
bool hasRun = luaTask(evt, RUN_STNDAL_SCRIPT, true);
|
||||
if (hasRun) {
|
||||
if (luaState != INTERPRETER_RELOAD_PERMANENT_SCRIPTS) {
|
||||
if (luaTask(evt, true)) {
|
||||
#if defined(DEBUG_WINDOWS)
|
||||
TRACE("# StandaloneLuaWindow::invalidate()");
|
||||
TRACE("# StandaloneLuaWindow::invalidate()");
|
||||
#endif
|
||||
invalidate();
|
||||
} else {
|
||||
invalidate();
|
||||
} else {
|
||||
// The script was preempted, and the LCD should not be updated yet
|
||||
}
|
||||
}
|
||||
|
||||
if (luaState == INTERPRETER_RELOAD_PERMANENT_SCRIPTS) {
|
||||
// Script does not run anymore...
|
||||
TRACE("LUA standalone script exited: deleting window!");
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
|
||||
// Kill global LUA LCD buffer
|
||||
luaLcdBuffer = nullptr;
|
||||
}
|
||||
|
||||
@@ -125,9 +125,9 @@ void Widget::paint(BitmapBuffer * dc)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(HARDWARE_KEYS)
|
||||
void Widget::onEvent(event_t event)
|
||||
{
|
||||
#if defined(HARDWARE_KEYS)
|
||||
TRACE("### event = 0x%x ###", event);
|
||||
if (!fullscreen) {
|
||||
if (event == EVT_KEY_BREAK(KEY_EXIT)) {
|
||||
@@ -145,8 +145,8 @@ void Widget::onEvent(event_t event)
|
||||
killEvents(event);
|
||||
setFullscreen(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void Widget::update()
|
||||
{
|
||||
|
||||
@@ -83,11 +83,12 @@ class Widget : public Button
|
||||
|
||||
// Window interface
|
||||
void checkEvents() override;
|
||||
#if defined(HARDWARE_KEYS)
|
||||
void onEvent(event_t event) override;
|
||||
#endif
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
bool onTouchEnd(coord_t x, coord_t y) override;
|
||||
bool onTouchSlide(coord_t x, coord_t y, coord_t startX, coord_t startY,
|
||||
coord_t slideX, coord_t slideY) override;
|
||||
bool onTouchSlide(coord_t x, coord_t y, coord_t startX, coord_t startY, coord_t slideX, coord_t slideY) override;
|
||||
#endif
|
||||
void paint(BitmapBuffer * dc) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user