diff --git a/sys/can/device.c b/sys/can/device.c index 60553b86802f..d030621caaa2 100644 --- a/sys/can/device.c +++ b/sys/can/device.c @@ -35,14 +35,20 @@ #define ENABLE_DEBUG 0 #include "debug.h" +#ifdef MODULE_FDCAN +/** + * The loop delay in CAN, especially in CAN FD with bitrate switching, affects synchronization due to increased data rates. + * The unit is nanoseconds. + */ +#ifndef CAN_DEVICE_DEFAULT_LOOP_DELAY +#error "CAN_DEVICE_DEFAULT_LOOP_DELAY must be defined in the application's Makefile. This property can be found in the datasheet of the CAN transceiver in use. The unit is nanoseconds." +#endif /* CAN_DEVICE_DEFAULT_LOOP_DELAY */ +#endif /* MODULE_FDCAN */ + #ifndef CAN_DEVICE_MSG_QUEUE_SIZE #define CAN_DEVICE_MSG_QUEUE_SIZE 64 #endif -#ifndef CAN_DEVICE_DEFAULT_LOOP_DELAY -#define CAN_DEVICE_DEFAULT_LOOP_DELAY 200 /* nanoseconds */ -#endif - #ifdef MODULE_CAN_PM #define CAN_DEVICE_PM_DEFAULT_RX_TIMEOUT (10 * US_PER_SEC) #define CAN_DEVICE_PM_DEFAULT_TX_TIMEOUT (2 * US_PER_SEC)