esp-rs / esp-idf-hal

embedded-hal implementation for Rust on ESP32 and ESP-IDF
https://docs.esp-rs.org/esp-idf-hal/
Apache License 2.0
436 stars 168 forks source link

Compilation failed when `ESP_IDF_VERSION = "release/v5.1" ` #258

Closed danclive closed 1 year ago

danclive commented 1 year ago

Compilation failed when ESP_IDF_VERSION = "release/v5.1", the error message is as follows:

error[E0560]: struct `esp_idf_sys::ledc_timer_config_t` has no field named `deconfigure`
   --> /home/danc/.cargo/registry/src/index.crates.io-6f17d22bba15001f/esp-idf-hal-0.41.1/src/ledc.rs:133:13
    |
133 |             deconfigure: false,
    |             ^^^^^^^^^^^ `esp_idf_sys::ledc_timer_config_t` does not have this field
    |
    = note: available fields are: `speed_mode`, `duty_resolution`, `timer_num`, `freq_hz`, `clk_cfg`

For more information about this error, try `rustc --explain E0560`.
error: could not compile `esp-idf-hal` (lib) due to previous error

After inspection, it seems to have something to do with this:

https://github.com/esp-rs/esp-idf-hal/blob/c68856c4e4886abf1d328d2b46cb3663c0059565/src/ledc.rs#L129-L133

Can it be changed here to something like this? Although I can compile and pass after manual modification.

#[cfg(not(any(esp_idf_version_major = "4", esp_idf_version_major = "5")))]
deconfigure: false,
Vollbrecht commented 1 year ago

will be addressed in https://github.com/esp-rs/esp-idf-hal/pull/255

ivmarkov commented 1 year ago

Fixed with https://github.com/esp-rs/esp-idf-hal/commit/2ab4c709f170643daf5e419ac91d6845f8567a68 Will release a new patch version shortly.