From af26f8d4228cb8251f359d1ce182a0434ff8b352 Mon Sep 17 00:00:00 2001 From: fastbike Date: Tue, 30 Apr 2024 06:38:09 +1200 Subject: [PATCH] fix for https://github.com/arduino/ArduinoCore-renesas/issues/297 --- libraries/Arduino_CAN/src/CanUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Arduino_CAN/src/CanUtil.cpp b/libraries/Arduino_CAN/src/CanUtil.cpp index 9861e15e..75f88c4b 100644 --- a/libraries/Arduino_CAN/src/CanUtil.cpp +++ b/libraries/Arduino_CAN/src/CanUtil.cpp @@ -53,7 +53,7 @@ std::tuple /* If the fractional part is sufficiently close to zero, we have * found a valid prescaler configuration. */ - if (brp_fract < 0.01) + if (brp_fract < 0.01 || brp_fract > 0.99) { uint32_t const baud_rate_prescaler = static_cast(brp_ipart); /* Assign TSEG1 and TSEG2 to set the sample point at 75%. */