bro was this bug here all along and i never noticed
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <cpu.hpp>
|
||||
#include <print>
|
||||
|
||||
namespace cpu {
|
||||
|
||||
@@ -43,6 +44,7 @@ void update(cpuSensors* c) {
|
||||
|
||||
// lots of reads but still faster than reading /proc/cpuinfo
|
||||
char buf[5];
|
||||
c->avg_freq = 0;
|
||||
for (uint8_t i = 0; i < N_CPU; i++) {
|
||||
readFile2("/sys/devices/system/cpu/cpu" + std::to_string(i) + "/cpufreq/cpuinfo_avg_freq", buf, sizeof(buf));
|
||||
c->avg_freq += strtol(buf, NULL, 10);
|
||||
|
||||
Reference in New Issue
Block a user