From 9b7abb5ece9c1a228a4cf475a6c41ac537d594e8 Mon Sep 17 00:00:00 2001 From: ReFil <31960031+ReFil@users.noreply.github.com> Date: Mon, 5 Feb 2024 08:51:36 +0000 Subject: [PATCH] Update main.c --- board/kombi/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/board/kombi/main.c b/board/kombi/main.c index 1fda6950a8..4f25803fa5 100644 --- a/board/kombi/main.c +++ b/board/kombi/main.c @@ -199,8 +199,8 @@ void CAN3_TX_IRQ_Handler(void) { bool sent; -uint16_t rpm; -uint16_t intermediary_rpm; +uint32_t rpm; +float intermediary_rpm; uint8_t scaled_rpm; @@ -235,7 +235,7 @@ void CAN1_RX0_IRQ_Handler(void) { for (int i=0; i<8; i++) { dat[i] = GET_BYTE(&CAN1->sFIFOMailBox[0], i); } - rpm = dat[1] | (uint16_t)(dat[2] << 8); //Read RPM signal + rpm = (dat[1] << 8) | dat[2]; //Read RPM signal intermediary_rpm = (rpm/364) * 255; //Scale RPM signal for our purposes scaled_rpm = intermediary_rpm/25; //Apply DBC scale factor for cluster #ifdef DEBUG_CAN