File tree 1 file changed +8
-4
lines changed
libraries/Arduino_CAN/examples/CANReadFilter
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 23
23
24
24
#include < Arduino_CAN.h>
25
25
26
- #define Mask11Bit 0x1FFC0000
27
- #define Mask29Bit 0x1FFFFFFF
26
+ /* *************************************************************************************
27
+ * CONST
28
+ **************************************************************************************/
29
+
30
+ static uint32_t const CAN_FILTER_MASK_STANDARD = 0x1FFC0000 ;
31
+ static uint32_t const CAN_FILTER_MASK_EXTENDED = 0x1FFFFFFF ;
28
32
29
33
/* *************************************************************************************
30
34
* SETUP/LOOP
@@ -35,8 +39,8 @@ void setup()
35
39
Serial.begin (115200 );
36
40
while (!Serial) { }
37
41
38
- CAN.setFilterMask_Extended (Mask29Bit );
39
- CAN.setFilterMask_Standard (Mask11Bit );
42
+ CAN.setFilterMask_Extended (CAN_FILTER_MASK_EXTENDED );
43
+ CAN.setFilterMask_Standard (CAN_FILTER_MASK_STANDARD );
40
44
41
45
for (int c=16 ; c <= 23 ; c++) {
42
46
CAN.setMailboxID (c, 0x0100 );
You can’t perform that action at this time.
0 commit comments