void outputter_t::start_output () { _lineno = 1; // switching from NONE to PASSTHROUGH switch_to_mode (OUTPUT_PASSTHROUGH); }
void short_button_press() { ui_mode_t mode = current.mnum; if (ui_in_config_flag) { /* Should never be in config mode unless mode is valid. * Assume it is. Also assume that there is a configfunc, * since if there wasn't longpress should have not entered * config mode. */ (display_modes[mode].displayfunc)(mode, CONFIG_SHORT_PRESS); /* Note: zero return code from short press will not quit * config mode. Only zero return from enter or long press * will quit. This could be changed. */ return; } switch_to_mode(mode+1); /* Save last selected mode in EEPROM. * Note: this is the mode number, not the * index of that mode in display_modes. */ save_persist_data(PDATA_LAST_MODE, current.mnum); }
void ui_display_callback(timerentry_t *ctx) { #if 0 if (display_update_timer.key) { egt_read_thermocouple(); goto timer_again; } #endif ui_mode_t mode = current.mnum; if (current.stop_updates) { /* Stop timer */ return; } #ifdef RADIO_IN_SUPPORT if (current.mode_just_changed) { radio_change_counter = 0; } #endif if (current.press_feedback) { send_feedback_msg(); } else if (ui_in_config_flag) { (display_modes[mode].displayfunc)(mode, CONFIG_REFRESH); } #ifdef RADIO_IN_SUPPORT else if (radio_change_counter && radio_change_override) { --radio_change_counter; radioin_display_func(mode, DISPLAY_NORMAL_UPDATE); } #endif else /* normal display */ { (display_modes[mode].displayfunc)(mode, current.mode_just_changed?DISPLAY_MODE_JUST_CHANGED: DISPLAY_NORMAL_UPDATE); } current.mode_just_changed = 0; if (revert_counter < 80 && !ui_in_config_flag) /* 10 sec */ { ++revert_counter; if (revert_counter == 80) { /* This will switch to the last mode iff * we jumped to the current mode automatically * (i.e. due to atmospheric measurement) */ switch_to_mode(current.mnum); } } #if 0 timer_again: register_timer_callback(&display_update_timer, MS_TO_TICK(125), ui_display_callback, !display_update_timer.key); #else register_timer_callback(&display_update_timer, MS_TO_TICK(60), // was 125 ui_display_callback, 0); #endif }