From bcd631001be117394478d40f68f22d7272821df6 Mon Sep 17 00:00:00 2001 From: "Sebastian H. Gabrielli" Date: Tue, 30 Apr 2024 11:10:26 +0200 Subject: [PATCH] Current fan speed now returns the last fan speed measured --- prosjekt.X/command-handler.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/prosjekt.X/command-handler.c b/prosjekt.X/command-handler.c index 347043c..96bc956 100644 --- a/prosjekt.X/command-handler.c +++ b/prosjekt.X/command-handler.c @@ -1,4 +1,5 @@ #include "command-handler.h" +#include "fan_speeeed.h" // Initialize empty, global command context volatile command_context_t context = {UNKNOWN_COMMAND, SRC_NONE, FAN_NONE, @@ -235,9 +236,9 @@ uint8_t route_command(int pos) { break; case READ_FAN_SPEED: if (context.fan == FAN1) { - return fan1_history[0]; + return fan1_history[fan1_history_index]; } else if (context.fan == FAN2) { - return fan2_history[0]; + return fan2_history[fan2_history_index]; } else { return 0; }