Current fan speed now returns the last fan speed measured
This commit is contained in:
parent
dd53b4dbf2
commit
bcd631001b
@ -1,4 +1,5 @@
|
|||||||
#include "command-handler.h"
|
#include "command-handler.h"
|
||||||
|
#include "fan_speeeed.h"
|
||||||
|
|
||||||
// Initialize empty, global command context
|
// Initialize empty, global command context
|
||||||
volatile command_context_t context = {UNKNOWN_COMMAND, SRC_NONE, FAN_NONE,
|
volatile command_context_t context = {UNKNOWN_COMMAND, SRC_NONE, FAN_NONE,
|
||||||
@ -235,9 +236,9 @@ uint8_t route_command(int pos) {
|
|||||||
break;
|
break;
|
||||||
case READ_FAN_SPEED:
|
case READ_FAN_SPEED:
|
||||||
if (context.fan == FAN1) {
|
if (context.fan == FAN1) {
|
||||||
return fan1_history[0];
|
return fan1_history[fan1_history_index];
|
||||||
} else if (context.fan == FAN2) {
|
} else if (context.fan == FAN2) {
|
||||||
return fan2_history[0];
|
return fan2_history[fan2_history_index];
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user