I am trying to read an external button interrupt in Telosb. I am using GIO2 to read the interrupt, and it works quite nice with polling techniques, but I am looking something closer to an actual interrupt method.
Referring to TinyOS, there was a HplMsp430Interrupt interface that one could implement for that purpose. I cannot find something similar in Contiki-OS.
Changing pin status does not seem to fire any events, as PROCESS_WAIT_EVENTdoes not respond.
A driver for the button on TelosB is already implemented in Contiki. There is no need to work at the interrupt handler level to use it, just call the Contiki API:
If you're talking about something else and actually need to implement you own interrupt handler, then Contiki will not help you much. For some Contiki platforms there are macros or functions for controlling GPIO pins, but not for
msp430. So you just need to use the I/O port interface from the compiler headers, and declare interrupt handler functions withISR(PORT_NUMBER, function_name), wherePORT_NUMBERisPORT1orPORT2(a port that supports interrupt handlers).See
contiki/cpu/msp430/button.cfor an example how the TelosB button interrupt handler is implemented, it's pretty simple.