static void static_setpoint_button_clicked(button_event_t* event) { if (event->id != EVT_BUTTON_CLICK) return; controller_settings_screen_t* s = widget_get_user_data(event->widget); unit_t temp_units = app_cfg_get_temp_unit(); float min; float max; char* title; if (s->controller == CONTROLLER_1) title = "Controller 1 Setpoint"; else title = "Controller 2 Setpoint"; float velocity_steps[] = { 0.1f, 0.5f, 1.0f }; if (temp_units == UNIT_TEMP_DEG_F) { min = MIN_TEMP_F; max = MAX_TEMP_F; } else{ min = MIN_TEMP_C; max = MAX_TEMP_C; } widget_t* static_setpoint_screen = quantity_select_screen_create( title, s->settings.static_setpoint, min, max, velocity_steps, 3, update_static_setpoint, s); gui_push_screen(static_setpoint_screen); }
static void build_offset_screen(offset_screen_t* s, char* title) { float velocity_steps[] = { 0.1f }; sensor_config_t* sensor_cfg = get_sensor_cfg(s->sensor_id); quantity_t probe_offset = app_cfg_get_probe_offset(sensor_cfg->sensor_serial); if (app_cfg_get_temp_unit() == UNIT_TEMP_DEG_C) { probe_offset.value *= (5.0f / 9.0f); probe_offset.unit = UNIT_TEMP_DEG_C; } widget_t* probe_offset_screen = quantity_select_screen_create( title, probe_offset, MIN_PROBE_OFFSET, MAX_PROBE_OFFSET, velocity_steps, 1, update_probe_offset, s); gui_push_screen(probe_offset_screen); }