eupn / stm32wb-hal

[WIP] embedded-hal for the STM32WB family of microcontrollers
20 stars 10 forks source link

Cannot compile without `rt` feature #1

Open rubdos opened 3 years ago

rubdos commented 3 years ago
stm32wb-hal = { version = "0.1.2", default-features = false, features = ["xG-package", "rt"]}

compiles, but

stm32wb-hal = { version = "0.1.2", default-features = false, features = ["xG-package"]}

does not:

error[E0433]: failed to resolve: could not find `interrupt` in `stm32wb_pac`
  --> /home/rsmet/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32wb-hal-0.1.2/src/ipcc.rs:60:61
   |
60 |             cortex_m::peripheral::NVIC::unmask(stm32wb_pac::interrupt::IPCC_C1_RX_IT);
   |                                                             ^^^^^^^^^ could not find `interrupt` in `stm32wb_pac`

error[E0433]: failed to resolve: could not find `interrupt` in `stm32wb_pac`
  --> /home/rsmet/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32wb-hal-0.1.2/src/ipcc.rs:61:61
   |
61 |             cortex_m::peripheral::NVIC::unmask(stm32wb_pac::interrupt::IPCC_C1_TX_IT);
   |                                                             ^^^^^^^^^ could not find `interrupt` in `stm32wb_pac`

I'm not too acquainted yet with embedded systems, but it would be nice to get a warning what went wrong, especially because I just wanted to select the specific chip.

eupn commented 3 years ago

Hello and thank you for noticing this. I never compiled this crate without the rt feature since I was always needed interrupts. I'll put behind a feature gate all parts of the code that uses stuff provided by PAC's rt feature.

rubdos commented 3 years ago

I'd say you could note somewhere that rt is something that's quite needed, but apparently that's also the convention in the Rust embedded world.

Thanks for coming back to it quickly. I'll be filing a PR for SPI support soon™.

eupn commented 3 years ago

Ok, I'll keep this open until it's documented that rt is needed for the parts of the HAL that use interrupts (like mbox).