XIAO
This commit is contained in:
parent
dc4de4c184
commit
dfb4b1e765
10 changed files with 2029 additions and 5 deletions
16
xiao-esp32c6/src/bin/xiao-esp32c6.rs
Normal file
16
xiao-esp32c6/src/bin/xiao-esp32c6.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#![no_main]
|
||||
|
||||
use embassy_executor::Executor;
|
||||
use static_cell::StaticCell;
|
||||
use xiao_esp32c6::entrypoint;
|
||||
|
||||
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
fn main() {
|
||||
EXECUTOR.init(Executor::new()).run(|spawner| {
|
||||
spawner
|
||||
.spawn(entrypoint(spawner))
|
||||
.expect("Embassy should be able to spawn entrypoint task");
|
||||
});
|
||||
}
|
||||
11
xiao-esp32c6/src/lib.rs
Normal file
11
xiao-esp32c6/src/lib.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
use embassy_executor::Spawner;
|
||||
|
||||
#[embassy_executor::task]
|
||||
pub async fn entrypoint(_spawner: Spawner) {
|
||||
// It is necessary to call this function once. Otherwise some patches to the runtime
|
||||
// implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71
|
||||
esp_idf_svc::sys::link_patches();
|
||||
|
||||
// Bind the log crate to the ESP Logging facilities
|
||||
esp_idf_svc::log::EspLogger::initialize_default();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue