From 6742b019167aa8d28e8f63e158162c78f7fcc3a5 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Mon, 6 Oct 2025 14:19:50 -1000 Subject: [PATCH 1/3] Clean up EEPROM demo code --- ui-app/src/lib.rs | 16 +--------------- ui-stm32/src/main.rs | 2 -- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/ui-app/src/lib.rs b/ui-app/src/lib.rs index e6b7677..d4b47c9 100644 --- a/ui-app/src/lib.rs +++ b/ui-app/src/lib.rs @@ -1,6 +1,6 @@ #![no_std] -use bitmap_font::{BitmapFont, TextStyle, tamzen::FONT_10x20}; +use bitmap_font::{tamzen::FONT_10x20, BitmapFont, TextStyle}; use core::fmt::Write; use defmt::Format; use embedded_graphics::{ @@ -228,20 +228,6 @@ impl App { // Extinguish the status LED out.status_led().set_color(Color::Black); - // Read the EEPROM, XOR with 0xFF, write it, then read it back - let mut eeprom_data = [0u8; 256]; - out.eeprom().read(&mut eeprom_data); - let hex: heapless::String<1024> = eeprom_data.encode_hex(); - defmt::info!("eeprom before {}", hex); - - eeprom_data.iter_mut().for_each(|x| *x ^= 0xff); - out.eeprom().write(&eeprom_data); - - eeprom_data.fill(0); - out.eeprom().read(&mut eeprom_data); - let hex: heapless::String<1024> = eeprom_data.encode_hex(); - defmt::info!("eeprom after {}", hex); - // Draw a test pattern to the screen let rect = out.screen().bounding_box(); diff --git a/ui-stm32/src/main.rs b/ui-stm32/src/main.rs index 314a7c1..d1d485e 100644 --- a/ui-stm32/src/main.rs +++ b/ui-stm32/src/main.rs @@ -99,11 +99,9 @@ async fn main(spawner: Spawner) { debug!("app start"); app.start(&mut board); - /* // Main event loop loop { let event = EVENT_QUEUE.receive().await; app.handle(event, &mut board); } - */ } From a55a5865adbb14cc4199eb67f1d0dbb582ad6a6c Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Mon, 6 Oct 2025 14:20:54 -1000 Subject: [PATCH 2/3] Remove unused import --- ui-app/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/ui-app/src/lib.rs b/ui-app/src/lib.rs index d4b47c9..5d43997 100644 --- a/ui-app/src/lib.rs +++ b/ui-app/src/lib.rs @@ -12,7 +12,6 @@ use embedded_graphics::{ text::Text, }; use heapless::String; -use hex::ToHex; #[derive(Copy, Clone, Debug, PartialEq, Format)] pub enum Key { From 816ed3b5ee96eaae156a2a80f718b2e7153657ba Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Mon, 6 Oct 2025 15:04:40 -1000 Subject: [PATCH 3/3] cargo fmt --- ui-app/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-app/src/lib.rs b/ui-app/src/lib.rs index 5d43997..3e59216 100644 --- a/ui-app/src/lib.rs +++ b/ui-app/src/lib.rs @@ -1,6 +1,6 @@ #![no_std] -use bitmap_font::{tamzen::FONT_10x20, BitmapFont, TextStyle}; +use bitmap_font::{BitmapFont, TextStyle, tamzen::FONT_10x20}; use core::fmt::Write; use defmt::Format; use embedded_graphics::{