Compare commits
2 commits
3f19ad6ee9
...
027a3b3444
Author | SHA1 | Date | |
---|---|---|---|
027a3b3444 | |||
afc4edab59 |
3 changed files with 17 additions and 9 deletions
|
@ -26,3 +26,10 @@ pipeline:
|
||||||
commands:
|
commands:
|
||||||
- cd firmware/rust/
|
- cd firmware/rust/
|
||||||
- cargo build --all-features
|
- cargo build --all-features
|
||||||
|
|
||||||
|
build_release:
|
||||||
|
group: default
|
||||||
|
image: rust_avr
|
||||||
|
commands:
|
||||||
|
- cd firmware/rust/
|
||||||
|
- cargo build --all-features --release
|
||||||
|
|
|
@ -34,7 +34,7 @@ impl Lcd {
|
||||||
0x27, // (8) Set VLCD Resistor Ratio: Set Contrast
|
0x27, // (8) Set VLCD Resistor Ratio: Set Contrast
|
||||||
0xEE, // (18) Reset Cursor Update Mode
|
0xEE, // (18) Reset Cursor Update Mode
|
||||||
0x81, // (9) Set Electronic Volume: Set Contrast
|
0x81, // (9) Set Electronic Volume: Set Contrast
|
||||||
nb::block!(eeprom::read_byte(&CONTRAST)).unwrap(), // (9) Set Electronic Volume: Set Contrast
|
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
|
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
|
0x90, // (25) Set Adv. Program Control 0: Set Temperature compensation curve to -0.11%/°C
|
||||||
0xAF, // (12) Set Display Enable: Display on
|
0xAF, // (12) Set Display Enable: Display on
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use super::{Event, Home, Screens};
|
use super::{Event, Home, Screens};
|
||||||
use crate::{eeprom, lcd::Lcd, Input, BACKLIGHT, CONTRAST};
|
use crate::{eeprom, lcd::Lcd, Input, BACKLIGHT, CONTRAST};
|
||||||
|
use nb::block;
|
||||||
|
|
||||||
enum Selection {
|
enum Selection {
|
||||||
Backlight,
|
Backlight,
|
||||||
|
@ -19,8 +20,8 @@ impl Setup {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
active: Selection::Backlight,
|
active: Selection::Backlight,
|
||||||
backlight: nb::block!(eeprom::read_byte(&BACKLIGHT)).unwrap(),
|
backlight: block!(eeprom::read_byte(&BACKLIGHT)).unwrap(),
|
||||||
contrast: nb::block!(eeprom::read_byte(&CONTRAST)).unwrap(),
|
contrast: block!(eeprom::read_byte(&CONTRAST)).unwrap(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,12 +53,12 @@ impl Setup {
|
||||||
return Event::Backlight(self.backlight);
|
return Event::Backlight(self.backlight);
|
||||||
}
|
}
|
||||||
Input::Select => {
|
Input::Select => {
|
||||||
nb::block!(eeprom::write_byte(&BACKLIGHT, self.backlight)).unwrap();
|
block!(eeprom::write_byte(&BACKLIGHT, self.backlight)).unwrap();
|
||||||
Selection::Backlight
|
Selection::Backlight
|
||||||
}
|
}
|
||||||
Input::Back => {
|
Input::Back => {
|
||||||
self.active = Selection::Backlight;
|
self.active = Selection::Backlight;
|
||||||
self.backlight = nb::block!(eeprom::read_byte(&BACKLIGHT)).unwrap();
|
self.backlight = block!(eeprom::read_byte(&BACKLIGHT)).unwrap();
|
||||||
return Event::Backlight(self.backlight);
|
return Event::Backlight(self.backlight);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -87,12 +88,12 @@ impl Setup {
|
||||||
return Event::Contrast(self.contrast);
|
return Event::Contrast(self.contrast);
|
||||||
}
|
}
|
||||||
Input::Select => {
|
Input::Select => {
|
||||||
nb::block!(eeprom::write_byte(&CONTRAST, self.contrast)).unwrap();
|
block!(eeprom::write_byte(&CONTRAST, self.contrast)).unwrap();
|
||||||
Selection::Contrast
|
Selection::Contrast
|
||||||
}
|
}
|
||||||
Input::Back => {
|
Input::Back => {
|
||||||
self.active = Selection::Contrast;
|
self.active = Selection::Contrast;
|
||||||
self.contrast = nb::block!(eeprom::read_byte(&CONTRAST)).unwrap();
|
self.contrast = block!(eeprom::read_byte(&CONTRAST)).unwrap();
|
||||||
return Event::Contrast(self.contrast);
|
return Event::Contrast(self.contrast);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue