summaryrefslogtreecommitdiffstats
path: root/src/bin/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/main.rs')
-rw-r--r--src/bin/main.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/bin/main.rs b/src/bin/main.rs
new file mode 100644
index 0000000..52eafa5
--- /dev/null
+++ b/src/bin/main.rs
@@ -0,0 +1,36 @@
+#![no_std]
+#![no_main]
+
+use esp_backtrace as _;
+use esp_hal::clock::CpuClock;
+use esp_hal::delay::Delay;
+use esp_hal::main;
+use esp_hal::timer::timg::TimerGroup;
+use log::info;
+
+extern crate alloc;
+
+#[main]
+fn main() -> ! {
+ let config = esp_hal::Config::default().with_cpu_clock(CpuClock::max());
+ let peripherals = esp_hal::init(config);
+ esp_println::logger::init_logger_from_env();
+
+ esp_alloc::heap_allocator!(72 * 1024);
+
+ let timg0 = TimerGroup::new(peripherals.TIMG0);
+ let _init = esp_wifi::init(
+ timg0.timer0,
+ esp_hal::rng::Rng::new(peripherals.RNG),
+ peripherals.RADIO_CLK,
+ )
+ .unwrap();
+
+ let delay = Delay::new();
+ loop {
+ info!("Hello world!");
+ delay.delay_millis(500);
+ }
+
+ // for inspiration have a look at the examples at https://github.com/esp-rs/esp-hal/tree/v0.23.1/examples/src/bin
+}