Tentative fix for wakeup in STM32 CAN driver.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4796 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2012-11-03 09:54:07 +00:00
parent 18278d4296
commit 8202283e9d
1 changed files with 2 additions and 0 deletions

View File

@ -131,6 +131,8 @@ CH_IRQ_HANDLER(STM32_CAN1_SCE_HANDLER) {
CAN1->MSR = CAN_MSR_ERRI | CAN_MSR_WKUI | CAN_MSR_SLAKI;
/* Wakeup event.*/
if (msr & CAN_MSR_WKUI) {
CAND1.state = CAN_READY;
CAND1.can->MCR &= ~CAN_MCR_SLEEP;
chSysLockFromIsr();
chEvtBroadcastI(&CAND1.wakeup_event);
chSysUnlockFromIsr();