From 492484ac7c1b08b1568f84aff4eee0264def9937 Mon Sep 17 00:00:00 2001 From: Paul Dino Jones Date: Mon, 5 Aug 2024 14:49:32 -0400 Subject: [PATCH] rpm margin must return as an integer --- src/monocoque/devices/usb/wheels/cammusc5.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/monocoque/devices/usb/wheels/cammusc5.c b/src/monocoque/devices/usb/wheels/cammusc5.c index 5d1ece2..1f96ab2 100644 --- a/src/monocoque/devices/usb/wheels/cammusc5.c +++ b/src/monocoque/devices/usb/wheels/cammusc5.c @@ -1,4 +1,5 @@ #include +#include #include @@ -22,7 +23,7 @@ int cammusc5_update(WheelDevice* wheeldevice, int maxrpm, int rpm, int gear, int // byte 2 is number of lit leds, assuming 9 available leds, // if we send 10, all leds will blink singling a gear change // attempting to build in a margin before the maxrpm is achieved - int rpmmargin = .05*maxrpm; + int rpmmargin = ceil(.05*maxrpm); int rpminterval = (maxrpm-rpmmargin) / (num_avail_leds+1); int litleds = 0;