30 lines
859 B
Rust
30 lines
859 B
Rust
#![no_std]
|
|
#![no_main]
|
|
|
|
use embassy_time::Duration;
|
|
use embassy_time::Timer;
|
|
use esp_alloc as _;
|
|
use esp_backtrace as _;
|
|
use esp_hal::gpio::Level;
|
|
use esp_hal::gpio::Output;
|
|
use esp_hal::gpio::OutputConfig;
|
|
use esp_hal::timer::timg::TimerGroup;
|
|
|
|
esp_bootloader_esp_idf::esp_app_desc!();
|
|
|
|
#[esp_rtos::main]
|
|
async fn main(_spawner: embassy_executor::Spawner) -> ! {
|
|
esp_println::logger::init_logger_from_env();
|
|
let peripherals = esp_hal::init(esp_hal::Config::default());
|
|
|
|
let timers = TimerGroup::new(peripherals.TIMG0);
|
|
esp_rtos::start(timers.timer0, peripherals.FROM_CPU_INTR0);
|
|
esp_alloc::heap_allocator!(size: 8 * 1024);
|
|
|
|
let _pin = Output::new(peripherals.GPIO2, Level::High, OutputConfig::default());
|
|
log::info!("GPIO diagnostic: holding GPIO2/D2 high");
|
|
|
|
loop {
|
|
Timer::after(Duration::from_secs(1)).await;
|
|
}
|
|
} |