Merge pull request #184 from joske/main

#168 - try again with TC0C smc key
This commit is contained in:
aristocratos 2021-12-02 21:26:10 +01:00 committed by GitHub
commit 43c4190895
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -63,6 +63,11 @@ namespace Cpu {
snprintf(key, 5, "TC%1dc", core);
}
result = SMCReadKey(key, &val);
if (result != kIOReturnSuccess) {
// try again with C
snprintf(key, 5, "TC%1dC", core);
result = SMCReadKey(key, &val);
}
if (result == kIOReturnSuccess) {
if (strcmp(val.dataType, DATATYPE_SP78) == 0) {
// convert sp78 value to temperature

View file

@ -25,7 +25,8 @@
#define DATATYPE_SP78 "sp78"
// key values
#define SMC_KEY_CPU_TEMP "TC0P"
#define SMC_KEY_CPU_TEMP "TC0P" // proximity temp?
#define SMC_KEY_CPU_DIE_TEMP "TC0D" // die temp?
#define SMC_KEY_CPU1_TEMP "TC1C"
#define SMC_KEY_CPU2_TEMP "TC2C" // etc
#define SMC_KEY_FAN0_RPM_CUR "F0Ac"