Skip to content

Commit 3722d33

Browse files
author
小慧
committed
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
1 parent 5d5cc16 commit 3722d33

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

can/bit_timing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def __init__(
7474
"sjw": sjw,
7575
"nof_samples": nof_samples,
7676
}
77-
self._validate()
7877
if strict:
78+
self._validate()
7979
self._restrict_to_minimum_range()
8080

8181
def _validate(self) -> None:

0 commit comments

Comments
 (0)