summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootloader/x1000.c38
-rw-r--r--bootloader/x1000/x1000bootloader.h64
2 files changed, 65 insertions, 37 deletions
diff --git a/bootloader/x1000.c b/bootloader/x1000.c
index 14634683e6..78b74452d9 100644
--- a/bootloader/x1000.c
+++ b/bootloader/x1000.c
@@ -49,49 +49,13 @@
49#include "version.h" 49#include "version.h"
50#include "boot-x1000.h" 50#include "boot-x1000.h"
51#include "installer-x1000.h" 51#include "installer-x1000.h"
52#include "x1000/x1000bootloader.h"
52#include <stddef.h> 53#include <stddef.h>
53#include <stdbool.h> 54#include <stdbool.h>
54#include <string.h> 55#include <string.h>
55#include <stdio.h> 56#include <stdio.h>
56#include <stdarg.h> 57#include <stdarg.h>
57 58
58#if defined(FIIO_M3K)
59# define BL_RECOVERY BUTTON_VOL_UP
60# define BL_UP BUTTON_VOL_UP
61# define BL_DOWN BUTTON_VOL_DOWN
62# define BL_SELECT BUTTON_PLAY
63# define BL_QUIT BUTTON_POWER
64# define BL_UP_NAME "VOL+"
65# define BL_DOWN_NAME "VOL-"
66# define BL_SELECT_NAME "PLAY"
67# define BL_QUIT_NAME "POWER"
68# define BOOTBACKUP_FILE "/fiiom3k-boot.bin"
69#elif defined(SHANLING_Q1)
70# define BL_RECOVERY BUTTON_NEXT
71# define BL_UP BUTTON_PREV
72# define BL_DOWN BUTTON_NEXT
73# define BL_SELECT BUTTON_PLAY
74# define BL_QUIT BUTTON_POWER
75# define BL_UP_NAME "PREV"
76# define BL_DOWN_NAME "NEXT"
77# define BL_SELECT_NAME "PLAY"
78# define BL_QUIT_NAME "POWER"
79# define BOOTBACKUP_FILE "/shanlingq1-boot.bin"
80#elif defined(EROS_QN)
81# define BL_RECOVERY BUTTON_VOL_UP
82# define BL_UP BUTTON_SCROLL_BACK
83# define BL_DOWN BUTTON_SCROLL_FWD
84# define BL_SELECT BUTTON_PLAY
85# define BL_QUIT BUTTON_POWER
86# define BL_UP_NAME "Up"
87# define BL_DOWN_NAME "Scroll Down"
88# define BL_SELECT_NAME "PLAY"
89# define BL_QUIT_NAME "POWER"
90# define BOOTBACKUP_FILE "/erosqnative-boot.bin"
91#else
92# error "Missing keymap!"
93#endif
94
95enum { 59enum {
96 MENUITEM_HEADING, 60 MENUITEM_HEADING,
97 MENUITEM_ACTION, 61 MENUITEM_ACTION,
diff --git a/bootloader/x1000/x1000bootloader.h b/bootloader/x1000/x1000bootloader.h
new file mode 100644
index 0000000000..75303c3717
--- /dev/null
+++ b/bootloader/x1000/x1000bootloader.h
@@ -0,0 +1,64 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2021-2022 Aidan MacDonald
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef __X1000BOOTLOADER_H__
23#define __X1000BOOTLOADER_H__
24
25#include "config.h"
26
27#if defined(FIIO_M3K)
28# define BL_RECOVERY BUTTON_VOL_UP
29# define BL_UP BUTTON_VOL_UP
30# define BL_DOWN BUTTON_VOL_DOWN
31# define BL_SELECT BUTTON_PLAY
32# define BL_QUIT BUTTON_POWER
33# define BL_UP_NAME "VOL+"
34# define BL_DOWN_NAME "VOL-"
35# define BL_SELECT_NAME "PLAY"
36# define BL_QUIT_NAME "POWER"
37# define BOOTBACKUP_FILE "/fiiom3k-boot.bin"
38#elif defined(SHANLING_Q1)
39# define BL_RECOVERY BUTTON_NEXT
40# define BL_UP BUTTON_PREV
41# define BL_DOWN BUTTON_NEXT
42# define BL_SELECT BUTTON_PLAY
43# define BL_QUIT BUTTON_POWER
44# define BL_UP_NAME "PREV"
45# define BL_DOWN_NAME "NEXT"
46# define BL_SELECT_NAME "PLAY"
47# define BL_QUIT_NAME "POWER"
48# define BOOTBACKUP_FILE "/shanlingq1-boot.bin"
49#elif defined(EROS_QN)
50# define BL_RECOVERY BUTTON_VOL_UP
51# define BL_UP BUTTON_SCROLL_BACK
52# define BL_DOWN BUTTON_SCROLL_FWD
53# define BL_SELECT BUTTON_PLAY
54# define BL_QUIT BUTTON_POWER
55# define BL_UP_NAME "Up"
56# define BL_DOWN_NAME "Scroll Down"
57# define BL_SELECT_NAME "PLAY"
58# define BL_QUIT_NAME "POWER"
59# define BOOTBACKUP_FILE "/erosqnative-boot.bin"
60#else
61# error "Missing keymap!"
62#endif
63
64#endif /* __X1000BOOTLOADER_H__ */