Skip to content

Commit

Permalink
Merge pull request #417 from klutvott123/clear-lcd-at-cms-startup
Browse files Browse the repository at this point in the history
Clear LCD for CMS script at startup
  • Loading branch information
klutvott123 authored Dec 29, 2021
2 parents f6f3e89 + 6ee2031 commit 4a181bf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/SCRIPTS/BF/CMS/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ screen = {
end,
draw = function()
if (screen.buffer ~= nil and screen.config ~= nil and #screen.buffer > 0) then
lcd.clear()
screen.clear()
for char = 1, #screen.buffer do
if (screen.buffer[char] ~= 32) then -- skip spaces to avoid CPU spikes
c = string.char(screen.buffer[char])
Expand All @@ -60,8 +60,11 @@ screen = {
lcd.drawText(xPos, yPos, c, screen.config.textSize)
end
end
lcd.drawText(screen.config.refresh.left, screen.config.refresh.top, screen.config.refresh.text, screen.config.textSize)
end
end,
clear = function()
lcd.clear()
lcd.drawText(screen.config.refresh.left, screen.config.refresh.top, screen.config.refresh.text, screen.config.textSize)
end
}

Expand All @@ -70,6 +73,7 @@ cms = {
init = function(cmsConfig)
screen.config = assert(cmsConfig, "Resolution not supported")
screen.reset()
screen.clear()
protocol.cms.close()
cms.menuOpen = false
end,
Expand Down

0 comments on commit 4a181bf

Please sign in to comment.