Support and General Use > Plugins/Viewers
Lua interpreter made iPod mini reboot
(1/1)
Astorga:
I was making a test in iPod mini using a lua file, and it made my DAP reboots.
Here's the code:
--- Code: ---function sayhello(seconds)
local message = string.format("Hello from LUA for %d seconds", 5)
rb.splash(seconds, message)
end
-- Drawn an X on the screen
rb.lcd_clear_display()
rb.lcd_drawline(0, 0, rb.LCD_WIDTH, rb.LCD_HEIGHT)
rb.lcd_drawline(rb.LCD_WIDTH, 0, 0, rb.LCD_HEIGHT)
rb.lcd_update()
local seconds = 500
rb.lcd_putsxy(10,10,"teste1")
rb.lcd_update()
function test()
while true do
rb.lcd_clear_display()
local but = rb.button_get(true)
--[[if but == 2 then rb.lcd_putsxy(10,30,"Menu")
elseif but == 4 then rb.lcd_putsxy(10,30,"Play")
elseif but == 8 then rb.lcd_putsxy(10,30,"Right")
elseif but == 16 then rb.lcd_putsxy(10,30,"Left")
else rb.lcd_putsxy(10,30,"----") end]]--
rb.lcd_putsxy(10,30,but)
rb.lcd_update()
if but == 1 then break end
end
end
test()
sayhello(seconds)
--- End code ---
I'm using current build. That happens when I was taking note of the key values, so when I saw the screen, it was already rebooting.
Edit: apart of that, the buttons constants are the same for all iPods?
Edit2: The fact that I forgot a call to rb.yield() explains that?
Navigation
[0] Message Index
Go to full version