From 36162d6931aaaf56c60c2e1c77cd3cdc2eba8363 Mon Sep 17 00:00:00 2001 From: PA4WDH Date: Sun, 28 Jul 2024 14:45:59 +0200 Subject: Add autodetection for temperature input --- Makefile | 2 +- argparse.c | 5 +- cputemp.c | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++ cputemp.h | 12 +++++ cputemp2maxfreq.c | 29 +++++++++++- generate_debug_h.sh | 2 +- 6 files changed, 173 insertions(+), 5 deletions(-) create mode 100644 cputemp.c create mode 100644 cputemp.h diff --git a/Makefile b/Makefile index 77e77c6..e65cacf 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -cputemp2maxfreq: version.o debug.o sysfs.o cpufreq.o failsafe.o argparse.o logger.o +cputemp2maxfreq: version.o debug.o sysfs.o cpufreq.o failsafe.o argparse.o logger.o cputemp.o version.h: generate_version_h.sh .git/index ./generate_version_h.sh > version.h diff --git a/argparse.c b/argparse.c index 124f3bc..1eae42b 100644 --- a/argparse.c +++ b/argparse.c @@ -20,7 +20,10 @@ void printhelp() " Default: %ld\n" "-g cpufreq governor to use, use \"keep\" to keep current governor\n" " Default: %s\n" - "-i Input for temperature readout, usually somewhere in sysfs\n" + "-i Input for temperature readout, this can be specified as:\n" + " A full path that starts with /, usually somewhere in sysfs\n" + " A sensor name, for example \"Core 0\"\n" + " The word \"auto\" autodetects a valid sensor\n" " Default: %s\n" "-p