aio now has extreme mode

This commit is contained in:
2026-07-10 12:21:49 +02:00
parent b3397abe90
commit 92ce83ab4f
3 changed files with 12 additions and 6 deletions

View File

@@ -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);
}

View File

@@ -108,7 +108,7 @@ static void *display_thread(void *arg) {
lcd_set_custom_char(&lcd, 2, &(lcd_glyph_t){0, 0, 8, 21, 21, 2, 0, 0}); // home (tilde)
lcd_set_custom_char(&lcd, 3, &(lcd_glyph_t){4, 14, 21, 4, 4, 4, 0}); // up arrow
lcd_set_custom_char(&lcd, 4, &(lcd_glyph_t){4, 4, 4, 21, 14, 4, 0}); // down arrow
lcd_set_custom_char(&lcd, 5, &(lcd_glyph_t){0, 0, 15, 21, 21, 17, 15, 0}); // home (tilde)
lcd_set_custom_char(&lcd, 5, &(lcd_glyph_t){0, 0, 15, 21, 21, 17, 15, 0}); // games (steam?)
/* main display loop */
applog(LOG_START, "reached display main loop");