Init xiao project
This commit is contained in:
parent
574d4d08bc
commit
4ae4b466fa
11 changed files with 2125 additions and 0 deletions
26
xiao-esp32c6/tests/hello_test.rs
Normal file
26
xiao-esp32c6/tests/hello_test.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
//! Demo test suite using embedded-test
|
||||
//!
|
||||
//! You can run this using `cargo test` as usual.
|
||||
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
#[cfg(test)]
|
||||
#[embedded_test::tests(executor = esp_hal_embassy::Executor::new())]
|
||||
mod tests {
|
||||
use esp_hal::timer::systimer::SystemTimer;
|
||||
|
||||
#[init]
|
||||
fn init() {
|
||||
let peripherals = esp_hal::init(esp_hal::Config::default());
|
||||
|
||||
let timer0 = SystemTimer::new(peripherals.SYSTIMER);
|
||||
esp_hal_embassy::init(timer0.alarm0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
async fn hello_test() {
|
||||
embassy_time::Timer::after(embassy_time::Duration::from_millis(100)).await;
|
||||
assert_eq!(1 + 1, 2);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue