Fix temperature display

This commit is contained in:
Luca 2024-01-23 00:29:01 +01:00
parent e7aa77494b
commit 32a40497bf
2 changed files with 3 additions and 3 deletions

View File

@ -307,12 +307,12 @@ fn main() -> ! {
state = State::Off;
}
let mut text: String<9> = String::new();
let mut text: String<12> = String::new();
let text_str;
match thermocouple_result {
Ok(temperature) => {
if let Err(_) = write!(&mut text, "{}", temperature) {
if let Err(_) = write!(&mut text, "{} °C", temperature) {
text_str = "format error";
} else {
text_str = text.as_str();

View File

@ -65,7 +65,7 @@ where
if d & 0x4 == 0x4 {
Err(Error::OpenThermocouple)
} else {
Ok(FixedU16::from_num(d >> 3))
Ok(FixedU16::from_bits(d >> 3))
}
}
}