Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions include/zephyr/drivers/can.h
Original file line number Diff line number Diff line change
Expand Up @@ -1455,18 +1455,20 @@ static inline int z_impl_can_get_state(const struct device *dev, enum can_state
*/
__syscall int can_recover(const struct device *dev, k_timeout_t timeout);

#ifdef CONFIG_CAN_MANUAL_RECOVERY_MODE
static inline int z_impl_can_recover(const struct device *dev, k_timeout_t timeout)
{
#ifdef CONFIG_CAN_MANUAL_RECOVERY_MODE
const struct can_driver_api *api = (const struct can_driver_api *)dev->api;

if (api->recover == NULL) {
return -ENOSYS;
}

return api->recover(dev, timeout);
}
#else /* !CONFIG_CAN_MANUAL_RECOVERY_MODE */
return -ENOSYS;
#endif /* CONFIG_CAN_MANUAL_RECOVERY_MODE */
}

/**
* @brief Set a callback for CAN controller state change events
Expand Down