wake up a Thread from an ISR
Posted: Tue Feb 21, 2017 6:30 pm
Hi, ich have a problem waking up my thread from isr. i implemented it like mentioned here for async wakeup http://www.chibios.org/dokuwiki/doku.php?id=chibios:howtos:wakeup
it simply does nothing, and the interrupt works if i put code in it to flash an LED.
if i commend out the 2nd line in the main the thread wakes up.
im currently working with the old chibios 2.6
please help me, its very urgent
kind regards
cheater
Code: Select all
static WORKING_AREA(blinkLeftThreadWorkingArea, 1024);
static msg_t blinkLeftThread(void *param) {
blinkerLeftThread = chThdSelf();
chEvtWaitAny((eventmask_t)1);
//some code doing stuff
return;
}
void startBlinkerLeft(){
blinkThreadLeft=true;
chThdCreateStatic(blinkLeftThreadWorkingArea, sizeof(blinkLeftThreadWorkingArea), HIGHPRIO, blinkLeftThread, (void *)&blinkThreadLeft);
}
static void toggleBlinkerLeft(EXTDriver *extp, expchannel_t channel){
CH_IRQ_PROLOGUE();
chSysLockFromIsr();
chEvtSignal(blinkerLeftThread, (eventmask_t)1);
chSysUnlockFromIsr();
CH_IRQ_EPILOGUE();
}
int main(void)
{
startBlinkerLeft();
//chEvtSignal(blinkerLeftThread, (eventmask_t)1);
}
it simply does nothing, and the interrupt works if i put code in it to flash an LED.
if i commend out the 2nd line in the main the thread wakes up.
im currently working with the old chibios 2.6
please help me, its very urgent
kind regards
cheater