aio now has extreme mode
This commit is contained in:
13
src/aio.c
13
src/aio.c
@@ -129,7 +129,7 @@ static void aio_set_fan_curve(libusb_device_handle* dev, const struct curve_poin
|
||||
applog(LOG_INF, "set up AIO fan curve");
|
||||
}
|
||||
|
||||
void aio_detect(struct aio_t *aio, const float t_quiet, const float t_balanced) {
|
||||
void aio_detect(struct aio_t *aio, const float t_quiet, const float t_balanced, const float t_extreme) {
|
||||
libusb_init(nullptr);
|
||||
aio->handle = libusb_open_device_with_vid_pid(nullptr, AIO_USB_VID, AIO_USB_PID);
|
||||
if (aio->handle == nullptr) {
|
||||
@@ -139,6 +139,7 @@ void aio_detect(struct aio_t *aio, const float t_quiet, const float t_balanced)
|
||||
|
||||
aio->t_q = t_quiet;
|
||||
aio->t_b = t_balanced;
|
||||
aio->t_e = t_extreme;
|
||||
|
||||
const struct curve_point_t fan_curve[] = {
|
||||
{ 35, SPD2DTY(360) },
|
||||
@@ -170,11 +171,15 @@ 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->water_temp > aio->t_b && aio->pump_mode != BALANCED)
|
||||
if ((aio->pump_mode == QUIET && aio->water_temp > aio->t_b) || (aio->pump_mode == EXTREME && aio->water_temp < aio->t_b))
|
||||
aio_set_pump_mode(aio->handle, BALANCED);
|
||||
|
||||
if (aio->water_temp < aio->t_q && aio->pump_mode != QUIET)
|
||||
aio_set_pump_mode(aio->handle, QUIET);
|
||||
if (aio->pump_mode == BALANCED) {
|
||||
if (aio->water_temp > aio->t_e)
|
||||
aio_set_pump_mode(aio->handle, EXTREME);
|
||||
if (aio->water_temp < aio->t_q)
|
||||
aio_set_pump_mode(aio->handle, QUIET);
|
||||
}
|
||||
|
||||
aio_usb_release(aio->handle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user