From f934dee2d0f49148c99fecd0328b6e5069d054b8 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Mon, 19 Oct 2020 14:01:39 +0200 Subject: [PATCH] made overflow return 255 instead of 0 --- ProftaakRH/BikeSimulator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ProftaakRH/BikeSimulator.cs b/ProftaakRH/BikeSimulator.cs index 1f8e7c0..e0d0ccd 100644 --- a/ProftaakRH/BikeSimulator.cs +++ b/ProftaakRH/BikeSimulator.cs @@ -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