diff --git a/firmware/.cargo/config.toml b/firmware/.cargo/config.toml index 67b24524..b18ce923 100644 --- a/firmware/.cargo/config.toml +++ b/firmware/.cargo/config.toml @@ -9,4 +9,5 @@ rustflags = [ rustflags = [ "-C", "link-arg=-Tlink.x", "-C", "link-arg=-Tdefmt.x", + "-C", "opt-level=z", ] diff --git a/firmware/Cargo.toml b/firmware/Cargo.toml index 557ecfe3..f5b0c6e7 100644 --- a/firmware/Cargo.toml +++ b/firmware/Cargo.toml @@ -116,3 +116,5 @@ undocumented_unsafe_blocks = "deny" codegen-units = 1 lto = "fat" opt-level = 3 # "s"/"z" break Xtensa (l32r literal range exceeded) +panic = "abort" +strip = true diff --git a/firmware/src/display/mod.rs b/firmware/src/display/mod.rs index bb78536d..c92bc917 100644 --- a/firmware/src/display/mod.rs +++ b/firmware/src/display/mod.rs @@ -1,6 +1,7 @@ //! OLED display driver with radio status dashboard. mod render; +#[cfg(feature = "wio_tracker_l1")] pub mod sh1106; mod task; pub use task::display_task; diff --git a/firmware/src/display/render.rs b/firmware/src/display/render.rs index 2c3145d2..8914acfd 100644 --- a/firmware/src/display/render.rs +++ b/firmware/src/display/render.rs @@ -34,6 +34,7 @@ pub struct BoardInfo<'a> { } /// Render the active dashboard (shown when radio is in RX or TX mode). +#[allow(clippy::too_many_arguments)] pub fn dashboard( target: &mut impl DrawTarget, status: &RadioStatus, @@ -289,6 +290,7 @@ fn compact_count(n: u32) -> String<10> { /// /// The current (uncommitted) slot is rendered at the rightmost position /// so that incoming packets appear on the graph immediately. +#[allow(clippy::too_many_arguments)] fn rssi_sparkline( target: &mut impl DrawTarget, history: &[i16; RSSI_HISTORY_LEN], diff --git a/firmware/src/display/sh1106.rs b/firmware/src/display/sh1106.rs index 7216e8d8..c5cc2a15 100644 --- a/firmware/src/display/sh1106.rs +++ b/firmware/src/display/sh1106.rs @@ -74,7 +74,7 @@ impl Sh1106 { // Set page address and column start (with SH1106 2-column offset). self.cmd(&[ 0xB0 | page as u8, // page address - 0x00 | (COL_OFFSET & 0x0F), // column low nibble + COL_OFFSET & 0x0F, // column low nibble 0x10 | (COL_OFFSET >> 4), // column high nibble ]) .await?; @@ -91,10 +91,6 @@ impl Sh1106 { self.cmd(&[0x81, value]).await } - /// Clear the framebuffer (call flush() to update the display). - pub fn clear_buffer(&mut self) { - self.buffer.fill(0); - } } impl DrawTarget for Sh1106 { diff --git a/firmware/src/protocol.rs b/firmware/src/protocol.rs index 6f05bef4..3cf01d52 100644 --- a/firmware/src/protocol.rs +++ b/firmware/src/protocol.rs @@ -328,6 +328,8 @@ mod tests { cr: 8, sync_word: 0x1234, tx_power_dbm: -9, + preamble_len: 16, + cad: 1, }; let mut buf = [0u8; RADIO_CONFIG_SIZE]; cfg.write_to(&mut buf);