void ui_message(uint8_t dest_state) { if (ui_state == UIS_FIND_KEY) keyleds_off(); ui_state = dest_state; enable_lcd_backlight(); reset_ui_timer(); }
void ui_select_time(uint8_t timer_id, uint8_t default_time, uint8_t max_time) { if (ui_state == UIS_FIND_KEY) keyleds_off(); selected_time = default_time; max_selectable_time = max_time; selected_key = timer_id; ui_state = UIS_SELECT_TIME; enable_lcd_backlight(); reset_ui_timer(); ui_repaint(); }
//------------------------------------------------------------------------------ // // Function: lcd_config // // This function configures the LCD // void lcd_config(UINT32 framebuffer) { reset_display_controller(); // Enable LCD clocks enable_lcd_power(); // Configure the DSS registers configure_dss(framebuffer); // Display data on LCD display_lcd_image() ; //if (IsDVIMode()) // DVI is selected, disable backlight // disable_lcd_backlight(); //else // Turn on backlight last enable_lcd_backlight(); }
static void ui_default_state(void) { enable_lcd_backlight(); if (ui_flags & UIF_KEY_ERROR) { ui_state = UIS_KEY_ERROR; keyled_blink(error_slot); smaul_pulse_update(); beeper_start(BEEP_ERROR); switch (ui_flags & UIF_KEY_ERROR) { case UIF_KEY_ERROR_READ_ERR: lcd_printfP(0, PSTR("Error reading key")); break; case UIF_KEY_ERROR_UNKNOWN: lcd_printfP(0, PSTR("Unknown key %d (\"%s\")"), keys[error_slot].eep.key.id, keys[error_slot].eep.key.name); break; case UIF_KEY_ERROR_OTHER_KB: lcd_printfP(0, PSTR("Key belongs to %s keyboard"), keys[error_slot].eep.kb.name); break; } } else { ui_state = UIS_IDLE; keyleds_off(); if (!(ui_flags & UIF_TIMER_EXPIRED)) { smaul_pulse_update(); beeper_stop(); print_missing_keys(); } else if (expired_timer < MAX_KEYS) { smaul_sync_to_beeper(); beeper_start(BEEP_KEYMISSING); lcd_printfP(0, PSTR("Key %s missing"), config.keys[expired_timer].name); } else { uint8_t n = expired_timer - MAX_KEYS; smaul_blink(220); beeper_start(BEEP_PIZZA1 + n); lcd_printfP(0, PSTR("Pizza %d done"), n + 1); } } }
void ui_poll(void) { uint8_t event = get_event(); if (event == EV_NONE) return; switch (event) { case EV_ENCODER_CW: menu_button_forward(); break; case EV_ENCODER_CCW: menu_button_back(); break; case EV_ENCODER_PUSH: menu_activate(); break; case EV_SMAUL_PUSH: menu_button_smaul(); break; case EV_TICK: key_timer(); count_ui_timer(); smaul_pulse_update(); break; case EV_KEY_CHANGE: key_change(); break; } if (event != EV_TICK && event != EV_KEY_CHANGE) { enable_lcd_backlight(); reset_ui_timer(); } ui_repaint(); }
static int configure_lcd_evm() { reset_display_controller(); if (enable_lcd_backlight()) { return -1; } if (enable_lcd_power()) { return -1; } if (configure_vga_mode()) { return -1; } printf("%d\t%d\n",disable_lcd_reset(),__LINE__); printf("%d\t%d\n",enable_lcd_HVIF(),__LINE__); printf("%d\t%d\n",enable_lcd_reset(),__LINE__); printf("%d\t%d\n",enable_INI(),__LINE__); printf("%d\t%d\n",configure_vert_scan_direction(CONV_SCAN_DIRECTION),__LINE__); printf("%d\t%d\n",configure_horiz_scan_direction(CONV_SCAN_DIRECTION),__LINE__); return 0; }