From 5e28cf56e8c809364af456b317273bd8ce87fb5c Mon Sep 17 00:00:00 2001 From: Denis Ahrens Date: Mon, 20 Dec 2021 12:00:39 +0100 Subject: [PATCH] smc.c: Apple Silicon Macs use FLT for Temperature supports the display of float temperatures. removes one superfluous FLT key detection. actually print FLT with more precision. --- smc-command/smc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/smc-command/smc.c b/smc-command/smc.c index 0e03339..6bd6a93 100755 --- a/smc-command/smc.c +++ b/smc-command/smc.c @@ -87,7 +87,7 @@ void printFLT(SMCVal_t val) { float fval; memcpy(&fval,val.bytes,sizeof(float)); - printf("%.0f ", fval); + printf("%f ", fval); } void printFP1F(SMCVal_t val) @@ -271,8 +271,6 @@ void printVal(SMCVal_t val) printSI16(val); else if (strcmp(val.dataType, DATATYPE_PWM) == 0 && val.dataSize == 2) printPWM(val); - else if (strcmp(val.dataType, DATATYPE_FLT) == 0 && val.dataSize == 4) - printFLT(val); printBytesHex(val); } @@ -632,6 +630,12 @@ kern_return_t SMCPrintTemps(void) printSP78(val); printf("\n"); } + else if (strcmp(val.dataType, DATATYPE_FLT) == 0 && val.dataSize == 4) + { + printf("%-4s ", val.key); + printFLT(val); + printf("\n"); + } } return kIOReturnSuccess;