diff --git a/Makefile b/Makefile index 7b81d36..3e0f78a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ CC = gcc -CFLAGS = -Wall -Wpedantic -Wextra -O2 -march=native +CFLAGS = -Wall -Wpedantic -Wextra -O2 -march=native\ + -DTHREADS=$(shell grep processor /proc/cpuinfo | wc -l)\ + -DPOLLING_TIME=$(shell read -p "type seconds between temp checks >" P;\ + echo $$P) SRC = src BINDIR = bin BIN = homemade_speedstep diff --git a/src/homemade_speedstep.c b/src/homemade_speedstep.c index 06c20ef..4bdb366 100644 --- a/src/homemade_speedstep.c +++ b/src/homemade_speedstep.c @@ -3,8 +3,6 @@ #include #define VERSION "1.1" -#define POLLING_TIME 1 -#define THREADS 4 /* TODO: automatically figure out how many threads host system has */ #define FREQS "/sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies" #define MAXSPDPREFIX "/sys/devices/system/cpu/cpu" #define MAXSPDSUFFIX "/cpufreq/scaling_max_freq"