made overflow return 255 instead of 0

This commit is contained in:
Sem van der Hoeven
2020-10-19 14:01:39 +02:00
parent 107d95b81a
commit f934dee2d0

View File

@@ -102,14 +102,14 @@ namespace Hardware.Simulators
catch (OverflowException e)
{
Debug.WriteLine(e);
byte[] res = { 0x10,0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF};
return res;
}
byte[] res = { 0x10,0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0xFF};
return res;
}
private byte check(int value)
{
return value > 255 ? Convert.ToByte(0) : Convert.ToByte(value);
return value > 255 ? Convert.ToByte(255) : Convert.ToByte(value);
}
//Generate an ANT message for BPM