File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
libraries/Arduino_CAN/examples/CANReadFilter Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 2323
2424#include < Arduino_CAN.h>
2525
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 ;
2832
2933/* *************************************************************************************
3034 * SETUP/LOOP
@@ -35,8 +39,8 @@ void setup()
3539 Serial.begin (115200 );
3640 while (!Serial) { }
3741
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 );
4044
4145 for (int c=16 ; c <= 23 ; c++) {
4246 CAN.setMailboxID (c, 0x0100 );
You can’t perform that action at this time.
0 commit comments