LPC/EC: fix signess of the sensor readings (#1382)

Only the temperture single-byte ones seem to be signed, the rest of
them seem to be unsigned.
This commit is contained in:
Eugene Shalygin
2024-07-19 21:44:04 +02:00
committed by GitHub
parent aeda29d598
commit 6dc82e271a
@@ -419,7 +419,7 @@ public abstract class EmbeddedController : Hardware
{
int val = _sources[si].Size switch
{
1 => unchecked((sbyte)_data[readRegister]),
1 => _sources[si].Type switch { SensorType.Temperature => unchecked((sbyte)_data[readRegister]), _ => _data[readRegister] },
2 => unchecked((short)((_data[readRegister] << 8) + _data[readRegister + 1])),
_ => 0
};