Skip to content

Commit

Permalink
fixup: force error if CAN_DEVICE_DEFAULT_LOOP_DELAY not defined
Browse files Browse the repository at this point in the history
mandatory for bitrate switching and HW related, so cannot have a default
value
  • Loading branch information
gdoffe committed Oct 7, 2024
1 parent 9f97ee8 commit 51e6ddf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions sys/can/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 51e6ddf

Please sign in to comment.