diff --git a/app/config.c b/app/config.c index 1f74ccb..6a7f238 100644 --- a/app/config.c +++ b/app/config.c @@ -91,7 +91,7 @@ error_mode_t error_mode = ERROR_MODE_NONE; cpu_state_t cpu_state[MAX_CPUS]; -bool enable_temperature = false; +bool enable_temperature = true; bool enable_trace = false; bool enable_sm = true; @@ -761,7 +761,7 @@ void config_init(void) cpu_state[i] = CPU_STATE_ENABLED; } - enable_temperature = !no_temperature; + enable_temperature &= !no_temperature; power_save = POWER_SAVE_HIGH; diff --git a/app/display.c b/app/display.c index de9d4b6..3e090b5 100644 --- a/app/display.c +++ b/app/display.c @@ -64,6 +64,8 @@ static bool timed_update_done = false; // update cycle status int scroll_message_row; +int max_cpu_temp = 0; + //------------------------------------------------------------------------------ // Public Functions //------------------------------------------------------------------------------ @@ -347,7 +349,15 @@ void do_tick(int my_cpu) // Update temperature one time per second if (enable_temperature) { - display_temperature(get_cpu_temperature()); + int actual_cpu_temp = get_cpu_temperature(); + + if(max_cpu_temp < actual_cpu_temp ) { + max_cpu_temp = actual_cpu_temp; + } + + if(actual_cpu_temp != 0) { + display_temperature(actual_cpu_temp, max_cpu_temp); + } } // Update TTY one time every TTY_UPDATE_PERIOD second(s) diff --git a/app/display.h b/app/display.h index 904e196..751971c 100644 --- a/app/display.h +++ b/app/display.h @@ -145,8 +145,8 @@ #define display_run_time(hours, mins, secs) \ printf(7, 47, "%i:%02i:%02i", hours, mins, secs) -#define display_temperature(temp) \ - printf(1, 20, "%2i/%2i%cC", temp, temp, 0xf8) +#define display_temperature(temp, maxtemp) \ + printf(1, 20, "%2i/%2i%cC", temp, maxtemp, 0xf8) #define display_pass_count(count) \ printi(8, 47, count, 0, false, true) diff --git a/app/main.c b/app/main.c index 41b8a14..9a885cc 100644 --- a/app/main.c +++ b/app/main.c @@ -246,7 +246,7 @@ static void global_init(void) if (enable_temperature) { int temp = get_cpu_temperature(); if (temp > 0) { - display_temperature(temp); + display_temperature(temp, temp); } else { enable_temperature = false; no_temperature = true;