diff --git a/Sensors/SMCProcessor/SMCProcessor.cpp b/Sensors/SMCProcessor/SMCProcessor.cpp index b249916..583c025 100644 --- a/Sensors/SMCProcessor/SMCProcessor.cpp +++ b/Sensors/SMCProcessor/SMCProcessor.cpp @@ -423,16 +423,16 @@ bool SMCProcessor::start(IOService *provider) { // Some laptop models start core sensors not with 0, but actually with 1. size_t coreOffset = 0; auto model = BaseDeviceInfo::get().modelIdentifier; + auto isdigit = [](auto l) { return l >= '0' && l <= '9'; }; if (!strncmp(model, "MacBook", strlen("MacBook"))) { auto rmodel = model + strlen("MacBook"); - auto isdigit = [](auto l) { return l >= '0' && l <= '9'; }; if (!strncmp(rmodel, "Air", strlen("Air"))) { // MacBookAir6,1 and above const char *suffix = rmodel + strlen("Air"); if (isdigit(suffix[0]) && (isdigit(suffix[1]) || suffix[0] >= '6')) coreOffset = 1; - } else if (!strncmp(model, "Pro", strlen("Pro"))) { + } else if (!strncmp(rmodel, "Pro", strlen("Pro"))) { const char *suffix = rmodel + strlen("Pro"); if (isdigit(suffix[0]) && isdigit(suffix[1]) && ((suffix[0] == '1' && suffix[1] >= '3') || suffix[0] > '1')) { // MacBookPro13,1 and above @@ -451,6 +451,11 @@ bool SMCProcessor::start(IOService *provider) { // MacBook8,1 and above coreOffset = 1; } + } else if (!strncmp(model, "Macmini", strlen("Macmini"))) { + // Macmini8,1 and above + const char *suffix = model + strlen("Macmini"); + if (isdigit(suffix[0]) && suffix[0] >= '8') + coreOffset = 1; } setupKeys(coreOffset);