Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Lua interpreter made iPod mini reboot
« previous next »
  • Print
Pages: [1]

Author Topic: Lua interpreter made iPod mini reboot  (Read 1186 times)

Offline Astorga

  • Member
  • *
  • Posts: 48
  • iPod mini and iPod Video 5G
Lua interpreter made iPod mini reboot
« on: July 23, 2010, 12:24:49 PM »
I was making a test in iPod mini using a lua file, and it made my DAP reboots.
Here's the code:
Code: [Select]
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)

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?
« Last Edit: July 23, 2010, 03:14:20 PM by Astorga »
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Lua interpreter made iPod mini reboot
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.044 seconds with 15 queries.