Update esp32c6 example dependencies

This commit is contained in:
Eli Hastings 2025-03-13 11:50:05 +00:00 committed by Henrik Tjäder
parent 90f475316f
commit c6fbbaaae8
3 changed files with 59 additions and 33 deletions

View file

@ -4,7 +4,7 @@
#[rtic::app(device = esp32c6, dispatchers=[FROM_CPU_INTR0, FROM_CPU_INTR1])]
mod app {
use esp_backtrace as _;
use esp_hal::gpio::{Event, Input, Pull};
use esp_hal::gpio::{Event, Input, InputConfig, Pull};
use esp_println::println;
#[shared]
@ -20,7 +20,8 @@ mod app {
fn init(_: init::Context) -> (Shared, Local) {
println!("init");
let peripherals = esp_hal::init(esp_hal::Config::default());
let mut button = Input::new(peripherals.GPIO9, Pull::Up);
let config = InputConfig::default().with_pull(Pull::Up);
let mut button = Input::new(peripherals.GPIO9, config);
button.listen(Event::FallingEdge);
foo::spawn().unwrap();
(Shared {}, Local { button })