Skip to content

Commit

Permalink
fixed inline options and other tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkamprath committed Sep 25, 2024
1 parent 25930e6 commit 1e9c818
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ rustflags = [
# uncomment the next line if you wish to enable it
# "-Z", "trap-unreachable=no",
"-C",
"inline-threshold=5",
"-C",
"no-vectorize-loops",
]

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ micromath = { version = "2.1", features = ["vector"] }
mpu6050 = { git = "https://github.com/michaelkamprath/mpu6050.git", branch = "micromath", features = [
"defmt",
] }
embedded-alloc = "0.5"
embedded-alloc = "0.6"
adafruit-lcd-backpack = { version = "0.1", features = ["defmt"] }
ini_core = "0.2"

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use rp_pico as bsp;

extern crate alloc;

use embedded_alloc::Heap;
use embedded_alloc::TlsfHeap as Heap;

#[global_allocator]
static HEAP: Heap = Heap::empty();
Expand Down
2 changes: 1 addition & 1 deletion src/robot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ where
/// 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.max(0.0).min(1.0) * self.motors.enable_pin_a().get_max_duty() as f32) as 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
Expand Down
4 changes: 2 additions & 2 deletions src/system/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ where
///
/// * `f` - The `defmt::Formatter` object that the graph should be printed to.
/// * `value` - A function that gets called on each row in the data table to determine the value from that row to plot.
/// This function must take a reference to the row type and return an `i32`. The mapping of the desired
/// row value to the `i32` is for display purposes.
/// This function must take a reference to the row type and return an `i32`. The mapping of the desired
/// row value to the `i32` is for display purposes.
pub fn plot(&self, f: &mut defmt::Formatter<'_>, value: fn(&T) -> i32) {
// first we need to scan through the data to find the range of
// values that we need to plot
Expand Down

0 comments on commit 1e9c818

Please sign in to comment.