mirror of
https://github.com/esp-rs/esp-idf-hal.git
synced 2025-09-27 12:21:02 +00:00

* Add basic LEDC driver This driver allows to configure timers and channels but does not provide advanced features like fading * Added missing impl_channels. * Use non-raw types for LEDC hw "handle" markers This makes Timer and Channel Sync again. * Add missing config and deps for dev building examples * Add simple example for LEDC driver * Channel changed to hold Timer as Borrow<>, to allow Arc etc. * Provide unstable options from config.toml This allows to build and run examples of this crate with cargo-espflash 1.2.0 which does not support passing unstable options. * Provide ESP_IDF_SDKCONFIG_DEFAULTS from config.toml This requires only to specify the target for a build explicitly. * Use main task stack size from rust-esp32-std-demo * Add multi-threaded example for LEDC * Clean up ledc example and formatting * Add note on running examples from this repository * Fix build for ULP HAL This LEDC interface is not available there. * Build examples in CI too * Use core types for no_std build of ledc * Init channel config and hpoint with Default This makes the initialization compatible with ESP IDF 4.3 and 4.4 where the new field 'flag' has been added. As the default for hpoint was previously zero, omitting it allows to use ..Default::default() in the struct initialization in both cases. * Install ldproxy in CI for building examples It gets installed just before building examples because this takes its time and should not delay other builds. Co-authored-by: yunta <maciej.blomberg@mikoton.com>
27 lines
793 B
Rust
27 lines
793 B
Rust
#[cfg(not(feature = "riscv-ulp-hal"))]
|
|
fn main() -> anyhow::Result<()> {
|
|
embuild::build::CfgArgs::output_propagated("ESP_IDF")?;
|
|
embuild::build::LinkArgs::output_propagated("ESP_IDF")
|
|
}
|
|
|
|
#[cfg(feature = "riscv-ulp-hal")]
|
|
fn main() {
|
|
println!("cargo:rustc-cfg=esp32s2");
|
|
|
|
let riscv_ulp_dir = std::env::current_dir().unwrap().join("riscv-ulp");
|
|
println!("cargo:rustc-link-search={}", riscv_ulp_dir.display());
|
|
|
|
println!(
|
|
"cargo:rerun-if-changed={}",
|
|
riscv_ulp_dir.join("libriscv_ulp_start.a").display()
|
|
);
|
|
println!(
|
|
"cargo:rerun-if-changed={}",
|
|
riscv_ulp_dir.join("riscv_ulp_link_base.x").display()
|
|
);
|
|
println!(
|
|
"cargo:rerun-if-changed={}",
|
|
riscv_ulp_dir.join("riscv_ulp_link_default.x").display()
|
|
);
|
|
}
|