diff options
author | PA4WDH | 2024-10-09 12:09:06 +0200 |
---|---|---|
committer | PA4WDH | 2024-10-09 12:09:06 +0200 |
commit | e1392631022c1703d9c90768aff38d120d53ed5b (patch) | |
tree | b789fcd8dc035244fd47596054f81cec09bdb4d4 /cputemp2maxfreq.c | |
parent | Small fixes in shell scripts (diff) | |
download | cputemp2maxfreq-e1392631022c1703d9c90768aff38d120d53ed5b.tar.gz cputemp2maxfreq-e1392631022c1703d9c90768aff38d120d53ed5b.tar.bz2 cputemp2maxfreq-e1392631022c1703d9c90768aff38d120d53ed5b.zip |
Read scaling_max_freq every poll interval
Diffstat (limited to 'cputemp2maxfreq.c')
-rw-r--r-- | cputemp2maxfreq.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/cputemp2maxfreq.c b/cputemp2maxfreq.c index 7098ccc..81fcdef 100644 --- a/cputemp2maxfreq.c +++ b/cputemp2maxfreq.c @@ -290,6 +290,13 @@ int main(int argc,char **argv) failsafe(1); } + cpudata.scale_max=cpufreq_get_long_int("scaling_max_freq"); + if ((cpudata.scale_max<VALID_FREQ_MIN) || (cpudata.scale_max>VALID_FREQ_MAX)) + { + config.logger("Invalid scale_max_freq reported, exiting"); + failsafe(1); + } + DEBUG1_MAIN("Data: %ld %ld %ld %ld %ld\n",cpudata.cur_temp,config.max_temp,cpudata.max_freq,cpudata.scale_max,cpudata.cur_freq); if (config.log_data>0) { @@ -313,12 +320,6 @@ int main(int argc,char **argv) config.logger("Failed to set scaling_max_freq, exiting"); failsafe(1); } - cpudata.scale_max=cpufreq_get_long_int("scaling_max_freq"); - if ((cpudata.scale_max<VALID_FREQ_MIN) || (cpudata.scale_max>VALID_FREQ_MAX)) - { - config.logger("Invalid scale_max_freq reported, exiting"); - failsafe(1); - } } // Check if we should decrease @@ -335,12 +336,6 @@ int main(int argc,char **argv) config.logger("Failed to set scaling_max_freq, exiting"); failsafe(1); } - cpudata.scale_max=cpufreq_get_long_int("scaling_max_freq"); - if ((cpudata.scale_max<VALID_FREQ_MIN) || (cpudata.scale_max>VALID_FREQ_MAX)) - { - config.logger("Invalid scale_max_freq reported, exiting"); - failsafe(1); - } } sleep(config.interval); |