mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-26 07:49:36 -05:00
Simplify TPMS units static_casts.
This commit is contained in:
parent
798b5eb972
commit
4d5697cda7
@ -70,24 +70,24 @@ Optional<Reading> Packet::reading() const {
|
|||||||
return Reading {
|
return Reading {
|
||||||
Reading::Type::FLM_64,
|
Reading::Type::FLM_64,
|
||||||
reader_.read(0, 32),
|
reader_.read(0, 32),
|
||||||
Pressure { static_cast<int32_t>(reader_.read(32, 8)) * 4 / 3 },
|
Pressure { static_cast<int>(reader_.read(32, 8)) * 4 / 3 },
|
||||||
Temperature { static_cast<int32_t>(reader_.read(40, 8) & 0x7f) - 50 }
|
Temperature { static_cast<int>(reader_.read(40, 8) & 0x7f) - 50 }
|
||||||
};
|
};
|
||||||
|
|
||||||
case 72:
|
case 72:
|
||||||
return Reading {
|
return Reading {
|
||||||
Reading::Type::FLM_72,
|
Reading::Type::FLM_72,
|
||||||
reader_.read(0, 32),
|
reader_.read(0, 32),
|
||||||
Pressure { static_cast<int32_t>(reader_.read(40, 8)) * 4 / 3 },
|
Pressure { static_cast<int>(reader_.read(40, 8)) * 4 / 3 },
|
||||||
Temperature { static_cast<int32_t>(reader_.read(48, 8)) - 50 }
|
Temperature { static_cast<int>(reader_.read(48, 8)) - 50 }
|
||||||
};
|
};
|
||||||
|
|
||||||
case 80:
|
case 80:
|
||||||
return Reading {
|
return Reading {
|
||||||
Reading::Type::FLM_80,
|
Reading::Type::FLM_80,
|
||||||
reader_.read(8, 32),
|
reader_.read(8, 32),
|
||||||
Pressure { static_cast<int32_t>(reader_.read(48, 8)) * 4 / 3 },
|
Pressure { static_cast<int>(reader_.read(48, 8)) * 4 / 3 },
|
||||||
Temperature { static_cast<int32_t>(reader_.read(56, 8)) - 50 }
|
Temperature { static_cast<int>(reader_.read(56, 8)) - 50 }
|
||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user