diff options
author | acirillo87 <acirillo87@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-06-22 17:15:49 +0000 |
---|---|---|
committer | acirillo87 <acirillo87@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-06-22 17:15:49 +0000 |
commit | 4854a3136aa7eb35297e1542cb2354e40a1c0a8d (patch) | |
tree | 7ce88de10a896ed2d4c1f9c312628fcaf6ab020b /os/hal | |
parent | 34d1df589ed8619799e89e296ba830bdc5db4a87 (diff) | |
download | ChibiOS-4854a3136aa7eb35297e1542cb2354e40a1c0a8d.tar.gz ChibiOS-4854a3136aa7eb35297e1542cb2354e40a1c0a8d.tar.bz2 ChibiOS-4854a3136aa7eb35297e1542cb2354e40a1c0a8d.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5872 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r-- | os/hal/platforms/SPC5xx/FlexCAN_v1/can_lld.c | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/os/hal/platforms/SPC5xx/FlexCAN_v1/can_lld.c b/os/hal/platforms/SPC5xx/FlexCAN_v1/can_lld.c index 9f9ee3814..7d9ce4ebb 100644 --- a/os/hal/platforms/SPC5xx/FlexCAN_v1/can_lld.c +++ b/os/hal/platforms/SPC5xx/FlexCAN_v1/can_lld.c @@ -83,11 +83,47 @@ CANDriver CAND6; static void can_lld_tx_handler(CANDriver *canp) {
uint32_t iflag1, iflag2;
- iflag1 = canp->flexcan->IFRL.R;
- iflag2 = canp->flexcan->IFRH.R;
/* No more events until a message is transmitted.*/
+ iflag1 = canp->flexcan->IFRL.R;
canp->flexcan->IFRL.R = iflag1 & 0xFFFFFF00;
- canp->flexcan->IFRH.R = canp->flexcan->IFRH.R & 0xFFFFFFFF;
+
+#if SPC5_CAN_USE_FLEXCAN0 && (SPC5_FLEXCAN0_MB == 64)
+ if(&CAND1 == canp) {
+ iflag2 = canp->flexcan->IFRH.R;
+ canp->flexcan->IFRH.R = canp->flexcan->IFRH.R & 0xFFFFFFFF;
+ }
+#endif
+#if SPC5_CAN_USE_FLEXCAN1 && (SPC5_FLEXCAN1_MB == 64)
+ if(&CAND2 == canp) {
+ iflag2 = canp->flexcan->IFRH.R;
+ canp->flexcan->IFRH.R = canp->flexcan->IFRH.R & 0xFFFFFFFF;
+ }
+#endif
+#if SPC5_CAN_USE_FLEXCAN2 && (SPC5_FLEXCAN2_MB == 64)
+ if(&CAND3 == canp) {
+ iflag2 = canp->flexcan->IFRH.R;
+ canp->flexcan->IFRH.R = canp->flexcan->IFRH.R & 0xFFFFFFFF;
+ }
+#endif
+#if SPC5_CAN_USE_FLEXCAN3 && (SPC5_FLEXCAN3_MB == 64)
+ if(&CAND4 == canp) {
+ iflag2 = canp->flexcan->IFRH.R;
+ canp->flexcan->IFRH.R = canp->flexcan->IFRH.R & 0xFFFFFFFF;
+ }
+#endif
+#if SPC5_CAN_USE_FLEXCAN4 && (SPC5_FLEXCAN4_MB == 64)
+ if(&CAND5 == canp) {
+ iflag2 = canp->flexcan->IFRH.R;
+ canp->flexcan->IFRH.R = canp->flexcan->IFRH.R & 0xFFFFFFFF;
+ }
+#endif
+#if SPC5_CAN_USE_FLEXCAN5 && (SPC5_FLEXCAN5_MB == 64)
+ if(&CAND6 == canp) {
+ iflag2 = canp->flexcan->IFRH.R;
+ canp->flexcan->IFRH.R = canp->flexcan->IFRH.R & 0xFFFFFFFF;
+ }
+#endif
+
chSysLockFromIsr();
while (chSemGetCounterI(&canp->txsem) < 0)
chSemSignalI(&canp->txsem);
|