Skip to content

Commit

Permalink
drivers: can: mcan: change asserts to match updated timing parameters
Browse files Browse the repository at this point in the history
Update the asserts to match the updated Bosch M_CAN minimum/maximum CAN
timing parameters.

Fixes: zephyrproject-rtos#58429

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
  • Loading branch information
henrikbrixandersen authored and nashif committed May 31, 2023
1 parent fd6ba71 commit 17f0356
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/can/can_mcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ int can_mcan_set_timing(const struct device *dev, const struct can_timing *timin
}

__ASSERT_NO_MSG(timing->prop_seg == 0U);
__ASSERT_NO_MSG(timing->phase_seg1 <= 0x100 && timing->phase_seg1 > 0U);
__ASSERT_NO_MSG(timing->phase_seg2 <= 0x80 && timing->phase_seg2 > 0U);
__ASSERT_NO_MSG(timing->phase_seg1 <= 0x100 && timing->phase_seg1 > 1U);
__ASSERT_NO_MSG(timing->phase_seg2 <= 0x80 && timing->phase_seg2 > 1U);
__ASSERT_NO_MSG(timing->prescaler <= 0x200 && timing->prescaler > 0U);
__ASSERT_NO_MSG(timing->sjw == CAN_SJW_NO_CHANGE ||
(timing->sjw <= 0x80 && timing->sjw > 0U));
Expand Down Expand Up @@ -260,7 +260,7 @@ int can_mcan_set_timing_data(const struct device *dev, const struct can_timing *
__ASSERT_NO_MSG(timing_data->phase_seg2 <= 0x10 && timing_data->phase_seg2 > 0U);
__ASSERT_NO_MSG(timing_data->prescaler <= 0x20 && timing_data->prescaler > 0U);
__ASSERT_NO_MSG(timing_data->sjw == CAN_SJW_NO_CHANGE ||
(timing_data->sjw <= 0x80 && timing_data->sjw > 0U));
(timing_data->sjw <= 0x10 && timing_data->sjw > 0U));

k_mutex_lock(&data->lock, K_FOREVER);

Expand Down

0 comments on commit 17f0356

Please sign in to comment.