mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-10 10:45:17 -04:00
Simplify TPMS units static_casts.
This commit is contained in:
parent
798b5eb972
commit
4d5697cda7
1 changed files with 6 additions and 6 deletions
|
@ -70,24 +70,24 @@ Optional<Reading> Packet::reading() const {
|
|||
return Reading {
|
||||
Reading::Type::FLM_64,
|
||||
reader_.read(0, 32),
|
||||
Pressure { static_cast<int32_t>(reader_.read(32, 8)) * 4 / 3 },
|
||||
Temperature { static_cast<int32_t>(reader_.read(40, 8) & 0x7f) - 50 }
|
||||
Pressure { static_cast<int>(reader_.read(32, 8)) * 4 / 3 },
|
||||
Temperature { static_cast<int>(reader_.read(40, 8) & 0x7f) - 50 }
|
||||
};
|
||||
|
||||
case 72:
|
||||
return Reading {
|
||||
Reading::Type::FLM_72,
|
||||
reader_.read(0, 32),
|
||||
Pressure { static_cast<int32_t>(reader_.read(40, 8)) * 4 / 3 },
|
||||
Temperature { static_cast<int32_t>(reader_.read(48, 8)) - 50 }
|
||||
Pressure { static_cast<int>(reader_.read(40, 8)) * 4 / 3 },
|
||||
Temperature { static_cast<int>(reader_.read(48, 8)) - 50 }
|
||||
};
|
||||
|
||||
case 80:
|
||||
return Reading {
|
||||
Reading::Type::FLM_80,
|
||||
reader_.read(8, 32),
|
||||
Pressure { static_cast<int32_t>(reader_.read(48, 8)) * 4 / 3 },
|
||||
Temperature { static_cast<int32_t>(reader_.read(56, 8)) - 50 }
|
||||
Pressure { static_cast<int>(reader_.read(48, 8)) * 4 / 3 },
|
||||
Temperature { static_cast<int>(reader_.read(56, 8)) - 50 }
|
||||
};
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue