From 99b997f74db8acc0cba633fdce560445b7d648b5 Mon Sep 17 00:00:00 2001 From: Christian Kelly Date: Wed, 22 Jan 2025 19:46:19 +0000 Subject: [PATCH] Fix SimpBMS MaxChargingCurrent scaling --- include/simpbms.h | 2 +- src/simpbms.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/simpbms.h b/include/simpbms.h index 88ad071a..b4e48059 100644 --- a/include/simpbms.h +++ b/include/simpbms.h @@ -34,7 +34,7 @@ class SimpBMS: public BMS private: bool BMSDataValid(); bool ChargeAllowed(); - int chargeCurrentLimit = 0; + int chargeCurrentLimit = 0; // Sent by Simp as 0.1A per digit and stored the same way. int timeoutCounter = 0; float minCellV = 0; float maxCellV = 0; diff --git a/src/simpbms.cpp b/src/simpbms.cpp index 740a5f1d..8590e405 100644 --- a/src/simpbms.cpp +++ b/src/simpbms.cpp @@ -64,7 +64,7 @@ bool SimpBMS::ChargeAllowed() float SimpBMS::MaxChargeCurrent() { if(!ChargeAllowed()) return 0; - return chargeCurrentLimit / 1000.0; + return chargeCurrentLimit * 0.1; } // Process voltage and temperature message from SimpBMS.