diff --git a/spinnyboy_rust/.cargo/config.toml b/spinnyboy_rust/.cargo/config.toml index 9742ea7..180027b 100644 --- a/spinnyboy_rust/.cargo/config.toml +++ b/spinnyboy_rust/.cargo/config.toml @@ -8,6 +8,8 @@ rustflags = [ # Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.) # NOTE: May negatively impact performance of produced code "-C", "force-frame-pointers", + #https://defmt.ferrous-systems.com/setup + "-C", "link-arg=-Tdefmt.x", ] target = "riscv32imac-unknown-none-elf" diff --git a/spinnyboy_rust/Cargo.toml b/spinnyboy_rust/Cargo.toml index 2fc72b8..653e6f9 100644 --- a/spinnyboy_rust/Cargo.toml +++ b/spinnyboy_rust/Cargo.toml @@ -17,6 +17,8 @@ esp-bootloader-esp-idf = { version = "0.4.0", features = ["esp32c6"] } critical-section = "1.2.0" esp-alloc = "0.9.0" rtt-target = "0.6.2" +embedded-hal = "1.0.0" +esp-backtrace = {version = "0.18.1",features = ["esp32c6","defmt"]} [profile.dev] diff --git a/spinnyboy_rust/src/bin/main.rs b/spinnyboy_rust/src/bin/main.rs index 0aec8dd..9ec1140 100644 --- a/spinnyboy_rust/src/bin/main.rs +++ b/spinnyboy_rust/src/bin/main.rs @@ -23,7 +23,7 @@ use esp_hal::handler; use core::cell::RefCell; use esp_hal::time::{Duration, Instant}; use esp_hal::timer::timg::TimerGroup; - +use esp_backtrace as _; use critical_section::Mutex; use rtt_target::rprintln; mod dc_driver; @@ -38,7 +38,10 @@ fn panic(_: &core::panic::PanicInfo) -> ! { // static EMERGENCY_BUTTON: Mutex>> = Mutex::new(RefCell::new(None)); extern crate alloc; - +//target RPM +const DEFAULT_TARGET_RPM: u32 = 1000; +//in seconds +const DEFAULT_SPIN_TIME:u32 = 10; // This creates a default app-descriptor required by the esp-idf bootloader. // For more information see: esp_bootloader_esp_idf::esp_app_desc!(); @@ -98,12 +101,6 @@ fn main() -> ! { .unwrap() .with_rx(peripherals.GPIO5) .with_tx(peripherals.GPIO7); - // uart0.write(b"page page0"); - // uart0.write(b"\xff"); - // uart0.write(b"\xff"); - // uart0.write(b"\xff"); - // uart0.write(b"\xff"); - // rprintln!("WRITE HAPPENED!"); let mut display = Nextion::new(&mut uart0); display.send_command(b"page page0"); loop {