mbed

Fork of mbed-dev by mbed official

Revision:
182:57724642e740
Parent:
181:96ed750bd169
diff -r 96ed750bd169 -r 57724642e740 targets/TARGET_STM/can_api.c
--- a/targets/TARGET_STM/can_api.c	Wed Jan 17 15:23:54 2018 +0000
+++ b/targets/TARGET_STM/can_api.c	Fri Feb 16 16:09:33 2018 +0000
@@ -468,11 +468,11 @@
             sFilterConfig.FilterIdLow =  0x0;
             sFilterConfig.FilterMaskIdHigh = mask << 5;
             sFilterConfig.FilterMaskIdLow = 0x0; // allows both remote and data frames
-        } else if (format == CANExtended) {
+        } else { // format == CANExtended
             sFilterConfig.FilterIdHigh = id >> 13; // EXTID[28:13]
-            sFilterConfig.FilterIdLow = (0x00FF & (id << 3)) | (1 << 2);  // EXTID[12:0]
+            sFilterConfig.FilterIdLow = (0xFFFF & (id << 3)) | (1 << 2); // EXTID[12:0] + IDE
             sFilterConfig.FilterMaskIdHigh = mask >> 13;
-            sFilterConfig.FilterMaskIdLow = (0x00FF & (mask << 3)) | (1 << 2);
+            sFilterConfig.FilterMaskIdLow = (0xFFFF & (mask << 3)) | (1 << 2);
         }
 
         sFilterConfig.FilterFIFOAssignment = 0;