Events for PAL driver?
Posted: Sat Aug 31, 2013 12:46 am
Hi everyone.
I'm newbie in ChibiOS, and i got a little question for the community.
I trying to figure out how i can listen for events when a button is pressed, connected to a digital input pin, instead of permanently poll the status of that pin.
I found this code using the poll method:
Is there a way to use the Events infrastucture offered by ChibiOS?
Just in case: I'm using this (https://code.google.com/p/rtoslibs/) Arduino port with a Leonardo board.
Many thx in advance.
I'm newbie in ChibiOS, and i got a little question for the community.
I trying to figure out how i can listen for events when a button is pressed, connected to a digital input pin, instead of permanently poll the status of that pin.
I found this code using the poll method:
Code: Select all
static WORKING_AREA(waThread1, 32);
static msg_t Thread1(void *arg) {
while (TRUE) {
if (!palReadPad(IOPORT1, PORTA_BUTTON2))
palTogglePad(IOPORT1, PORTA_RELAY);
chThdSleepMilliseconds(1000);
}
return 0;
}Is there a way to use the Events infrastucture offered by ChibiOS?
Just in case: I'm using this (https://code.google.com/p/rtoslibs/) Arduino port with a Leonardo board.
Many thx in advance.