File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727#include < cmath>
2828#include < iomanip>
2929#include < iostream>
30+ #include < limits>
3031#include < string>
3132#include < vector>
3233
@@ -403,9 +404,19 @@ double SmcTemp::GetCpuTemp() {
403404 temp += smc_accessor_.ReadValue (sensor.c_str ());
404405 }
405406 temp /= sensors.size ();
406- if (temp < 110.0 ) {
407+ if (temp > std::numeric_limits< double >:: epsilon () ) {
407408 return temp;
408409 }
410+ std::vector<std::string> aux_sensors{
411+ static_cast <std::string>(kSensorTc0a ),
412+ static_cast <std::string>(kSensorTc0b ),
413+ static_cast <std::string>(kSensorTc0x ),
414+ static_cast <std::string>(kSensorTc0z ),
415+ };
416+ for (auto sensor : aux_sensors) {
417+ temp += smc_accessor_.ReadValue (sensor.c_str ());
418+ }
419+ temp /= aux_sensors.size ();
409420#endif
410421 return temp;
411422}
Original file line number Diff line number Diff line change @@ -50,6 +50,10 @@ constexpr UInt32Char_t kSensorTc0e = "TC0E"; // CPU PECI die filtered temperatur
5050constexpr UInt32Char_t kSensorTc0f = " TC0F" ; // CPU PECI die temperature filtered then adjusted
5151constexpr UInt32Char_t kSensorTc0p = " TC0P" ; // CPU proximity temperature
5252#elif defined(ARCH_TYPE_ARM64)
53+ constexpr UInt32Char_t kSensorTc0a = " Tc0a" ;
54+ constexpr UInt32Char_t kSensorTc0b = " Tc0b" ;
55+ constexpr UInt32Char_t kSensorTc0x = " Tc0x" ;
56+ constexpr UInt32Char_t kSensorTc0z = " Tc0z" ;
5357constexpr UInt32Char_t kSensorTp01 = " Tp01" ; // CPU performance core 1 temperature
5458constexpr UInt32Char_t kSensorTp05 = " Tp05" ; // CPU performance core 2 temperature
5559constexpr UInt32Char_t kSensorTp0d = " Tp0D" ; // CPU performance core 3 temperature
You can’t perform that action at this time.
0 commit comments