From 1ba6ee3921bfb21af28269db90a6ddb4526122cd Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 8 Nov 2024 13:36:45 -0500 Subject: [PATCH] tle9201 diagOkCounter only:ueefi --- firmware/hw_layer/drivers/gpio/tle9201.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/firmware/hw_layer/drivers/gpio/tle9201.cpp b/firmware/hw_layer/drivers/gpio/tle9201.cpp index d7c6653e54..a1912d7df8 100644 --- a/firmware/hw_layer/drivers/gpio/tle9201.cpp +++ b/firmware/hw_layer/drivers/gpio/tle9201.cpp @@ -56,6 +56,9 @@ typedef enum { /* Driver local variables and types. */ /*==========================================================================*/ +static size_t diagOkCounter = 0; +constexpr size_t DIAG_OK = 0xF; + // Output states static const char *diagDiaOut[16] = { "?", "?", "?", "VS Undervoltage", // 0x3 @@ -186,8 +189,12 @@ void Tle9201::process_diag_and_rev(uint8_t diag, uint8_t rev) { if (!(diag & TLE9201_DIAG_EN)) { efiPrintf("* Outputs disabled."); } + size_t statusCode = diag & TLE9201_DIAG_OUT_MASK; + if (statusCode == DIAG_OK) { + diagOkCounter++; + } // print the status of the outputs - efiPrintf("* %s", diagDiaOut[diag & TLE9201_DIAG_OUT_MASK]); + efiPrintf("* %s OK=%d", diagDiaOut[statusCode], diagOkCounter); savedDiag = diag; }