Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 10:33d27c970411, committed 23 months ago
- Comitter:
- ccli8
- Date:
- Wed Apr 17 17:41:40 2024 +0800
- Parent:
- 9:bb7099cd4943
- Child:
- 11:36d172d475fa
- Commit message:
- Disable filter #0
Reconfigure filter #0 to accept message ID 0 only.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Apr 17 17:33:23 2024 +0800
+++ b/main.cpp Wed Apr 17 17:41:40 2024 +0800
@@ -93,7 +93,15 @@
/* Attach irq function */
canObj.attach(irq_callback, CAN::RxIrq);
#endif
-
+
+ /* According to link below, filter #0 will accept any message, and
+ * no other filters can accept messages without re-configuring filter #0.
+ * https://os.mbed.com/questions/85183/How-to-use-CAN-filter-function
+ *
+ * Re-configure filter #0 to accept message ID 0 only.
+ */
+ canObj.filter(0, 0xFFFFFFFF);
+
canObj.filter(CAN_DEV_ID, 0, CANStandard, MSG_NUM_INDEX);
#endif