diff --git a/.woodpecker.yml b/.woodpecker.yml index 381e99c..943053b 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -26,10 +26,3 @@ pipeline: commands: - cd firmware/rust/ - cargo build --all-features - - build_release: - group: default - image: rust_avr - commands: - - cd firmware/rust/ - - cargo build --all-features --release diff --git a/firmware/rust/src/lcd.rs b/firmware/rust/src/lcd.rs index d6d86d0..9c77a19 100644 --- a/firmware/rust/src/lcd.rs +++ b/firmware/rust/src/lcd.rs @@ -25,8 +25,8 @@ impl Lcd { self.rst.set_high(); let init_sequence = [ - 0x40, // (6) Set Scroll Line: Display start line 0 - 0xA1, // (13) Set SEG direction: SEG reverse + 0x40, // (6) Set Scroll Line: Display start line 0 + 0xA1, // (13) Set SEG direction: SEG reverse 0xC0, // (14) Set COM direction: Normal COM0 - COM63 0xA6, // (11) Set Inverse Display: Display inverse off 0xA2, // (17) Set LCD Bias Ratio: Set Bias 1/9 (Duty 1/65) @@ -34,7 +34,7 @@ impl Lcd { 0x27, // (8) Set VLCD Resistor Ratio: Set Contrast 0xEE, // (18) Reset Cursor Update Mode 0x81, // (9) Set Electronic Volume: Set Contrast - block!(eeprom::read_byte(&CONTRAST)).unwrap(), // (9) Set Electronic Volume: Set Contrast + nb::block!(eeprom::read_byte(&CONTRAST)).unwrap(), // (9) Set Electronic Volume: Set Contrast 0xFA, // (25) Set Adv. Program Control 0: Set Temperature compensation curve to -0.11%/°C 0x90, // (25) Set Adv. Program Control 0: Set Temperature compensation curve to -0.11%/°C 0xAF, // (12) Set Display Enable: Display on diff --git a/firmware/rust/src/screen/setup.rs b/firmware/rust/src/screen/setup.rs index 37946e0..91cb2e2 100644 --- a/firmware/rust/src/screen/setup.rs +++ b/firmware/rust/src/screen/setup.rs @@ -1,6 +1,5 @@ use super::{Event, Home, Screens}; use crate::{eeprom, lcd::Lcd, Input, BACKLIGHT, CONTRAST}; -use nb::block; enum Selection { Backlight, @@ -20,8 +19,8 @@ impl Setup { pub fn new() -> Self { Self { active: Selection::Backlight, - backlight: block!(eeprom::read_byte(&BACKLIGHT)).unwrap(), - contrast: block!(eeprom::read_byte(&CONTRAST)).unwrap(), + backlight: nb::block!(eeprom::read_byte(&BACKLIGHT)).unwrap(), + contrast: nb::block!(eeprom::read_byte(&CONTRAST)).unwrap(), } } @@ -53,12 +52,12 @@ impl Setup { return Event::Backlight(self.backlight); } Input::Select => { - block!(eeprom::write_byte(&BACKLIGHT, self.backlight)).unwrap(); + nb::block!(eeprom::write_byte(&BACKLIGHT, self.backlight)).unwrap(); Selection::Backlight } Input::Back => { self.active = Selection::Backlight; - self.backlight = block!(eeprom::read_byte(&BACKLIGHT)).unwrap(); + self.backlight = nb::block!(eeprom::read_byte(&BACKLIGHT)).unwrap(); return Event::Backlight(self.backlight); } }, @@ -88,12 +87,12 @@ impl Setup { return Event::Contrast(self.contrast); } Input::Select => { - block!(eeprom::write_byte(&CONTRAST, self.contrast)).unwrap(); + nb::block!(eeprom::write_byte(&CONTRAST, self.contrast)).unwrap(); Selection::Contrast } Input::Back => { self.active = Selection::Contrast; - self.contrast = block!(eeprom::read_byte(&CONTRAST)).unwrap(); + self.contrast = nb::block!(eeprom::read_byte(&CONTRAST)).unwrap(); return Event::Contrast(self.contrast); } },