AVR32 timer interrupts

classic Classic list List threaded Threaded
2 messages Options
Martin Guy Martin Guy
Reply | Threaded
Open this post in threaded view
|

AVR32 timer interrupts

Hi
  I'm trying to test AVR32 Lua interrupts in trunk and don't see what
I'm doing wrong.

Using (adapted from the sample code at
http://www.eluaproject.net/doc/v0.8/en_inthandlers.html):

function tmr_handler( resnum )
  print( string.format( "Timer interrupt for id %d", resnum ) )
end
cpu.set_int_handler( cpu.INT_TMR_MATCH, tmr_handler )  -- returns nil
tmr.set_match_int(500000, tmr.INT_CYCLIC, 0 )  --once every half second
cpu.sei( cpu.INT_TMR_MATCH, 0)

it sits there for about 15 seconds, then starts going

ERROR in elua_int_add: buffer overflow, interrupt not queued
ERROR in elua_int_add: buffer overflow, interrupt not queued
ERROR in elua_int_add: buffer overflow, interrupt not queued

giving one message every half second.

Likewise, for GPIO interrupts:

button = pio.PX_16
function gpio_negedge_handler( resnum )
    local port, pin = pio.decode( resnum )
    print( string.format( "GPIO NEGEDGE interrupt on port %d, pin %d",
port, pin ) )
end
cpu.set_int_handler( cpu.INT_GPIO_NEGEDGE, gpio_negedge_handler )
cpu.sei( cpu.INT_GPIO_NEGEDGE, button )

nothng happens until the 26th button press, at which point I get

ERROR in elua_int_add: buffer overflow, interrupt not queued

each time I press the button

Does anyone know what I am missing here?

    M
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Martin Guy Martin Guy
Reply | Threaded
Open this post in threaded view
|

Re: AVR32 timer interrupts

On 16 January 2012 08:02, Martin Guy <[hidden email]> wrote:
>  I'm trying to test AVR32 Lua interrupts in trunk and don't see what
> I'm doing wrong.

> nothng happens until the 26th button press, at which point I get
>
> ERROR in elua_int_add: buffer overflow, interrupt not queued
>
> each time I press the button
>
> Does anyone know what I am missing here?

OK, got it.  The interpreter needs to be running a program for the Lua
interrupts to be recognized.  Sorry for the noise...

    M
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev