Skip to content

Commit b816dba

Browse files
committed
mc33810: do not spam
emit error message every 7 seconds, as it was intended
1 parent fef51e2 commit b816dba

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

firmware/hw_layer/drivers/gpio/mc33810.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,7 @@ int Mc33810::chip_init()
525525
if (rx != SPI_CHECK_ACK) {
526526
engine->outputChannels.mc33810spiErrorCounter++;
527527
static Timer needBatteryMessage;
528-
float vBatt = Sensor::getOrZero(SensorType::BatteryVoltage);
529-
if (vBatt > 6 || needBatteryMessage.getElapsedSeconds() > 7) {
528+
if ((isIgnVoltage()) && (needBatteryMessage.getElapsedSeconds() > 7)) {
530529
needBatteryMessage.reset();
531530
const char *msg;
532531
if (rx == 0xffff) {
@@ -536,8 +535,9 @@ int Mc33810::chip_init()
536535
} else {
537536
msg = "unexpected";
538537
}
539-
efiPrintf(DRIVER_NAME " spi loopback test failed [first 0x%04x][spi check 0x%04x][%s] vBatt=%f count=%d", rxSpiCheck, rx, msg, vBatt,
540-
engine->outputChannels.mc33810spiErrorCounter);
538+
efiPrintf(DRIVER_NAME " spi loopback test failed [first 0x%04x][spi check 0x%04x][%s] vBatt=%f count=%d",
539+
rxSpiCheck, rx, msg, Sensor::getOrZero(SensorType::BatteryVoltage),
540+
engine->outputChannels.mc33810spiErrorCounter);
541541
}
542542
ret = -2;
543543
goto err_exit;

0 commit comments

Comments
 (0)