Skip to content

Commit 4c60bc9

Browse files
committed
New port: Shanling Q1 native
- Audio playback works - Touchscreen and buttons work - Bootloader works and is capable of dual boot - Plugins are working - Cabbiev2 theme has been ported - Stable for general usage Thanks to Marc Aarts for porting Cabbiev2 and plugin bitmaps. There's a few minor known issues: - Bootloader must be installed manually using 'usbboot' as there is no support in jztool yet. - Keymaps may be lacking, need further testing and feedback. - Some plugins may not be fully adapted to the screen size and could benefit from further tweaking. - LCD shows abnormal effects under some circumstances: for example, after viewing a mostly black screen an afterimage appears briefly when going back to a brightly-lit screen. Sudden power-off without proper shutdown of the backlight causes a "dissolving" effect. - CW2015 battery reporting driver is buggy, and disabled for now. Battery reporting is currently voltage-based using the AXP192. Change-Id: I635e83f02a880192c5a82cb0861ad3a61c137c3a
1 parent 3abb7c5 commit 4c60bc9

File tree

110 files changed

+2843
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+2843
-15
lines changed

apps/SOURCES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,4 +298,6 @@ keymaps/keymap-fiiom3klinux.c
298298
keymaps/keymap-fiiom3k.c
299299
#elif CONFIG_KEYPAD == EROSQ_PAD
300300
keymaps/keymap-erosq.c
301+
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
302+
keymaps/keymap-shanlingq1.c
301303
#endif

apps/features.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,23 @@ depth_3d
182182
#endif
183183

184184
/* This should be AUDIOHW_HAVE_FILTER_ROLL_OFF but that is only defined later */
185-
#if defined(DX50) || defined(HAVE_DF1704_CODEC) || defined(HAVE_PCM1792_CODEC) || defined(HAVE_CS4398) || defined(HAVE_WM8740) || defined(HAVE_ES9018) || defined(HAVE_XDUOO_LINUX_CODEC) || defined(HAVE_FIIO_LINUX_CODEC) || defined(HAVE_AK4376)
185+
#if defined(DX50) || defined(HAVE_DF1704_CODEC) || defined(HAVE_PCM1792_CODEC) || defined(HAVE_CS4398) || defined(HAVE_WM8740) || defined(HAVE_ES9018) || defined(HAVE_XDUOO_LINUX_CODEC) || defined(HAVE_FIIO_LINUX_CODEC) || defined(HAVE_AK4376) || defined(HAVE_ES9218)
186186
filter_roll_off
187187
#endif
188188

189189
/* This should be AUDIOHW_HAVE_POWER_MODE but that is not defined yet */
190-
#if defined(HAVE_AK4376)
190+
#if defined(HAVE_AK4376) || defined(HAVE_ES9218)
191191
dac_power_mode
192192
#endif
193193

194194
#if defined(HAVE_ES9018)
195195
es9018
196196
#endif
197197

198+
#if defined(HAVE_ES9218)
199+
es9218
200+
#endif
201+
198202
/* These features are only used by the manual so they won't break binary
199203
* compatibility
200204
*/

