whole lotta shit clion made me do

This commit is contained in:
2026-01-02 01:44:20 +01:00
parent d6a7179ba5
commit a54b89bce8
10 changed files with 87 additions and 79 deletions

View File

@@ -34,8 +34,7 @@ void update(cpuSensors* c) {
// read power from intel-rapl? works on amd too, btop uses this trick, seems accurate
// it tracks with "socket power" in hwinfo on windows, its actually the same thing i had in lcdsmartie
curr.ts = std::chrono::steady_clock::now();
// utils::fastReadNum("/sys/class/powercap/intel-rapl:0/energy_uj", curr.energy);
curr.energy = utils::fastReadNum("/sys/class/powercap/intel-rapl:0/energy_uj", buf);
utils::fastReadNum("/sys/class/powercap/intel-rapl:0/energy_uj", buf, curr.energy);
c->ptotal = static_cast<float>(curr.energy - prev.energy) / static_cast<float>(std::chrono::duration_cast<std::chrono::microseconds>(curr.ts - prev.ts).count());
prev = curr;
@@ -51,14 +50,14 @@ void update(cpuSensors* c) {
// commented out unused values so its faster
if (c->zenpower) {
c->tdie = utils::fastReadNum(c->hwmon + "/temp1_input", buf) / 1000;
c->tctl = utils::fastReadNum(c->hwmon + "/temp2_input", buf) / 1000;
c->tccd1 = utils::fastReadNum(c->hwmon + "/temp3_input", buf) / 1000;
c->vcore = utils::fastReadNum(c->hwmon + "/in1_input", buf) / 1000.0;
c->vsoc = utils::fastReadNum(c->hwmon + "/in2_input", buf) / 1000.0;
utils::fastReadNumDiv<1000>(c->hwmon + "/temp1_input", buf, c->tdie);
utils::fastReadNumDiv<1000>(c->hwmon + "/temp2_input", buf, c->tctl);
utils::fastReadNumDiv<1000>(c->hwmon + "/temp3_input", buf, c->tccd1);
utils::fastReadNumDiv<1000>(c->hwmon + "/in1_input", buf, c->vcore);
utils::fastReadNumDiv<1000>(c->hwmon + "/in2_input", buf, c->vsoc);
} else {
c->tctl = utils::fastReadNum(c->hwmon + "/temp1_input", buf) / 1000;
c->tccd1 = utils::fastReadNum(c->hwmon + "/temp3_input", buf) / 1000;
utils::fastReadNumDiv<1000>(c->hwmon + "/temp1_input", buf, c->tctl);
utils::fastReadNumDiv<1000>(c->hwmon + "/temp3_input", buf, c->tccd1);
}
}