From aabc8aca47e60cf745a34af28c50679fcb967910 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sat, 3 Oct 2020 18:17:11 -0400 Subject: New port: FiiO M3K Most credit goes to: Roman Skylarov Additional integration and refactoring by myself. *** COMPLETELY UNTESTED *** Change-Id: Ia64c36d92e0214c6b15f7a868df286f8113ea27b --- bootloader/rocker_linux.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'bootloader/rocker_linux.c') diff --git a/bootloader/rocker_linux.c b/bootloader/rocker_linux.c index e3985ce100..4abc88c413 100644 --- a/bootloader/rocker_linux.c +++ b/bootloader/rocker_linux.c @@ -51,23 +51,42 @@ #define ICON_WIDTH 70 #define ICON_HEIGHT 70 #define RBFILE "rockbox.rocker" +#define ICON_NAME bm_hibyicon +#define OF_NAME "HIBY PLAYER" +#include "bitmaps/hibyicon.h" #elif defined(XDUOO_X3II) #define ICON_WIDTH 130 #define ICON_HEIGHT 130 #define RBFILE "rockbox.x3ii" +#define ICON_NAME bm_hibyicon +#define OF_NAME "HIBY PLAYER" +#include "bitmaps/hibyicon.h" #elif defined(XDUOO_X20) #define ICON_WIDTH 130 #define ICON_HEIGHT 130 #define RBFILE "rockbox.x20" +#define ICON_NAME bm_hibyicon +#define OF_NAME "HIBY PLAYER" +#include "bitmaps/hibyicon.h" +#elif defined(FIIO_M3K) +#define ICON_WIDTH 130 +#define ICON_HEIGHT 130 +#define RBFILE "rockbox.fiiom3k" +#define ICON_NAME bm_fiioicon +#define OF_NAME "FIIO PLAYER" +#include "bitmaps/fiioicon.h" #else #error "must define ICON_WIDTH/HEIGHT" #endif +#ifdef FIIO_M3K +#define BASE_DIR "/mnt" +#else #define BASE_DIR "/mnt/sd_0" +#endif /* images */ #include "bitmaps/rockboxicon.h" -#include "bitmaps/hibyicon.h" #include "bitmaps/toolsicon.h" /* don't issue an error when parsing the file for dependencies */ @@ -79,6 +98,10 @@ BMPHEIGHT_hibyicon != ICON_HEIGHT) #error hibyicon has the wrong resolution #endif +#if defined(BMPWIDTH_fiioicon) && (BMPWIDTH_fiioicon != ICON_WIDTH || \ + BMPHEIGHT_fiioicon != ICON_HEIGHT) +#error fiioicon has the wrong resolution +#endif #if defined(BMPWIDTH_toolsicon) && (BMPWIDTH_toolsicon != ICON_WIDTH || \ BMPHEIGHT_toolsicon != ICON_HEIGHT) #error toolsicon has the wrong resolution @@ -148,6 +171,8 @@ static int get_inactivity_tmo(void) else #endif return 10 * HZ; /* Inactivity timeout when not on hold */ + + // XXX if booting the last selection, use a short timeout? } /* return action on idle timeout */ @@ -229,11 +254,11 @@ static enum boot_mode get_boot_mode(void) } lcd_set_foreground(LCD_RGBPACK(255, 201, 0)); /* display icon */ - const struct bitmap *icon = (mode == BOOT_OF) ? &bm_hibyicon : + const struct bitmap *icon = (mode == BOOT_OF) ? &ICON_NAME : (mode == BOOT_ROCKBOX) ? &bm_rockboxicon : &bm_toolsicon; lcd_bmp(icon, (LCD_WIDTH - ICON_WIDTH) / 2, get_icon_y()); /* display bottom description */ - const char *desc = (mode == BOOT_OF) ? "HIBY PLAYER" : + const char *desc = (mode == BOOT_OF) ? OF_NAME : (mode == BOOT_ROCKBOX) ? "ROCKBOX" : "TOOLS"; int desc_height; -- cgit v1.2.3