Skip to content

Commit

Permalink
Fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Sep 20, 2024
1 parent 07b54d1 commit 0b68c00
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions esp-hal/src/twai/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,8 @@ where

let mut prescaler = timing.baud_rate_prescaler;

if cfg!(esp32) {
#[cfg(esp32)]
{
if timing.baud_rate_prescaler > 128 {
// Enable /2 baudrate divider
T::register_block()
Expand Down Expand Up @@ -961,8 +962,14 @@ where
.rx_err_cnt()
.write(|w| unsafe { w.rx_err_cnt().bits(rec) });

// Clear any interrupts
_ = T::register_block().int_raw().read();
// Clear any interrupts by reading the status register
cfg_if::cfg_if! {
if #[cfg(any(esp32, esp32c3, esp32s2, esp32s3))] {
let _ = T::register_block().int_raw().read();
} else {
let _ = T::register_block().interrupt().read();
}
}

// Put the peripheral into operation mode by clearing the reset mode bit.
T::register_block()
Expand Down

0 comments on commit 0b68c00

Please sign in to comment.