From 400603abdfb4ba7566e0cae8dbed9268f06716dc Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 27 Jul 2018 15:09:55 +0200 Subject: Lua -- Fix device hang when scroll function active on clear_screen I previously noticed that manually clearing the framebuffer while scroll function was active caused lua to crash I could reproduce in sim and on device but I thought using the plugin supplied rb->lcd_clear_screen was immune to this issue Unfortunately some devices exhibit this behavior with the plugin function as well This patch adds rb->lcd_scroll_stop() before lcd_clear_screen at lua start-up and to the supplied include file lcd.lua Change-Id: I9800145e5c834ea27df5db5f1bca50b0d40faa49 --- apps/plugins/lua/include_lua/lcd.lua | 2 +- apps/plugins/lua/rocklua.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/plugins/lua/include_lua/lcd.lua b/apps/plugins/lua/include_lua/lcd.lua index bbf0f240aa..e0a3c5895a 100644 --- a/apps/plugins/lua/include_lua/lcd.lua +++ b/apps/plugins/lua/include_lua/lcd.lua @@ -80,10 +80,10 @@ local _lcd = {} do -- clears lcd, optional.. ([color, x1, y1, x2, y2, clip]) local function clear(t, clr, ...) + rb.lcd_scroll_stop() --rb really doesn't like bg change while scroll if clr == _NIL and ... == _NIL then rb.lcd_clear_display() else - rb.lcd_scroll_stop() --rb really doesn't like bg change while scroll _LCD:clear(clr, ...) end end diff --git a/apps/plugins/lua/rocklua.c b/apps/plugins/lua/rocklua.c index 5539618a43..48b5d62c37 100644 --- a/apps/plugins/lua/rocklua.c +++ b/apps/plugins/lua/rocklua.c @@ -160,6 +160,7 @@ enum plugin_status plugin_start(const void* parameter) rocklua_openlibs(L); status = luaL_loadfile(L, filename); if (!status) { + rb->lcd_scroll_stop(); /* rb doesn't like bg change while scroll */ rb->lcd_clear_display(); status = docall(L); } -- cgit v1.2.3