11#include < BMS.hpp>
22
3- #include < EVT /utils/log.hpp>
4- #include < EVT /utils/time.hpp>
3+ #include < core /utils/log.hpp>
4+ #include < core /utils/time.hpp>
55#include < cstring>
66
7- namespace time = EVT ::core::time;
8- namespace log = EVT ::core::log;
7+ #include < core/dev/IWDG.hpp>
8+
9+ namespace time = core::time;
10+ namespace log = core::log;
911
1012namespace BMS {
1113
12- BMS::BMS (BQSettingsStorage& bqSettingsStorage, DEV ::BQ76952 bq,
13- DEV ::Interlock& interlock, IO ::GPIO & alarm, SystemDetect& systemDetect,
14- IO ::GPIO & bmsOK, IO ::GPIO & errorLed, DEV ::ThermistorMux& thermMux,
15- ResetHandler& resetHandler, EVT :: core::DEV ::IWDG & iwdg) : bqSettingsStorage(bqSettingsStorage),
14+ BMS::BMS (BQSettingsStorage& bqSettingsStorage, dev ::BQ76952 bq,
15+ dev ::Interlock& interlock, IO ::GPIO & alarm, SystemDetect& systemDetect,
16+ IO ::GPIO & bmsOK, IO ::GPIO & errorLed, dev ::ThermistorMux& thermMux,
17+ ResetHandler& resetHandler, core::dev ::IWDG & iwdg) : bqSettingsStorage(bqSettingsStorage),
1618 bq (bq), state(State::START ), interlock(interlock),
1719 alarm(alarm), systemDetect(systemDetect), resetHandler(resetHandler),
1820 bmsOK(bmsOK), errorLed(errorLed), thermistorMux(thermMux),
@@ -146,7 +148,7 @@ void BMS::startState() {
146148 .temp1 = 0 ,
147149 .temp2 = 0 ,
148150 };
149- memset (thermistorTemperature, 0 , DEV ::BQ76952 ::NUM_CELLS * sizeof (uint16_t ));
151+ memset (thermistorTemperature, 0 , dev ::BQ76952 ::NUM_CELLS * sizeof (uint16_t ));
150152 memset (bqStatusArr, 0 , sizeof (uint8_t ) * 3 );
151153 errorRegister = 0 ;
152154 lastCheckedThermNum = -1 ;
@@ -165,8 +167,8 @@ void BMS::startState() {
165167 }
166168
167169 // Check to see if communication is possible with the BQ chip
168- DEV ::BQ76952 ::Status status = bq.communicationStatus ();
169- if (status != DEV ::BQ76952 ::Status::OK ) {
170+ dev ::BQ76952 ::Status status = bq.communicationStatus ();
171+ if (status != dev ::BQ76952 ::Status::OK ) {
170172
171173 // Increment the number of errors that have taken place
172174 numBqAttemptsMade++;
@@ -249,7 +251,7 @@ void BMS::transferSettingsState() {
249251
250252 bool isComplete = false ;
251253 auto result = bqSettingsStorage.transferSetting (isComplete);
252- if (result != DEV ::BQ76952 ::Status::OK ) {
254+ if (result != dev ::BQ76952 ::Status::OK ) {
253255 numBqAttemptsMade++;
254256
255257 // If the number of errors are over the max
@@ -398,25 +400,25 @@ void BMS::updateBQData() {
398400 }
399401 }
400402
401- DEV ::BQ76952 ::Status result = bq.getCellVoltage (cellVoltage, totalVoltage, voltageInfo);
403+ dev ::BQ76952 ::Status result = bq.getCellVoltage (cellVoltage, totalVoltage, voltageInfo);
402404
403- if (result == DEV ::BQ76952 ::Status::OK ) {
405+ if (result == dev ::BQ76952 ::Status::OK ) {
404406 result = bq.getTotalVoltage (batteryVoltage);
405407 }
406408
407- if (result == DEV ::BQ76952 ::Status::OK ) {
409+ if (result == dev ::BQ76952 ::Status::OK ) {
408410 result = bq.getCurrent (current);
409411 }
410412
411- if (result == DEV ::BQ76952 ::Status::OK ) {
413+ if (result == dev ::BQ76952 ::Status::OK ) {
412414 result = bq.getTemps (bqTempInfo);
413415 }
414416
415- if (result == DEV ::BQ76952 ::Status::OK ) {
417+ if (result == dev ::BQ76952 ::Status::OK ) {
416418 result = bq.getBQStatus (bqStatusArr);
417419 }
418420
419- if (result != DEV ::BQ76952 ::Status::OK ) {
421+ if (result != dev ::BQ76952 ::Status::OK ) {
420422 numBqAttemptsMade++;
421423
422424 // If the number of errors are over the max
@@ -482,7 +484,7 @@ void BMS::clearVoltageReadings() {
482484 voltageInfo = {0 , 0 , 0 , 0 };
483485
484486 // Zero out all cell voltages
485- memset (cellVoltage, 0 , DEV ::BQ76952 ::NUM_CELLS * sizeof (uint16_t ));
487+ memset (cellVoltage, 0 , dev ::BQ76952 ::NUM_CELLS * sizeof (uint16_t ));
486488}
487489
488490}// namespace BMS
0 commit comments