embassy-rs / embassy

Modern embedded framework, using Rust and async.
https://embassy.dev
Apache License 2.0
4.9k stars 666 forks source link

stm32f072: missing InterruptHandler<peripherals::I2C1> #2669

Closed ilfirin-ms closed 4 months ago

ilfirin-ms commented 4 months ago

If I've understand correctly,

embassy_stm32::i2c::I2c driver wants two IRQs:

   interrupt::typelevel::Binding<T::EventInterrupt, EventInterruptHandler<T>>
 + interrupt::typelevel::Binding<T::ErrorInterrupt, ErrorInterruptHandler<T>>

but there is only one general IRQ on F0 :

[doc = "23 - I2C1"]

I2C1 = 23

which needs to be handled with general InterruptHandler, which is missing.

Dirbaio commented 4 months ago

bind the same interrupt to both handlers.

bind_interrupts!(struct Irqs {
    I2C1 => i2c::EventInterruptHandler<peripherals::I2C1>, i2c::ErrorInterruptHandler<peripherals::I2C1>;
});
ilfirin-ms commented 4 months ago

Thank you