aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPA4WDH2024-10-09 12:18:23 +0200
committerPA4WDH2024-10-09 12:18:23 +0200
commit9586b59606edcf3538428c16680a2a6eb2d7969d (patch)
treed425b3eb3b3fbd6996c1a0a645ba91498d0e4d50
parentRead scaling_max_freq every poll interval (diff)
downloadcputemp2maxfreq-9afa6eef0608cedc5cd1c4db159bab9edfd32637.tar.gz
cputemp2maxfreq-9afa6eef0608cedc5cd1c4db159bab9edfd32637.tar.bz2
cputemp2maxfreq-9afa6eef0608cedc5cd1c4db159bab9edfd32637.zip
Rename config.max_freq to config.target_freq and make texts consistent with that0.7
-rw-r--r--README.html2
-rw-r--r--argparse.c6
-rw-r--r--cputemp2maxfreq.c10
-rw-r--r--cputemp2maxfreq.h2
-rw-r--r--logger.c2
5 files changed, 11 insertions, 11 deletions
diff --git a/README.html b/README.html
index 77c8d09..3dbf882 100644
--- a/README.html
+++ b/README.html
@@ -57,7 +57,7 @@
<li><strong>-s</strong> set the step size to increase/decrease CPU speed.
Note that this value will be multiplied by the difference between the CPU
temperature and the set temperature to calculate the actual change.</li>
- <li><strong>-t</strong> set the temperature limit</li>
+ <li><strong>-t</strong> set the target temperature</li>
</ul>
<p><strong>Logging options:</strong></p>
<ul>
diff --git a/argparse.c b/argparse.c
index 9f702f0..e9d16c4 100644
--- a/argparse.c
+++ b/argparse.c
@@ -55,7 +55,7 @@ void printhelp()
" Default: all\n"
"-s <step> Step size in Khz when increasing/decreasing CPU speed\n"
" Default: %ld\n"
- "-t <number> Temperature limit\n"
+ "-t <number> Target temperature\n"
" Default: %ld\n"
"\n"
"Logging options:\n"
@@ -72,7 +72,7 @@ void printhelp()
"-h Display this help text\n"
"-v Display version and license information\n",
config.name,config.fallback_freq,config.governor,config.temp_input,config.interval,
- config.freq_step,config.max_temp/1000,config.logger_name
+ config.freq_step,config.target_temp/1000,config.logger_name
);
}
@@ -177,7 +177,7 @@ void argparse(int argc, char **argv)
userconfig.freq_step=strtoll(optarg,NULL,10);
break;
case 't':
- userconfig.max_temp=strtoll(optarg,NULL,10)*1000;
+ userconfig.target_temp=strtoll(optarg,NULL,10)*1000;
break;
case 'u':
userconfig.use_unixtime=1;
diff --git a/cputemp2maxfreq.c b/cputemp2maxfreq.c
index 81fcdef..f4a9c51 100644
--- a/cputemp2maxfreq.c
+++ b/cputemp2maxfreq.c
@@ -37,7 +37,7 @@
struct s_config config={
.name="", // Name of this program, set by argparse
.governor="conservative", // Governor
- .max_temp=70000, // Temperature
+ .target_temp=70000, // Target temperature
.temp_input="auto", // Temperature input
.freq_step=100000, // Frequency step
.fallback_freq=2000000, // Fallback frequency
@@ -100,7 +100,7 @@ int main(int argc,char **argv)
// Log configuration
config.logger("Configuration:");
config.logger("Governor: %s",config.governor);
- config.logger("Temperature: %ld",config.max_temp);
+ config.logger("Target temperature: %ld",config.target_temp);
config.logger("Temp input: %s",config.temp_input);
config.logger("Frequency step: %ld",config.freq_step);
config.logger("Fallback frquency: %ld",config.fallback_freq);
@@ -134,7 +134,7 @@ int main(int argc,char **argv)
config.logger("Physical CPU to change: %d",config.cpu);
}
- if ((config.max_temp<VALID_TEMP_MIN) || (config.max_temp>VALID_TEMP_MAX))
+ if ((config.target_temp<VALID_TEMP_MIN) || (config.target_temp>VALID_TEMP_MAX))
{
config.logger("Invalid temperature, range is %d-%d",VALID_TEMP_MIN,VALID_TEMP_MAX);
exit(1);
@@ -297,14 +297,14 @@ int main(int argc,char **argv)
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);
+ DEBUG1_MAIN("Data: %ld %ld %ld %ld %ld\n",cpudata.cur_temp,config.target_temp,cpudata.max_freq,cpudata.scale_max,cpudata.cur_freq);
if (config.log_data>0)
{
config.logger("CPU Temperature: %ld, CPU Frequency: %ld",cpudata.cur_temp/1000,cpudata.cur_freq);
}
if (config.csvfile!=NULL) csvlog_write();
- diff=config.max_temp-cpudata.cur_temp;
+ diff=config.target_temp-cpudata.cur_temp;
// Check if we should increase
if ((diff>=1000) && (cpudata.scale_max<cpudata.max_freq))
diff --git a/cputemp2maxfreq.h b/cputemp2maxfreq.h
index baa691a..44592ab 100644
--- a/cputemp2maxfreq.h
+++ b/cputemp2maxfreq.h
@@ -53,7 +53,7 @@ struct s_cpudata {
struct s_config {
char name[255]; // Name of this program
char governor[255]; // The governor to use
- long int max_temp; // The target temperature
+ long int target_temp; // The target temperature
char temp_input[255]; // Input file to read the temperature
long int freq_step; // Step size to increase/decrease CPU frequency
long int fallback_freq; // CPU frquency to set if we fail to protect hardware
diff --git a/logger.c b/logger.c
index 61b2c1e..ecb6598 100644
--- a/logger.c
+++ b/logger.c
@@ -152,7 +152,7 @@ void csvlog_write()
snprintf(timestring,sizeof(timestring),"%ld",unixtime);
}
- fprintf(config.csvfile,"%s,\"%ld\",\"%ld\",\"%ld\",\"%ld\",\"%ld\",\"%ld\"\n",timestring,cpudata.min_freq,cpudata.max_freq,cpudata.cur_freq,cpudata.cur_temp/1000,config.max_temp/1000,cpudata.scale_max);
+ fprintf(config.csvfile,"%s,\"%ld\",\"%ld\",\"%ld\",\"%ld\",\"%ld\",\"%ld\"\n",timestring,cpudata.min_freq,cpudata.max_freq,cpudata.cur_freq,cpudata.cur_temp/1000,config.target_temp/1000,cpudata.scale_max);
fflush(config.csvfile);
}