Skip to content

Commit

Permalink
Erase TWAI (#2359)
Browse files Browse the repository at this point in the history
* Swap order of generics

* Don't refer to Instance in irq handler

* Deduplicate a bit

* Take &self

* Reduce nesting

* Erase TWAI instance
  • Loading branch information
bugadani authored Oct 24, 2024
1 parent 1de2483 commit c163b05
Show file tree
Hide file tree
Showing 11 changed files with 478 additions and 369 deletions.
2 changes: 2 additions & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `AnyPin` now implements `From<GpioPin<N>>`. (#2326)
- Added `AnySpi` and `AnySpiDmaChannel`. (#2334)
- Added `AnyI2s` and `AnyI2sDmaChannel`. (#2367)
- Added `AnyTwai`. (#2359)
- `Pins::steal()` to unsafely obtain GPIO. (#2335)
- `I2c::with_timeout` (#2361)

Expand All @@ -23,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Peripheral type erasure for SPI (#2334)
- Peripheral type erasure for I2S (#2367)
- Peripheral type erasure for I2C (#2361)
- Peripheral type erasure for TWAI (#2359)

### Fixed

Expand Down
1 change: 1 addition & 0 deletions esp-hal/MIGRATING-0.21.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ peripherals:
- SPI (both master and slave)
- I2S
- I2C
- TWAI

```diff
-Spi<'static, SPI2, FullDuplexMode>
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ crate::peripherals! {
TIMG0 <= TIMG0,
TIMG1 <= TIMG1,
TOUCH <= virtual,
TWAI0 <= TWAI0,
[Twai0] TWAI0 <= TWAI0,
UART0 <= UART0,
UART1 <= UART1,
UART2 <= UART2,
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32c3/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ crate::peripherals! {
SW_INTERRUPT <= virtual,
TIMG0 <= TIMG0,
TIMG1 <= TIMG1,
TWAI0 <= TWAI0,
[Twai0] TWAI0 <= TWAI0,
UART0 <= UART0,
UART1 <= UART1,
UHCI0 <= UHCI0,
Expand Down
4 changes: 2 additions & 2 deletions esp-hal/src/soc/esp32c6/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ crate::peripherals! {
TIMG0 <= TIMG0,
TIMG1 <= TIMG1,
TRACE0 <= TRACE,
TWAI0 <= TWAI0,
TWAI1 <= TWAI1,
[Twai0] TWAI0 <= TWAI0,
[Twai1] TWAI1 <= TWAI1,
UART0 <= UART0,
UART1 <= UART1,
UHCI0 <= UHCI0,
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32h2/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ crate::peripherals! {
TIMG0 <= TIMG0,
TIMG1 <= TIMG1,
TRACE0 <= TRACE,
TWAI0 <= TWAI0,
[Twai0] TWAI0 <= TWAI0,
UART0 <= UART0,
UART1 <= UART1,
UHCI0 <= UHCI0,
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32s2/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ crate::peripherals! {
SW_INTERRUPT <= virtual,
TIMG0 <= TIMG0,
TIMG1 <= TIMG1,
TWAI0 <= TWAI0,
[Twai0] TWAI0 <= TWAI0,
UART0 <= UART0,
UART1 <= UART1,
UHCI0 <= UHCI0,
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32s3/peripherals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ crate::peripherals! {
SW_INTERRUPT <= virtual,
TIMG0 <= TIMG0,
TIMG1 <= TIMG1,
TWAI0 <= TWAI0,
[Twai0] TWAI0 <= TWAI0,
UART0 <= UART0,
UART1 <= UART1,
UART2 <= UART2,
Expand Down
Loading

0 comments on commit c163b05

Please sign in to comment.