apps/keymaps/keymap-shanlingq1.c

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/***************************************************************************
2+
* __________ __ ___.
3+
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4+
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5+
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6+
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7+
* \/ \/ \/ \/ \/
8+
* $Id$
9+
*
10+
* Copyright (C) 2021 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+
/* Button Code Definitions for Shanling Q1 target */
23+
24+
#include "config.h"
25+
#include "action.h"
26+
#include "button.h"
27+
#include "settings.h"
28+
29+
/* {Action Code, Button code, Prereq button code } */
30+
31+
static const struct button_mapping button_context_standard[] = {
32+
{ACTION_STD_PREV, BUTTON_PREV, BUTTON_NONE},
33+
{ACTION_STD_NEXT, BUTTON_NEXT, BUTTON_NONE},
34+
{ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY},
35+
{ACTION_STD_CANCEL, BUTTON_POWER|BUTTON_REL, BUTTON_POWER},
36+
LAST_ITEM_IN_LIST
37+
}; /* button_context_standard */
38+
39+
static const struct button_mapping button_context_wps[] = {
40+
{ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY},
41+
{ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
42+
{ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_NONE},
43+
{ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_NONE},
44+
{ACTION_WPS_SKIPNEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT},
45+
{ACTION_WPS_SKIPPREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV},
46+
{ACTION_WPS_SEEKFWD, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE},
47+
{ACTION_WPS_STOPSEEK, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT|BUTTON_REPEAT},
48+
{ACTION_WPS_SEEKBACK, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE},
49+
{ACTION_WPS_STOPSEEK, BUTTON_PREV|BUTTON_REL, BUTTON_PREV|BUTTON_REPEAT},
50+
{ACTION_STD_KEYLOCK, BUTTON_POWER|BUTTON_REL, BUTTON_POWER},
51+
LAST_ITEM_IN_LIST
52+
}; /* button_context_wps */
53+
54+
static const struct button_mapping button_context_list[] = {
55+
{ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_NONE},
56+
{ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_NONE},
57+
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
58+
}; /* button_context_list */
59+
60+
const struct button_mapping* target_get_context_mapping(int context)
61+
{
62+
switch (context)
63+
{
64+
default:
65+
case CONTEXT_STD:
66+
return button_context_standard;
67+
case CONTEXT_WPS:
68+
return button_context_wps;
69+
case CONTEXT_TREE:
70+
case CONTEXT_CUSTOM|CONTEXT_TREE:
71+
case CONTEXT_MAINMENU:
72+
case CONTEXT_BOOKMARKSCREEN:
73+
//return button_context_tree;
74+
case CONTEXT_LIST:
75+
return button_context_list;
76+
}
77+
}

apps/lang/english.lang

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12204,21 +12204,160 @@
1220412204
es9018: "Bypass"
1220512205
</voice>
1220612206
</phrase>
12207+
<phrase>
12208+
id: LANG_FILTER_LINEAR_FAST
12209+
desc: in sound settings
12210+
user: core
12211+
<source>
12212+
*: none
12213+
es9218: "Linear Fast"
12214+
</source>
12215+
<dest>
12216+
*: none
12217+
es9218: "Linear Fast"
12218+
</dest>
12219+
<voice>
12220+
*: none
12221+
es9218: "Linear Fast"
12222+
</voice>
12223+
</phrase>
12224+
<phrase>
12225+
id: LANG_FILTER_LINEAR_SLOW
12226+
desc: in sound settings
12227+
user: core
12228+
<source>
12229+
*: none
12230+
es9218: "Linear Slow"
12231+
</source>
12232+
<dest>
12233+
*: none
12234+
es9218: "Linear Slow"
12235+
</dest>
12236+
<voice>
12237+
*: none
12238+
es9218: "Linear Slow"
12239+
</voice>
12240+
</phrase>
12241+
<phrase>
12242+
id: LANG_FILTER_MINIMUM_FAST
12243+
desc: in sound settings
12244+
user: core
12245+
<source>
12246+
*: none
12247+
es9218: "Minimum Fast"
12248+
</source>
12249+
<dest>
12250+
*: none
12251+
es9218: "Minimum Fast"
12252+
</dest>
12253+
<voice>
12254+
*: none
12255+
es9218: "Minimum Fast"
12256+
</voice>
12257+
</phrase>
12258+
<phrase>
12259+
id: LANG_FILTER_MINIMUM_SLOW
12260+
desc: in sound settings
12261+
user: core
12262+
<source>
12263+
*: none
12264+
es9218: "Minimum Slow"
12265+
</source>
12266+
<dest>
12267+
*: none
12268+
es9218: "Minimum Slow"
12269+
</dest>
12270+
<voice>
12271+
*: none
12272+
es9218: "Minimum Slow"
12273+
</voice>
12274+
</phrase>
12275+
<phrase>
12276+
id: LANG_FILTER_APODIZING_1
12277+
desc: in sound settings
12278+
user: core
12279+
<source>
12280+
*: none
12281+
es9218: "Apodizing type 1"
12282+
</source>
12283+
<dest>
12284+
*: none
12285+
es9218: "Apodizing type 1"
12286+
</dest>
12287+
<voice>
12288+
*: none
12289+
es9218: "Apodizing type 1"
12290+
</voice>
12291+
</phrase>
12292+
<phrase>
12293+
id: LANG_FILTER_APODIZING_2
12294+
desc: in sound settings
12295+
user: core
12296+
<source>
12297+
*: none
12298+
es9218: "Apodizing type 2"
12299+
</source>
12300+
<dest>
12301+
*: none
12302+
es9218: "Apodizing type 2"
12303+
</dest>
12304+
<voice>
12305+
*: none
12306+
es9218: "Apodizing type 2"
12307+
</voice>
12308+
</phrase>
12309+
<phrase>
12310+
id: LANG_FILTER_HYBRID_FAST
12311+
desc: in sound settings
12312+
user: core
12313+
<source>
12314+
*: none
12315+
es9218: "Hybrid Fast"
12316+
</source>
12317+
<dest>
12318+
*: none
12319+
es9218: "Hybrid Fast"
12320+
</dest>
12321+
<voice>
12322+
*: none
12323+
es9218: "Hybrid Fast"
12324+
</voice>
12325+
</phrase>
12326+
<phrase>
12327+
id: LANG_FILTER_BRICK_WALL
12328+
desc: in sound settings
12329+
user: core
12330+
<source>
12331+
*: none
12332+
es9218: "Brick Wall"
12333+
</source>
12334+
<dest>
12335+
*: none
12336+
es9218: "Brick Wall"
12337+
</dest>
12338+
<voice>
12339+
*: none
12340+
es9218: "Brick Wall"
12341+
</voice>
12342+
</phrase>
1220712343
<phrase>
1220812344
id: LANG_DAC_POWER_MODE
1220912345
desc: in sound settings
1221012346
user: core
1221112347
<source>
1221212348
*: none
1221312349
dac_power_mode: "DAC's power mode"
12350+
es9218: "DAC's output level"
1221412351
</source>
1221512352
<dest>
1221612353
*: none
1221712354
dac_power_mode: "DAC's power mode"
12355+
es9218: "DAC's output level"
1221812356
</dest>
1221912357
<voice>
1222012358
*: none
1222112359
dac_power_mode: "DAC's power mode"
12360+
es9218: "DAC's output level"
1222212361
</voice>
1222312362
</phrase>
1222412363
<phrase>
@@ -12228,14 +12367,17 @@
1222812367
<source>
1222912368
*: none
1223012369
dac_power_mode: "High performance"
12370+
es9218: "High Gain (2 Vrms)"
1223112371
</source>
1223212372
<dest>
1223312373
*: none
1223412374
dac_power_mode: "High performance"
12375+
es9218: "High Gain (2 Vrms)"
1223512376
</dest>
1223612377
<voice>
1223712378
*: none
1223812379
dac_power_mode: "High performance"
12380+
es9218: "High Gain (2 Vrms)"
1223912381
</voice>
1224012382
</phrase>
1224112383
<phrase>
@@ -12245,14 +12387,17 @@
1224512387
<source>
1224612388
*: none
1224712389
dac_power_mode: "Save battery"
12390+
es9218: "Low Gain (1 Vrms)"
1224812391
</source>
1224912392
<dest>
1225012393
*: none
1225112394
dac_power_mode: "Save battery"
12395+
es9218: "Low Gain (1 Vrms)"
1225212396
</dest>
1225312397
<voice>
1225412398
*: none
1225512399
dac_power_mode: "Save battery"
12400+
es9218: "Low Gain (1 Vrms)"
1225612401
</voice>
1225712402
</phrase>
1225812403
<phrase>

apps/plugins/battery_bench.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@
234234
#define BATTERY_ON_TXT "Play"
235235
#define BATTERY_OFF_TXT "Power"
236236

237+
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
238+
/* use touchscreen */
239+
237240
#else
238241
#error "No keymap defined!"
239242
#endif

apps/plugins/bitmaps/mono/SOURCES

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ bubbles_bubble.138x110x1.bmp
1919
((LCD_WIDTH == 176) && (LCD_HEIGHT == 220))
2020
bubbles_bubble.220x176x1.bmp
2121
#elif ((LCD_WIDTH == 320) && (LCD_HEIGHT == 240)) || \
22-
((LCD_WIDTH == 240) && (LCD_HEIGHT >= 320))
22+
((LCD_WIDTH == 240) && (LCD_HEIGHT >= 320)) || \
23+
((LCD_WIDTH == 360) && (LCD_HEIGHT == 400))
2324
bubbles_bubble.320x240x1.bmp
2425
#elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \
2526
((LCD_WIDTH == 480) && (LCD_HEIGHT == 640))

apps/plugins/bitmaps/native/SOURCES

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ jackpot_slots.30x420x1.bmp
158158
((LCD_WIDTH >= 480) && (LCD_HEIGHT >= 640))
159159
bubbles_emblem.640x480x16.bmp
160160
bubbles_background.640x480x16.bmp
161+
#elif (LCD_WIDTH >= 360) && (LCD_HEIGHT >= 400)
162+
bubbles_emblem.360x400x16.bmp
163+
bubbles_background.360x400x16.bmp
161164
#elif (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240)
162165
bubbles_emblem.320x240x16.bmp
163166
bubbles_background.320x240x16.bmp
@@ -388,7 +391,9 @@ invadrox_shield.22x16x16.bmp
388391
invadrox_ufo.16x7x16.bmp
389392
invadrox_ufo_explode.21x8x16.bmp
390393
invadrox_numbers.50x7x16.bmp
391-
#if LCD_WIDTH == 320
394+
#if LCD_WIDTH == 360 && LCD_HEIGHT == 400
395+
invadrox_background.360x400x16.bmp
396+
#elif LCD_WIDTH == 320
392397
invadrox_background.320x240x16.bmp
393398
#elif LCD_WIDTH == 240
394399
invadrox_background.240x320x16.bmp
@@ -457,6 +462,8 @@ jewels.220x176x16.bmp
457462
jewels.320x240x16.bmp
458463
#elif (LCD_WIDTH == 320) && (LCD_HEIGHT == 240)
459464
jewels.320x240x16.bmp
465+
#elif (LCD_WIDTH == 360) && (LCD_HEIGHT == 400)
466+
jewels.360x400x16.bmp
460467
#elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \
461468
((LCD_WIDTH == 480) && (LCD_HEIGHT == 640))
462469
jewels.640x480x16.bmp
@@ -546,6 +553,8 @@ puzzles_cursor.11x16x24.bmp
546553
#if LCD_DEPTH >= 16 /* colour versions*/
547554
#if (LCD_WIDTH == 640) && (LCD_HEIGHT == 480)
548555
rockblox_background.640x480x16.bmp
556+
#elif (LCD_WIDTH == 360) && (LCD_HEIGHT == 400)
557+
rockblox_background.360x400x16.bmp
549558
#elif (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240)
550559
rockblox_background.320x240x16.bmp
551560
#elif (LCD_WIDTH == 240) && (LCD_HEIGHT >= 320)
@@ -603,6 +612,12 @@ snake2_header2.640x480x16.bmp
603612
snake2_left.640x480x16.bmp
604613
snake2_right.640x480x16.bmp
605614
snake2_bottom.640x480x16.bmp
615+
#elif (LCD_WIDTH >= 360) && (LCD_HEIGHT >= 400) && (LCD_DEPTH >= 16)
616+
snake2_header1.360x400x16.bmp
617+
snake2_header2.360x400x16.bmp
618+
snake2_left.360x400x16.bmp
619+
snake2_right.360x400x16.bmp
620+
snake2_bottom.360x400x16.bmp
606621
#elif (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) && (LCD_DEPTH >= 16)
607622
snake2_header1.320x240x16.bmp
608623
snake2_header2.320x240x16.bmp
@@ -874,7 +889,8 @@ superdom_boarditems.176x132x16.bmp
874889
#elif (LCD_WIDTH == 320 && LCD_HEIGHT == 240)
875890
superdom_boarditems.320x240x16.bmp
876891
#elif ((LCD_WIDTH == 240) && (LCD_HEIGHT == 320)) || \
877-
((LCD_WIDTH == 240) && (LCD_HEIGHT == 400))
892+
((LCD_WIDTH == 240) && (LCD_HEIGHT == 400)) || \
893+
((LCD_WIDTH == 360) && (LCD_HEIGHT == 400))
878894
superdom_boarditems.240x320x16.bmp
879895
#elif (LCD_WIDTH == 480 && LCD_HEIGHT == 640)
880896
superdom_boarditems.480x640x16.bmp
@@ -911,6 +927,8 @@ sliding_puzzle.132x132x16.bmp
911927
sliding_puzzle.176x176x16.bmp
912928
#elif SMALLER_DIMENSION <= 240
913929
sliding_puzzle.240x240x16.bmp
930+
#elif SMALLER_DIMENSION <= 360
931+
sliding_puzzle.360x360x16.bmp
914932
#elif SMALLER_DIMENSION <= 480
915933
sliding_puzzle.480x480x16.bmp
916934
#endif
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)