Skip to content

Commit

Permalink
pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkamprath committed Sep 30, 2024
1 parent 04b9634 commit fe6dcea
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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]
2 changes: 0 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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();
Expand Down
6 changes: 0 additions & 6 deletions src/robot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fe6dcea

Please sign in to comment.