From 092c340a2062fa98b7387fc5fd63578ddae7d0b6 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 15 Jul 2020 19:40:55 -0400 Subject: [1/4] Remove SH support and all archos targets This removes all code specific to SH targets Change-Id: I7980523785d2596e65c06430f4638eec74a06061 --- apps/screens.c | 260 --------------------------------------------------------- 1 file changed, 260 deletions(-) (limited to 'apps/screens.c') diff --git a/apps/screens.c b/apps/screens.c index e7262704f0..52e8cadc7e 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -56,230 +56,8 @@ #include "language.h" #include "replaygain.h" -#if defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2) -#include "adc.h" -#endif - -#if (CONFIG_STORAGE & STORAGE_MMC) && (defined(ARCHOS_ONDIOSP) || defined(ARCHOS_ONDIOFM)) -int mmc_remove_request(void) -{ - struct queue_event ev; - FOR_NB_SCREENS(i) - screens[i].clear_display(); - splash(0, ID2P(LANG_REMOVE_MMC)); - - while (1) - { - queue_wait_w_tmo(&button_queue, &ev, HZ/2); - switch (ev.id) - { - case SYS_HOTSWAP_EXTRACTED: - return SYS_HOTSWAP_EXTRACTED; - - case SYS_USB_DISCONNECTED: - return SYS_USB_DISCONNECTED; - } - } -} -#endif #include "ctype.h" -/* the charging screen is only used for archos targets */ -#if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) && defined(CPU_SH) - -#ifdef HAVE_LCD_BITMAP -static void charging_display_info(bool animate) -{ - unsigned char charging_logo[36]; - const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2; - const int pox_y = 32; - static unsigned phase = 3; - unsigned i; - -#if !defined(NEED_ATA_POWER_BATT_MEASURE) - { - int battv = battery_voltage(); - lcd_putsf(0, 7, " Batt: %d.%02dV %d%% ", battv / 1000, - (battv % 1000) / 10, battery_level()); - } -#elif defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2) - /* IDE power is normally off here, so display input current instead */ - lcd_putsf(7, 7, "%dmA ", - (adc_read(ADC_EXT_POWER) * EXT_SCALE_FACTOR) / 10000); -#endif - -#ifdef ARCHOS_RECORDER - lcd_puts(0, 2, "Charge mode:"); - - const char *s; - if (charge_state == CHARGING) - s = str(LANG_BATTERY_CHARGE); - else if (charge_state == TOPOFF) - s = str(LANG_BATTERY_TOPOFF_CHARGE); - else if (charge_state == TRICKLE) - s = str(LANG_BATTERY_TRICKLE_CHARGE); - else - s = "not charging"; - - lcd_puts(0, 3, s); - if (!charger_enabled()) - animate = false; -#endif /* ARCHOS_RECORDER */ - - /* middle part */ - memset(charging_logo+3, 0x00, 32); - charging_logo[0] = 0x3C; - charging_logo[1] = 0x24; - charging_logo[2] = charging_logo[35] = 0xFF; - - if (!animate) - { /* draw the outline */ - /* middle part */ - lcd_mono_bitmap(charging_logo, pox_x, pox_y + 8, - sizeof(charging_logo), 8); - lcd_set_drawmode(DRMODE_FG); - /* upper line */ - charging_logo[0] = charging_logo[1] = 0x00; - memset(charging_logo+2, 0x80, 34); - lcd_mono_bitmap(charging_logo, pox_x, pox_y, sizeof(charging_logo), 8); - /* lower line */ - memset(charging_logo+2, 0x01, 34); - lcd_mono_bitmap(charging_logo, pox_x, pox_y + 16, - sizeof(charging_logo), 8); - lcd_set_drawmode(DRMODE_SOLID); - } - else - { /* animate the middle part */ - for (i = 3; i 7) - bitpos = 14 - bitpos; - charging_logo[i] = BIT_N(bitpos); - } - } - lcd_mono_bitmap(charging_logo, pox_x, pox_y + 8, - sizeof(charging_logo), 8); - phase++; - } - lcd_update(); -} -#else /* not HAVE_LCD_BITMAP */ - -static unsigned long logo_chars[4]; -static const unsigned char logo_pattern[] = { - 0x07, 0x04, 0x1c, 0x14, 0x1c, 0x04, 0x07, 0, /* char 1 */ - 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 2 */ - 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 3 */ - 0x1f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, 0, /* char 4 */ -}; - -static void logo_lock_patterns(bool on) -{ - int i; - - if (on) - { - for (i = 0; i < 4; i++) - logo_chars[i] = lcd_get_locked_pattern(); - } - else - { - for (i = 0; i < 4; i++) - lcd_unlock_pattern(logo_chars[i]); - } -} - -static void charging_display_info(bool animate) -{ - int battv; - unsigned i, ypos; - static unsigned phase = 3; - char buf[32]; - - battv = battery_voltage(); - lcd_putsf(4, 1, " %d.%02dV", battv / 1000, (battv % 1000) / 10); - - memcpy(buf, logo_pattern, 32); /* copy logo patterns */ - - if (!animate) /* build the screen */ - { - lcd_double_height(false); - lcd_puts(0, 0, "[Charging]"); - for (i = 0; i < 4; i++) - lcd_putc(i, 1, logo_chars[i]); - } - else /* animate the logo */ - { - for (i = 3; i < MIN(19, phase); i++) - { - if ((i - phase) % 5 == 0) - { /* draw a "bubble" here */ - ypos = (phase + i/5) % 9; /* "bounce" effect */ - if (ypos > 4) - ypos = 8 - ypos; - buf[5 - ypos + 8 * (i/5)] |= 0x10u >> (i%5); - } - } - phase++; - } - - for (i = 0; i < 4; i++) - lcd_define_pattern(logo_chars[i], buf + 8 * i); - - lcd_update(); -} -#endif /* (not) HAVE_LCD_BITMAP */ - -/* blocks while charging, returns on event: - 1 if charger cable was removed - 2 if Off/Stop key was pressed - 3 if On key was pressed - 4 if USB was connected */ - -int charging_screen(void) -{ - unsigned int button; - int rc = 0; - - ide_power_enable(false); /* power down the disk, else would be spinning */ - - lcd_clear_display(); - backlight_set_timeout(global_settings.backlight_timeout); -#ifdef HAVE_REMOTE_LCD - remote_backlight_set_timeout(global_settings.remote_backlight_timeout); -#endif - backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged); - -#ifdef HAVE_LCD_CHARCELLS - logo_lock_patterns(true); -#endif - charging_display_info(false); - - do - { - gui_syncstatusbar_draw(&statusbars, false); - charging_display_info(true); - button = get_action(CONTEXT_STD,HZ/3); - if (button == ACTION_STD_OK) - rc = 2; - else if (usb_detect() == USB_INSERTED) - rc = 3; - /* do not depend on power management thread here */ - else if (!(power_input_status() & POWER_INPUT_MAIN_CHARGER)) - rc = 1; - } while (!rc); - -#ifdef HAVE_LCD_CHARCELLS - logo_lock_patterns(false); -#endif - return rc; -} -#endif /* CONFIG_CHARGING && !HAVE_POWEROFF_WHILE_CHARGING && defined(CPU_SH) */ - #if CONFIG_CHARGING void charging_splash(void) { @@ -585,44 +363,6 @@ bool set_time_screen(const char* title, struct tm *tm) } #endif /* defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0) */ -#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF) -#include "scroll_engine.h" -bool shutdown_screen(void) -{ - int button; - bool done = false; - long time_entered = current_tick; - - lcd_scroll_stop(); - - splash(0, str(LANG_CONFIRM_SHUTDOWN)); - - while(!done && TIME_BEFORE(current_tick,time_entered+HZ*2)) - { - button = get_action(CONTEXT_STD,HZ); - switch(button) - { - case ACTION_STD_CANCEL: - sys_poweroff(); - break; - - /* do nothing here, because ACTION_NONE might be caused - * by timeout or button release. In case of timeout the loop - * is terminated by TIME_BEFORE */ - case ACTION_NONE: - break; - - default: - if(default_event_handler(button) == SYS_USB_CONNECTED) - return true; - done = true; - break; - } - } - return false; -} -#endif - static const int id3_headers[]= { LANG_ID3_TITLE, -- cgit v1.2.3