Skip to content

Commit

Permalink
Disable TWAI CLKOUT when initializing peripheral
Browse files Browse the repository at this point in the history
This fixes the issue with receiving on GPIO1 on the ESP32-C3.
  • Loading branch information
msvisser authored and michiel-visser-inspiro committed Aug 14, 2024
1 parent 352879a commit 46423f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- SPI: Clear DMA interrupts before (not after) DMA starts (#1859)
- SPI: disable and re-enable MISO and MOSI in `start_transfer_dma`, `start_read_bytes_dma` and `start_write_bytes_dma` accordingly (#1894)
- TWAI: GPIO pins are not configured as input and output (#1906)
- TWAI: CLKOUT is not disabled on initialization (#1949)

### Removed

Expand Down
5 changes: 5 additions & 0 deletions esp-hal/src/twai/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,11 @@ where
.err_warning_limit()
.write(|w| unsafe { w.err_warning_limit().bits(96) });

// Disable CLKOUT
T::register_block()
.clock_divider()
.write(|w| unsafe { w.cd().bits(0).clock_off().bit(true) });

let mut cfg = TwaiConfiguration {
peripheral: PhantomData,
phantom: PhantomData,
Expand Down

0 comments on commit 46423f2

Please sign in to comment.