From 3722d331472336c169d22a930d3d6853091d76b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=85=A7?= Date: Fri, 15 May 2026 23:50:45 +0800 Subject: [PATCH] fix: only call _validate() when strict=True _validate() was called unconditionally, rejecting brp values > 64 even when strict=False. This is too restrictive for some peripherals like FYSETC UCAN which support brp up to 1024. Only call _validate() when strict=True, matching the behavior of _restrict_to_minimum_range(). Fixes #2061 --- can/bit_timing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/can/bit_timing.py b/can/bit_timing.py index 2bb04bfbe..4311ff9a4 100644 --- a/can/bit_timing.py +++ b/can/bit_timing.py @@ -74,8 +74,8 @@ def __init__( "sjw": sjw, "nof_samples": nof_samples, } - self._validate() if strict: + self._validate() self._restrict_to_minimum_range() def _validate(self) -> None: