Compare commits

..

2 commits

Author SHA1 Message Date
eb87f77d0a fw-rust: Remove wrap around of values in setup
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-04-08 00:19:15 +02:00
2fe25e584f fw-rust: Configure display temperature curve
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Set the temperature compensation curve to -0.11%/°C.
2022-04-08 00:18:06 +02:00
2 changed files with 6 additions and 4 deletions

View file

@ -35,6 +35,8 @@ impl Lcd {
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 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 0xAF, // (12) Set Display Enable: Display on
]; ];

View file

@ -35,7 +35,7 @@ impl Setup {
Selection::BacklightEdit => match input { Selection::BacklightEdit => match input {
Input::Next => { Input::Next => {
self.backlight = if self.backlight == u8::MAX { self.backlight = if self.backlight == u8::MAX {
u8::MIN u8::MAX
} else { } else {
self.backlight + 1 self.backlight + 1
}; };
@ -44,7 +44,7 @@ impl Setup {
} }
Input::Previous => { Input::Previous => {
self.backlight = if self.backlight == u8::MIN { self.backlight = if self.backlight == u8::MIN {
u8::MAX u8::MIN
} else { } else {
self.backlight - 1 self.backlight - 1
}; };
@ -70,7 +70,7 @@ impl Setup {
Selection::ContrastEdit => match input { Selection::ContrastEdit => match input {
Input::Next => { Input::Next => {
self.contrast = if self.contrast >= 63 { self.contrast = if self.contrast >= 63 {
u8::MIN 63
} else { } else {
self.contrast + 1 self.contrast + 1
}; };
@ -79,7 +79,7 @@ impl Setup {
} }
Input::Previous => { Input::Previous => {
self.contrast = if self.contrast == u8::MIN { self.contrast = if self.contrast == u8::MIN {
63 u8::MIN
} else { } else {
self.contrast - 1 self.contrast - 1
}; };