Skip to content

Commit 6ee2031

Browse files
committed
Clear LCD for CMS script at startup
Clears the LCD and draws the "refresh[whateverbuttonrefreshis]" at the top row when the script is launched. The current behaviour is to not clear the screen when the script is launched. If it's not responding and a manual refresh is required, there's no way for the user to know this. By clearing the screen and showing the message, the user should get an idea of what has to be done.
1 parent f6f3e89 commit 6ee2031

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/SCRIPTS/BF/CMS/common.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ screen = {
4949
end,
5050
draw = function()
5151
if (screen.buffer ~= nil and screen.config ~= nil and #screen.buffer > 0) then
52-
lcd.clear()
52+
screen.clear()
5353
for char = 1, #screen.buffer do
5454
if (screen.buffer[char] ~= 32) then -- skip spaces to avoid CPU spikes
5555
c = string.char(screen.buffer[char])
@@ -60,8 +60,11 @@ screen = {
6060
lcd.drawText(xPos, yPos, c, screen.config.textSize)
6161
end
6262
end
63-
lcd.drawText(screen.config.refresh.left, screen.config.refresh.top, screen.config.refresh.text, screen.config.textSize)
6463
end
64+
end,
65+
clear = function()
66+
lcd.clear()
67+
lcd.drawText(screen.config.refresh.left, screen.config.refresh.top, screen.config.refresh.text, screen.config.textSize)
6568
end
6669
}
6770

@@ -70,6 +73,7 @@ cms = {
7073
init = function(cmsConfig)
7174
screen.config = assert(cmsConfig, "Resolution not supported")
7275
screen.reset()
76+
screen.clear()
7377
protocol.cms.close()
7478
cms.menuOpen = false
7579
end,

0 commit comments

Comments
 (0)