#![no_std]
#![no_main]
extern crate alloc;
use esp32s3_hal::{clock::ClockControl, pac::Peripherals, prelude::*, timer::TimerGroup, Rtc};
use esp_backtrace as _;
#[global_allocator]
static ALLOCATOR: esp_alloc::EspHeap = esp_alloc::EspHeap::empty();
fn init_heap() {
const HEAP_SIZE: usize = 32 * 1024;
extern "C" {
static mut _heap_start: u32;
static mut _heap_end: u32;
}
unsafe {
let heap_start = &_heap_start as *const _ as usize;
let heap_end = &_heap_end as *const _ as usize;
assert!(
heap_end - heap_start > HEAP_SIZE,
"Not enough available heap memory."
);
ALLOCATOR.init(heap_start as *mut u8, HEAP_SIZE);
}
}
#[xtensa_lx_rt::entry]
fn main() -> ! {
let peripherals = Peripherals::take().unwrap();
let system = peripherals.SYSTEM.split();
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
// Disable the RTC and TIMG watchdog timers
let mut rtc = Rtc::new(peripherals.RTC_CNTL);
let timer_group0 = TimerGroup::new(peripherals.TIMG0, &clocks);
let mut wdt0 = timer_group0.wdt;
let timer_group1 = TimerGroup::new(peripherals.TIMG1, &clocks);
let mut wdt1 = timer_group1.wdt;
rtc.rwdt.disable();
wdt0.disable();
wdt1.disable();
esp_println::println!("Hello World!");
loop {}
}
Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1