Skip to content
This repository was archived by the owner on Aug 18, 2024. It is now read-only.

Commit afb279f

Browse files
committed
🐛 Fix logic for can baud rate configuration
1 parent 2b926ab commit afb279f

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/3.0.4.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 🚀 Release 3.0.4
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
deploy:
8+
uses: ./.github/workflows/deploy-version.yml
9+
with:
10+
version: 3.0.4
11+
secrets: inherit

src/can.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,8 @@ void can::configure_baud_rate(const can::port& p_port,
156156
bool baud_rate_above_100khz = p_settings.baud_rate > 100.0_kHz;
157157
auto baud_rate_prescalar = hal::is_valid(p_settings, frequency);
158158

159-
bool valid_configuration = external_oscillator_used &&
160-
baud_rate_above_100khz &&
161-
baud_rate_prescalar.has_value();
162-
163-
if (valid_configuration) {
159+
if ((baud_rate_above_100khz && not external_oscillator_used) ||
160+
not baud_rate_prescalar.has_value()) {
164161
safe_throw(hal::operation_not_supported(this));
165162
}
166163

0 commit comments

Comments
 (0)