From fe6dcea9143f15bb0094f1a5f58f74fa92583ebf Mon Sep 17 00:00:00 2001 From: Michael Kamprath Date: Sun, 29 Sep 2024 21:01:57 -0700 Subject: [PATCH] pr fixes --- Cargo.toml | 4 ++-- src/main.rs | 2 -- src/robot.rs | 6 ------ 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 534aca8..c10373e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } micromath = { version = "2.1", features = ["vector"] } -mpu6050 = { git = "https://github.com/michaelkamprath/mpu6050.git", branch = "micromath", features = [ +mpu6050 = { git = "https://github.com/michaelkamprath/mpu6050.git", branch = "embedded-hal-upgrade", features = [ "defmt", ] } embedded-alloc = "0.6" @@ -96,6 +96,6 @@ lto = 'fat' opt-level = 3 [patch."https://github.com/michaelkamprath/mpu6050.git"] -mpu6050 = { path = "../mpu6050" } +# mpu6050 = { path = "../mpu6050" } [patch.crates-io] diff --git a/src/main.rs b/src/main.rs index f717a94..ff3584b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,6 @@ mod system; use core::cell::RefCell; use defmt::{error, info, panic}; use defmt_rtt as _; -use embedded_alloc::LlffHeap as Heap; use panic_probe as _; // Provide an alias for our BSP so we can switch targets quickly. @@ -32,7 +31,6 @@ use driver::Driver; use system::millis::init_millis; extern crate alloc; - use embedded_alloc::TlsfHeap as Heap; #[global_allocator] static HEAP: Heap = Heap::empty(); diff --git a/src/robot.rs b/src/robot.rs index 2b1d472..7d10a59 100644 --- a/src/robot.rs +++ b/src/robot.rs @@ -365,12 +365,6 @@ where cortex_m::interrupt::free(|cs| RIGHT_WHEEL_COUNTER.borrow(cs).get()) } - /// Returns a duty value normalized to the max duty of the motor. - /// The duty is clamped to the range [0, 1]. - fn noramlize_duty(&self, duty: f32) -> u16 { - (duty.clamp(0.0, 1.0) * self.motors.enable_pin_a().get_max_duty() as f32) as u16 - } - /// returns true if the button 1 is newly pressed pub fn button1_pressed(&mut self) -> bool { self.button1.is_newly_pressed()