Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for flexible CAN baud rate #296

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/Arduino_CAN/src/CanUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace util
**************************************************************************************/

std::tuple<bool, uint32_t, uint32_t, uint32_t>
calc_can_bit_timing(CanBitRate const can_bitrate,
calc_can_bit_timing(uint32_t const can_bitrate,
uint32_t const can_clock_Hz,
uint32_t const tq_min,
uint32_t const tq_max,
Expand Down
2 changes: 1 addition & 1 deletion libraries/Arduino_CAN/src/CanUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ std::tuple<bool, /* valid result found */
uint32_t, /* baud_rate_prescaler */
uint32_t, /* time_segment_1 */
uint32_t> /* time_segment_2 */
calc_can_bit_timing(CanBitRate const can_bitrate, uint32_t const can_clock_Hz, uint32_t const tq_min, uint32_t const tq_max,
calc_can_bit_timing(uint32_t const can_bitrate, uint32_t const can_clock_Hz, uint32_t const tq_min, uint32_t const tq_max,
uint32_t const tseg1_min, uint32_t const tseg1_max, uint32_t const tseg2_min, uint32_t const tseg2_max);

/**************************************************************************************
Expand Down
5 changes: 5 additions & 0 deletions libraries/Arduino_CAN/src/R7FA4M1_CAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ R7FA4M1_CAN::R7FA4M1_CAN(int const can_tx_pin, int const can_rx_pin)
**************************************************************************************/

bool R7FA4M1_CAN::begin(CanBitRate const can_bitrate)
{
return begin(static_cast<uint32_t>(can_bitrate));
}

bool R7FA4M1_CAN::begin(uint32_t const can_bitrate)
{
bool init_ok = true;

Expand Down
1 change: 1 addition & 0 deletions libraries/Arduino_CAN/src/R7FA4M1_CAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class R7FA4M1_CAN final : public HardwareCAN


bool begin(CanBitRate const can_bitrate) override;
bool begin(uint32_t const can_bitrate);
void end() override;

void setFilterMask_Standard(uint32_t const mask);
Expand Down
Loading