diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-12-06 17:49:53 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-12-06 17:49:53 +0000 |
commit | f1aa994420693645eb0ea371017170b465f86ef2 (patch) | |
tree | 4c5b36af7c16b0fa5a518b6ec345cc466f740371 /os/hal/platforms/STM32 | |
parent | b33d1f0a4ecbd799fed97c2f27f7a5fe5b19f818 (diff) | |
download | ChibiOS-f1aa994420693645eb0ea371017170b465f86ef2.tar.gz ChibiOS-f1aa994420693645eb0ea371017170b465f86ef2.tar.bz2 ChibiOS-f1aa994420693645eb0ea371017170b465f86ef2.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1380 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32')
-rw-r--r-- | os/hal/platforms/STM32/can_lld.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/os/hal/platforms/STM32/can_lld.c b/os/hal/platforms/STM32/can_lld.c index b9b088515..1115860eb 100644 --- a/os/hal/platforms/STM32/can_lld.c +++ b/os/hal/platforms/STM32/can_lld.c @@ -59,9 +59,11 @@ CH_IRQ_HANDLER(Vector8C) { /* No more events until a message is transmitted.*/
CAN1->TSR = CAN_TSR_RQCP0 | CAN_TSR_RQCP1 | CAN_TSR_RQCP2;
+ chSysLockFromIsr();
while (chSemGetCounterI(&CAND1.cd_txsem) < 0)
chSemSignalI(&CAND1.cd_txsem);
chEvtBroadcastI(&CAND1.cd_txempty_event);
+ chSysUnlockFromIsr();
CH_IRQ_EPILOGUE();
}
@@ -75,21 +77,23 @@ CH_IRQ_HANDLER(Vector90) { CH_IRQ_PROLOGUE();
rf0r = CAN1->RF0R;
- chSysLockFromIsr();
if ((rf0r & CAN_RF0R_FMP0) > 0) {
/* No more receive events until the queue 0 has been emptied.*/
CAN1->IER &= ~CAN_IER_FMPIE0;
+ chSysLockFromIsr();
while (chSemGetCounterI(&CAND1.cd_rxsem) < 0)
chSemSignalI(&CAND1.cd_rxsem);
chEvtBroadcastI(&CAND1.cd_rxfull_event);
+ chSysUnlockFromIsr();
}
if ((rf0r & CAN_RF0R_FOVR0) > 0) {
/* Overflow events handling.*/
CAN1->RF0R = CAN_RF0R_FOVR0;
canAddFlagsI(&CAND1, CAN_OVERFLOW_ERROR);
+ chSysLockFromIsr();
chEvtBroadcastI(&CAND1.cd_error_event);
+ chSysUnlockFromIsr();
}
- chSysUnlockFromIsr();
CH_IRQ_EPILOGUE();
}
|