refactor the vars
This commit is contained in:
@@ -44,9 +44,9 @@ struct aio_t {
|
||||
libusb_device_handle* handle;
|
||||
enum aio_pump_mode_t pump_mode;
|
||||
float water_temp;
|
||||
float t_q;
|
||||
float t_b;
|
||||
float t_e;
|
||||
float t_quiet;
|
||||
float t_balanced;
|
||||
float t_extreme;
|
||||
uint16_t pump_speed;
|
||||
uint16_t fan_speed[2];
|
||||
};
|
||||
|
||||
12
src/aio.c
12
src/aio.c
@@ -137,9 +137,9 @@ void aio_detect(struct aio_t *aio) {
|
||||
return;
|
||||
}
|
||||
|
||||
aio->t_q = 36.5f;
|
||||
aio->t_b = 38.5f;
|
||||
aio->t_e = 41.0f;
|
||||
aio->t_quiet = 36.5f;
|
||||
aio->t_balanced = 38.5f;
|
||||
aio->t_extreme = 41.0f;
|
||||
|
||||
const struct curve_point_t fan_curve[] = {
|
||||
{ 34, SPD2DTY(0)},
|
||||
@@ -172,13 +172,13 @@ void aio_update(struct aio_t *aio) {
|
||||
aio->pump_mode = aio_get_pump_mode(aio->handle);
|
||||
aio_get_fan_speed(aio->handle, aio->fan_speed);
|
||||
|
||||
if ((aio->pump_mode == QUIET && aio->water_temp > aio->t_b) || (aio->pump_mode == EXTREME && aio->water_temp < aio->t_b))
|
||||
if ((aio->pump_mode == QUIET && aio->water_temp > aio->t_balanced) || (aio->pump_mode == EXTREME && aio->water_temp < aio->t_balanced))
|
||||
aio_set_pump_mode(aio->handle, BALANCED);
|
||||
|
||||
if (aio->pump_mode == BALANCED) {
|
||||
if (aio->water_temp > aio->t_e)
|
||||
if (aio->water_temp > aio->t_extreme)
|
||||
aio_set_pump_mode(aio->handle, EXTREME);
|
||||
if (aio->water_temp < aio->t_q)
|
||||
if (aio->water_temp < aio->t_quiet)
|
||||
aio_set_pump_mode(aio->handle, QUIET);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user