mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-04-11 16:37:45 -04:00
Rockbox for the HiBy R3 Pro II/R1
Original author Melissa Autumn (https://codeberg.org/oopsallnaps/rockbox-hibyos) with contributions from Marc Aarts. Adaptation to Rockbox standards by Marc Aarts Change-Id: I09e5af7ba0a75c648e4b9fd424badc2d3665c943
This commit is contained in:
parent
eee6c31b4a
commit
1183b1ab1b
118 changed files with 2858 additions and 107 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -8,6 +8,8 @@
|
||||||
*.o
|
*.o
|
||||||
*.a
|
*.a
|
||||||
*~
|
*~
|
||||||
|
.cache
|
||||||
|
|
||||||
__pycache__
|
__pycache__
|
||||||
.DS_STORE
|
.DS_STORE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -310,4 +310,6 @@ keymaps/keymap-surfansf28.c
|
||||||
keymaps/keymap-rgnano.c
|
keymaps/keymap-rgnano.c
|
||||||
#elif CONFIG_KEYPAD == CTRU_PAD
|
#elif CONFIG_KEYPAD == CTRU_PAD
|
||||||
keymaps/keymap-ctru.c
|
keymaps/keymap-ctru.c
|
||||||
|
#elif CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
|
keymaps/keymap-hibyr3proii.c
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ toolsicon.130x130x16.bmp
|
||||||
hibyicon.70x70x16.bmp
|
hibyicon.70x70x16.bmp
|
||||||
rockboxicon.70x70x16.bmp
|
rockboxicon.70x70x16.bmp
|
||||||
toolsicon.70x70x16.bmp
|
toolsicon.70x70x16.bmp
|
||||||
#elif (defined(XDUOO_X3II) || defined(XDUOO_X20) || defined(EROS_Q) || defined(SURFANS_F28))
|
#elif (defined(XDUOO_X3II) || defined(XDUOO_X20) || defined(EROS_Q) || defined(SURFANS_F28) || defined(HIBY_R3PROII) || defined(HIBY_R1))
|
||||||
hibyicon.130x130x16.bmp
|
hibyicon.130x130x16.bmp
|
||||||
rockboxicon.130x130x16.bmp
|
rockboxicon.130x130x16.bmp
|
||||||
toolsicon.130x130x16.bmp
|
toolsicon.130x130x16.bmp
|
||||||
|
|
|
||||||
|
|
@ -2842,7 +2842,7 @@ static const struct {
|
||||||
{ "Screendump", dbg_screendump },
|
{ "Screendump", dbg_screendump },
|
||||||
#endif
|
#endif
|
||||||
{ "Skin Engine RAM usage", dbg_skin_engine },
|
{ "Skin Engine RAM usage", dbg_skin_engine },
|
||||||
#if ((CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX)) && !defined(SIMULATOR)
|
#if ((CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SONY_NWZ_LINUX) || (defined(HIBY_LINUX) && !defined(HIBY_R3PROII) && !defined(HIBY_R1)) || defined(FIIO_M3K_LINUX)) && !defined(SIMULATOR)
|
||||||
{ "View HW info", dbg_hw_info },
|
{ "View HW info", dbg_hw_info },
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,10 @@ alarm
|
||||||
backlight_brightness
|
backlight_brightness
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_GENERAL_PURPOSE_LED)
|
||||||
|
general_purpose_led
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_BUTTON_LIGHT)
|
#if defined(HAVE_BUTTON_LIGHT)
|
||||||
button_light
|
button_light
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -182,7 +186,7 @@ depth_3d
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This should be AUDIOHW_HAVE_FILTER_ROLL_OFF but that is only defined later */
|
/* This should be AUDIOHW_HAVE_FILTER_ROLL_OFF but that is only defined later */
|
||||||
#if defined(DX50) || defined(HAVE_DF1704_CODEC) || defined(HAVE_PCM1792_CODEC) || defined(HAVE_CS4398) || defined(HAVE_WM8740) || defined(HAVE_ES9018)|| defined(HAVE_EROS_QN_CODEC) || defined(HAVE_XDUOO_LINUX_CODEC) || defined(HAVE_FIIO_LINUX_CODEC) || defined(HAVE_AK4376) || defined(HAVE_ES9218) || defined(HAVE_SURFANS_LINUX_CODEC)
|
#if defined(DX50) || defined(HAVE_DF1704_CODEC) || defined(HAVE_PCM1792_CODEC) || defined(HAVE_CS4398) || defined(HAVE_WM8740) || defined(HAVE_ES9018)|| defined(HAVE_EROS_QN_CODEC) || defined(HAVE_XDUOO_LINUX_CODEC) || defined(HAVE_FIIO_LINUX_CODEC) || defined(HAVE_AK4376) || defined(HAVE_ES9218) || defined(HAVE_SURFANS_LINUX_CODEC) || defined(HAVE_HIBY_LINUX_CODEC)
|
||||||
filter_roll_off
|
filter_roll_off
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
233
apps/keymaps/keymap-hibyr3proii.c
Normal file
233
apps/keymaps/keymap-hibyr3proii.c
Normal file
|
|
@ -0,0 +1,233 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 Solomon Peachy
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "action.h"
|
||||||
|
#include "button.h"
|
||||||
|
#include "settings.h"
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_standard[] =
|
||||||
|
{
|
||||||
|
{ ACTION_STD_PREV, BUTTON_PREV, BUTTON_NONE },
|
||||||
|
{ ACTION_STD_PREVREPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_STD_NEXT, BUTTON_NEXT, BUTTON_NONE },
|
||||||
|
{ ACTION_STD_NEXTREPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
|
||||||
|
{ ACTION_STD_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
|
||||||
|
{ ACTION_STD_CANCEL, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
|
||||||
|
|
||||||
|
{ ACTION_STD_KEYLOCK, BUTTON_POWER|BUTTON_VOL_UP, BUTTON_POWER },
|
||||||
|
|
||||||
|
LAST_ITEM_IN_LIST
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_wps[] =
|
||||||
|
{
|
||||||
|
{ ACTION_WPS_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
|
||||||
|
{ ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
|
||||||
|
{ ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_NONE },
|
||||||
|
{ ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_NONE },
|
||||||
|
{ ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_WPS_SKIPNEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
|
||||||
|
{ ACTION_WPS_SKIPPREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
|
||||||
|
{ ACTION_WPS_SEEKFWD, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_WPS_STOPSEEK, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT|BUTTON_REPEAT },
|
||||||
|
{ ACTION_WPS_SEEKBACK, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_WPS_STOPSEEK, BUTTON_PREV|BUTTON_REL, BUTTON_PREV|BUTTON_REPEAT },
|
||||||
|
|
||||||
|
{ ACTION_STD_KEYLOCK, BUTTON_POWER|BUTTON_VOL_UP, BUTTON_POWER },
|
||||||
|
|
||||||
|
LAST_ITEM_IN_LIST
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_list[] =
|
||||||
|
{
|
||||||
|
{ ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_NONE },
|
||||||
|
{ ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_NONE },
|
||||||
|
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_tree[] =
|
||||||
|
{
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_listtree_scroll_with_combo[] =
|
||||||
|
{
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM | CONTEXT_TREE),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_listtree_scroll_without_combo[] =
|
||||||
|
{
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM | CONTEXT_TREE),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_settings[] =
|
||||||
|
{
|
||||||
|
{ ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE },
|
||||||
|
{ ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||||
|
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_settings_right_is_inc[] =
|
||||||
|
{
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_mainmenu[] =
|
||||||
|
{
|
||||||
|
{ ACTION_TREE_WPS, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
|
||||||
|
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_TREE),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_yesno[] =
|
||||||
|
{
|
||||||
|
{ ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE },
|
||||||
|
{ ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
|
||||||
|
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_colorchooser[] =
|
||||||
|
{
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_eq[] =
|
||||||
|
{
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_keyboard[] =
|
||||||
|
{
|
||||||
|
{ ACTION_KBD_LEFT, BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||||
|
{ ACTION_KBD_RIGHT, BUTTON_VOL_UP, BUTTON_NONE },
|
||||||
|
{ ACTION_KBD_CURSOR_LEFT, BUTTON_PLAY | BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||||
|
{ ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY | BUTTON_VOL_UP, BUTTON_NONE },
|
||||||
|
{ ACTION_KBD_DONE, BUTTON_PLAY | BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_KBD_SELECT, BUTTON_PLAY | BUTTON_REL, BUTTON_NONE },
|
||||||
|
{ ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE },
|
||||||
|
{ ACTION_KBD_UP, BUTTON_NEXT, BUTTON_NONE },
|
||||||
|
{ ACTION_KBD_UP, BUTTON_NEXT | BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_KBD_DOWN, BUTTON_PREV, BUTTON_NONE },
|
||||||
|
{ ACTION_KBD_DOWN, BUTTON_PREV | BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
|
||||||
|
LAST_ITEM_IN_LIST
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_bmark[] =
|
||||||
|
{
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_time[] =
|
||||||
|
{
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_quickscreen[] =
|
||||||
|
{
|
||||||
|
{ ACTION_QS_TOP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_NONE },
|
||||||
|
{ ACTION_QS_TOP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_QS_DOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_NONE },
|
||||||
|
{ ACTION_QS_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_QS_LEFT, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
|
||||||
|
{ ACTION_QS_LEFT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
{ ACTION_QS_RIGHT, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE },
|
||||||
|
{ ACTION_QS_RIGHT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_pitchscreen[] =
|
||||||
|
{
|
||||||
|
{ ACTION_PS_INC_SMALL, BUTTON_VOL_UP, BUTTON_NONE },
|
||||||
|
{ ACTION_PS_DEC_SMALL, BUTTON_VOL_DOWN, BUTTON_NONE },
|
||||||
|
{ ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE },
|
||||||
|
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const struct button_mapping button_context_radio[] =
|
||||||
|
{
|
||||||
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const struct button_mapping* target_get_context_mapping(int context)
|
||||||
|
{
|
||||||
|
switch (context & ~CONTEXT_LOCKED)
|
||||||
|
{
|
||||||
|
case CONTEXT_STD: { return button_context_standard; }
|
||||||
|
case CONTEXT_WPS: { return button_context_wps; }
|
||||||
|
case CONTEXT_LIST: { return button_context_list; }
|
||||||
|
case CONTEXT_MAINMENU: { return button_context_mainmenu; }
|
||||||
|
case CONTEXT_CUSTOM | CONTEXT_TREE: { return button_context_tree; }
|
||||||
|
case CONTEXT_SETTINGS: { return button_context_settings; }
|
||||||
|
case CONTEXT_SETTINGS_COLOURCHOOSER: { return button_context_colorchooser; }
|
||||||
|
case CONTEXT_SETTINGS_EQ: { return button_context_eq; }
|
||||||
|
case CONTEXT_SETTINGS_TIME: { return button_context_time; }
|
||||||
|
case CONTEXT_YESNOSCREEN: { return button_context_yesno; }
|
||||||
|
case CONTEXT_KEYBOARD: { return button_context_keyboard; }
|
||||||
|
case CONTEXT_FM: { return button_context_radio; }
|
||||||
|
case CONTEXT_BOOKMARKSCREEN: { return button_context_bmark; }
|
||||||
|
case CONTEXT_QUICKSCREEN: { return button_context_quickscreen; }
|
||||||
|
case CONTEXT_PITCHSCREEN: { return button_context_pitchscreen; }
|
||||||
|
case CONTEXT_CUSTOM | CONTEXT_SETTINGS:
|
||||||
|
case CONTEXT_SETTINGS_RECTRIGGER: { return button_context_settings_right_is_inc; }
|
||||||
|
case CONTEXT_TREE:
|
||||||
|
{
|
||||||
|
if(global_settings.hold_lr_for_scroll_in_list)
|
||||||
|
{
|
||||||
|
return button_context_listtree_scroll_without_combo;
|
||||||
|
}
|
||||||
|
return button_context_listtree_scroll_with_combo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return button_context_standard;
|
||||||
|
}
|
||||||
|
|
@ -16998,3 +16998,20 @@
|
||||||
*: "sort playlists"
|
*: "sort playlists"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
id: LANG_USE_LED_INDICATORS
|
||||||
|
desc: LED indicators setting
|
||||||
|
user: core
|
||||||
|
<source>
|
||||||
|
*: none
|
||||||
|
general_purpose_led: "Use LED indicators"
|
||||||
|
</source>
|
||||||
|
<dest>
|
||||||
|
*: none
|
||||||
|
general_purpose_led: "Use LED indicators"
|
||||||
|
</dest>
|
||||||
|
<voice>
|
||||||
|
*: none
|
||||||
|
general_purpose_led: "Use LED indicators"
|
||||||
|
</voice>
|
||||||
|
</phrase>
|
||||||
|
|
|
||||||
|
|
@ -272,6 +272,9 @@ MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, Icon_NOICON,
|
||||||
#if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR))
|
#if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR))
|
||||||
MENUITEM_SETTING(usb_mode, &global_settings.usb_mode, NULL);
|
MENUITEM_SETTING(usb_mode, &global_settings.usb_mode, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_GENERAL_PURPOSE_LED)
|
||||||
|
MENUITEM_SETTING(use_led_indicators, &global_settings.use_led_indicators, NULL);
|
||||||
|
#endif
|
||||||
/* Disk */
|
/* Disk */
|
||||||
#ifdef HAVE_DISK_STORAGE
|
#ifdef HAVE_DISK_STORAGE
|
||||||
MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL);
|
MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL);
|
||||||
|
|
@ -469,6 +472,9 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
|
||||||
#endif
|
#endif
|
||||||
#if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR))
|
#if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR))
|
||||||
&usb_mode,
|
&usb_mode,
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_GENERAL_PURPOSE_LED)
|
||||||
|
&use_led_indicators,
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#if !defined(HAVE_TOUCHSCREEN) || defined(DX50) || defined(DX90)
|
#if !defined(HAVE_TOUCHSCREEN) || defined(DX50) || defined(DX90) || defined(HIBY_R3PROII) || defined(HIBY_R1)
|
||||||
/* In devices running RockBox as an application, but having a keypad */
|
/* In devices running RockBox as an application, but having a keypad */
|
||||||
#include "SOURCES"
|
#include "SOURCES"
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#if !defined(HAVE_TOUCHSCREEN) || defined(DX50) || defined(DX90)
|
#if !defined(HAVE_TOUCHSCREEN) || defined(DX50) || defined(DX90) || defined(HIBY_R3PROII) || defined(HIBY_R1)
|
||||||
/* This is for devices having a keypad, running RockBox as an application */
|
/* This is for devices having a keypad, running RockBox as an application */
|
||||||
#include "SUBDIRS"
|
#include "SUBDIRS"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ struct battery_tables_t {
|
||||||
#define BATTERY_ON_TXT "Play"
|
#define BATTERY_ON_TXT "Play"
|
||||||
#define BATTERY_OFF_TXT "Power"
|
#define BATTERY_OFF_TXT "Power"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ bubbles_bubble.220x176x1.bmp
|
||||||
((LCD_WIDTH == 360) && (LCD_HEIGHT == 400))
|
((LCD_WIDTH == 360) && (LCD_HEIGHT == 400))
|
||||||
bubbles_bubble.320x240x1.bmp
|
bubbles_bubble.320x240x1.bmp
|
||||||
#elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \
|
#elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \
|
||||||
((LCD_WIDTH == 480) && (LCD_HEIGHT == 640))
|
((LCD_WIDTH == 480) && (LCD_HEIGHT >= 640))
|
||||||
bubbles_bubble.640x480x1.bmp
|
bubbles_bubble.640x480x1.bmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -436,7 +436,9 @@ invadrox_shield.22x16x16.bmp
|
||||||
invadrox_ufo.16x7x16.bmp
|
invadrox_ufo.16x7x16.bmp
|
||||||
invadrox_ufo_explode.21x8x16.bmp
|
invadrox_ufo_explode.21x8x16.bmp
|
||||||
invadrox_numbers.50x7x16.bmp
|
invadrox_numbers.50x7x16.bmp
|
||||||
#if LCD_WIDTH == 360 && LCD_HEIGHT == 400
|
#if LCD_WIDTH == 480
|
||||||
|
invadrox_background.480x640x16.bmp
|
||||||
|
#elif LCD_WIDTH == 360 && LCD_HEIGHT == 400
|
||||||
invadrox_background.360x400x16.bmp
|
invadrox_background.360x400x16.bmp
|
||||||
#elif LCD_WIDTH == 320
|
#elif LCD_WIDTH == 320
|
||||||
invadrox_background.320x240x16.bmp
|
invadrox_background.320x240x16.bmp
|
||||||
|
|
@ -513,8 +515,8 @@ jewels.320x240x16.bmp
|
||||||
jewels.320x240x16.bmp
|
jewels.320x240x16.bmp
|
||||||
#elif (LCD_WIDTH == 360) && (LCD_HEIGHT == 400)
|
#elif (LCD_WIDTH == 360) && (LCD_HEIGHT == 400)
|
||||||
jewels.360x400x16.bmp
|
jewels.360x400x16.bmp
|
||||||
#elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \
|
#elif ((LCD_WIDTH >= 480) && (LCD_HEIGHT >= 640)) || \
|
||||||
((LCD_WIDTH == 480) && (LCD_HEIGHT == 640))
|
((LCD_WIDTH >= 640) && (LCD_HEIGHT >= 480))
|
||||||
jewels.640x480x16.bmp
|
jewels.640x480x16.bmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -947,9 +949,9 @@ superdom_boarditems.320x240x16.bmp
|
||||||
((LCD_WIDTH == 240) && (LCD_HEIGHT == 400)) || \
|
((LCD_WIDTH == 240) && (LCD_HEIGHT == 400)) || \
|
||||||
((LCD_WIDTH == 360) && (LCD_HEIGHT == 400))
|
((LCD_WIDTH == 360) && (LCD_HEIGHT == 400))
|
||||||
superdom_boarditems.240x320x16.bmp
|
superdom_boarditems.240x320x16.bmp
|
||||||
#elif (LCD_WIDTH == 480 && LCD_HEIGHT == 640)
|
#elif (LCD_WIDTH >= 480 && LCD_HEIGHT >= 640)
|
||||||
superdom_boarditems.480x640x16.bmp
|
superdom_boarditems.480x640x16.bmp
|
||||||
#elif (LCD_WIDTH == 640 && LCD_HEIGHT == 480)
|
#elif (LCD_WIDTH >= 640 && LCD_HEIGHT >= 480)
|
||||||
superdom_boarditems.640x480x16.bmp
|
superdom_boarditems.640x480x16.bmp
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -984,7 +986,7 @@ sliding_puzzle.176x176x16.bmp
|
||||||
sliding_puzzle.240x240x16.bmp
|
sliding_puzzle.240x240x16.bmp
|
||||||
#elif SMALLER_DIMENSION <= 360
|
#elif SMALLER_DIMENSION <= 360
|
||||||
sliding_puzzle.360x360x16.bmp
|
sliding_puzzle.360x360x16.bmp
|
||||||
#elif SMALLER_DIMENSION <= 480
|
#else
|
||||||
sliding_puzzle.480x480x16.bmp
|
sliding_puzzle.480x480x16.bmp
|
||||||
#endif
|
#endif
|
||||||
#elif (LCD_DEPTH > 1)
|
#elif (LCD_DEPTH > 1)
|
||||||
|
|
|
||||||
|
|
@ -608,7 +608,7 @@ enum {
|
||||||
#define BJACK_LEFT BUTTON_LEFT
|
#define BJACK_LEFT BUTTON_LEFT
|
||||||
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define BJACK_QUIT BUTTON_POWER
|
#define BJACK_QUIT BUTTON_POWER
|
||||||
#define BJACK_QUIT_NAME "QUIT"
|
#define BJACK_QUIT_NAME "QUIT"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -362,7 +362,7 @@ CONFIG_KEYPAD == SANSA_M200_PAD
|
||||||
#define UP BUTTON_UP
|
#define UP BUTTON_UP
|
||||||
#define DOWN BUTTON_DOWN
|
#define DOWN BUTTON_DOWN
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define QUIT BUTTON_POWER
|
#define QUIT BUTTON_POWER
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ enum {
|
||||||
#define NEXT_BB_WIDTH 32
|
#define NEXT_BB_WIDTH 32
|
||||||
#define NEXT_BB_Y 402
|
#define NEXT_BB_Y 402
|
||||||
|
|
||||||
#elif (LCD_WIDTH == 480) && (LCD_HEIGHT == 640)
|
#elif (LCD_WIDTH == 480) && (LCD_HEIGHT >= 640)
|
||||||
#define XOFS 128
|
#define XOFS 128
|
||||||
#define MAX_FPS 40
|
#define MAX_FPS 40
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -533,7 +533,7 @@ F3: equal to "="
|
||||||
#define CALCULATOR_CALC BUTTON_MENU
|
#define CALCULATOR_CALC BUTTON_MENU
|
||||||
#define CALCULATOR_CLEAR BUTTON_BACK
|
#define CALCULATOR_CLEAR BUTTON_BACK
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define CALCULATOR_QUIT BUTTON_POWER
|
#define CALCULATOR_QUIT BUTTON_POWER
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -419,7 +419,7 @@
|
||||||
#define CALENDAR_NEXT_MONTH BUTTON_VOL_UP
|
#define CALENDAR_NEXT_MONTH BUTTON_VOL_UP
|
||||||
#define CALENDAR_PREV_MONTH BUTTON_VOL_DOWN
|
#define CALENDAR_PREV_MONTH BUTTON_VOL_DOWN
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -581,7 +581,7 @@
|
||||||
#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
|
#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
|
||||||
#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
|
#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -395,7 +395,7 @@
|
||||||
#define CHC_SETTINGS_OK BUTTON_SELECT
|
#define CHC_SETTINGS_OK BUTTON_SELECT
|
||||||
#define CHC_SETTINGS_CANCEL BUTTON_POWER
|
#define CHC_SETTINGS_CANCEL BUTTON_POWER
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define CHC_QUIT BUTTON_POWER
|
#define CHC_QUIT BUTTON_POWER
|
||||||
|
|
||||||
#elif (CONFIG_KEYPAD == MA_PAD)
|
#elif (CONFIG_KEYPAD == MA_PAD)
|
||||||
|
|
|
||||||
|
|
@ -1312,7 +1312,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
#define CHIP8_KEY9 BUTTON_R
|
#define CHIP8_KEY9 BUTTON_R
|
||||||
#define CHIP8_KEY0 BUTTON_L
|
#define CHIP8_KEY0 BUTTON_L
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -314,7 +314,7 @@
|
||||||
#define CLIX_BUTTON_RIGHT BUTTON_RIGHT
|
#define CLIX_BUTTON_RIGHT BUTTON_RIGHT
|
||||||
#define CLIX_BUTTON_CLICK BUTTON_SELECT
|
#define CLIX_BUTTON_CLICK BUTTON_SELECT
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define CLIX_BUTTON_QUIT BUTTON_POWER
|
#define CLIX_BUTTON_QUIT BUTTON_POWER
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -402,7 +402,7 @@
|
||||||
#define CUBE_PAUSE BUTTON_PLAY
|
#define CUBE_PAUSE BUTTON_PLAY
|
||||||
#define CUBE_HIGHSPEED BUTTON_BACK
|
#define CUBE_HIGHSPEED BUTTON_BACK
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -629,7 +629,7 @@ void I_ShutdownGraphics(void)
|
||||||
#define DOOMBUTTON_WEAPON BUTTON_BACK
|
#define DOOMBUTTON_WEAPON BUTTON_BACK
|
||||||
#define DOOMBUTTON_MAP (BUTTON_BACK|BUTTON_REPEAT)
|
#define DOOMBUTTON_MAP (BUTTON_BACK|BUTTON_REPEAT)
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define DOOMBUTTON_ESC BUTTON_POWER
|
#define DOOMBUTTON_ESC BUTTON_POWER
|
||||||
#define DOOMBUTTON_MAP BUTTON_PREV
|
#define DOOMBUTTON_MAP BUTTON_PREV
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -494,7 +494,7 @@
|
||||||
#define FLIPIT_STEP_BY_STEP BUTTON_VOL_UP
|
#define FLIPIT_STEP_BY_STEP BUTTON_VOL_UP
|
||||||
#define FLIPIT_TOGGLE BUTTON_SELECT
|
#define FLIPIT_TOGGLE BUTTON_SELECT
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -504,7 +504,7 @@
|
||||||
#define FRACTAL_PRECISION_DEC BUTTON_BACK
|
#define FRACTAL_PRECISION_DEC BUTTON_BACK
|
||||||
#define FRACTAL_RESET BUTTON_PLAY
|
#define FRACTAL_RESET BUTTON_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define FRACTAL_QUIT BUTTON_POWER
|
#define FRACTAL_QUIT BUTTON_POWER
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -557,7 +557,7 @@
|
||||||
#define IMGVIEW_MENU (BUTTON_PLAY|BUTTON_REPEAT)
|
#define IMGVIEW_MENU (BUTTON_PLAY|BUTTON_REPEAT)
|
||||||
#define IMGVIEW_SLIDE_SHOW BUTTON_PLAY
|
#define IMGVIEW_SLIDE_SHOW BUTTON_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
#define RIGHT BUTTON_RIGHT
|
#define RIGHT BUTTON_RIGHT
|
||||||
#define FIRE BUTTON_SELECT
|
#define FIRE BUTTON_SELECT
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
@ -369,7 +369,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
|
|
||||||
/* m:robe 500 defines */
|
/* m:robe 500 defines */
|
||||||
#if ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \
|
#if ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \
|
||||||
((LCD_WIDTH == 480) && (LCD_HEIGHT == 640))
|
((LCD_WIDTH == 480) && (LCD_HEIGHT >= 640))
|
||||||
|
|
||||||
/* Original arcade game size 224x240, 1bpp with
|
/* Original arcade game size 224x240, 1bpp with
|
||||||
* red overlay at top and green overlay at bottom.
|
* red overlay at top and green overlay at bottom.
|
||||||
|
|
|
||||||
|
|
@ -377,7 +377,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
#define HK_SELECT "SELECT"
|
#define HK_SELECT "SELECT"
|
||||||
#define HK_CANCEL "BACK"
|
#define HK_CANCEL "BACK"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,7 @@
|
||||||
#define BTN_FIRE BUTTON_SELECT
|
#define BTN_FIRE BUTTON_SELECT
|
||||||
#define BTN_PAUSE BUTTON_POWER
|
#define BTN_PAUSE BUTTON_POWER
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define BTN_FIRE BUTTON_CENTER
|
#define BTN_FIRE BUTTON_CENTER
|
||||||
#define BTN_PAUSE BUTTON_POWER
|
#define BTN_PAUSE BUTTON_POWER
|
||||||
#define BTN_HAVE_DIAGONAL
|
#define BTN_HAVE_DIAGONAL
|
||||||
|
|
@ -298,7 +298,8 @@
|
||||||
(CONFIG_KEYPAD != DX50_PAD) && \
|
(CONFIG_KEYPAD != DX50_PAD) && \
|
||||||
(CONFIG_KEYPAD != ONDAVX777_PAD) && \
|
(CONFIG_KEYPAD != ONDAVX777_PAD) && \
|
||||||
(CONFIG_KEYPAD != CREATIVE_ZENXFI2_PAD) && \
|
(CONFIG_KEYPAD != CREATIVE_ZENXFI2_PAD) && \
|
||||||
(CONFIG_KEYPAD != SHANLING_Q1_PAD)
|
(CONFIG_KEYPAD != SHANLING_Q1_PAD) && \
|
||||||
|
(CONFIG_KEYPAD != HIBY_R3PROII_PAD)
|
||||||
#define BTN_FIRE BUTTON_BOTTOMLEFT
|
#define BTN_FIRE BUTTON_BOTTOMLEFT
|
||||||
#define BTN_PAUSE BUTTON_TOPLEFT
|
#define BTN_PAUSE BUTTON_TOPLEFT
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -517,7 +517,7 @@ const struct button_mapping pla_main_ctx[] =
|
||||||
{PLA_SELECT, BUTTON_SELECT, BUTTON_NONE},
|
{PLA_SELECT, BUTTON_SELECT, BUTTON_NONE},
|
||||||
{PLA_SELECT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT},
|
{PLA_SELECT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT},
|
||||||
{PLA_SELECT_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
|
{PLA_SELECT_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
|
||||||
#elif (CONFIG_KEYPAD == SHANLING_Q1_PAD)
|
#elif (CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD)
|
||||||
{PLA_EXIT, BUTTON_POWER, BUTTON_NONE},
|
{PLA_EXIT, BUTTON_POWER, BUTTON_NONE},
|
||||||
#elif (CONFIG_KEYPAD == MA_PAD)
|
#elif (CONFIG_KEYPAD == MA_PAD)
|
||||||
{PLA_CANCEL, BUTTON_BACK|BUTTON_REL, BUTTON_BACK},
|
{PLA_CANCEL, BUTTON_BACK|BUTTON_REL, BUTTON_BACK},
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@
|
||||||
#define MIDI_VOL_DOWN BUTTON_VOL_DOWN
|
#define MIDI_VOL_DOWN BUTTON_VOL_DOWN
|
||||||
#define MIDI_PLAYPAUSE BUTTON_PLAY
|
#define MIDI_PLAYPAUSE BUTTON_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -452,7 +452,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
# define MINESWP_DISCOVER (BUTTON_MENU|BUTTON_REPEAT)
|
# define MINESWP_DISCOVER (BUTTON_MENU|BUTTON_REPEAT)
|
||||||
# define MINESWP_INFO BUTTON_MENU
|
# define MINESWP_INFO BUTTON_MENU
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
||||||
|
|
|
||||||
|
|
@ -2583,7 +2583,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
#define MP3ENC_DONE BUTTON_POWER
|
#define MP3ENC_DONE BUTTON_POWER
|
||||||
#define MP3ENC_SELECT BUTTON_SELECT
|
#define MP3ENC_SELECT BUTTON_SELECT
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -362,7 +362,7 @@ struct mpeg_settings settings;
|
||||||
#define MPEG_START_TIME_DOWN BUTTON_DOWN
|
#define MPEG_START_TIME_DOWN BUTTON_DOWN
|
||||||
#define MPEG_START_TIME_EXIT BUTTON_BACK
|
#define MPEG_START_TIME_EXIT BUTTON_BACK
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define MPEG_START_TIME_EXIT BUTTON_POWER
|
#define MPEG_START_TIME_EXIT BUTTON_POWER
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
||||||
|
|
|
||||||
|
|
@ -495,7 +495,7 @@ CONFIG_KEYPAD == SANSA_M200_PAD
|
||||||
#define MPEG_RW BUTTON_LEFT
|
#define MPEG_RW BUTTON_LEFT
|
||||||
#define MPEG_FF BUTTON_RIGHT
|
#define MPEG_FF BUTTON_RIGHT
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
||||||
|
|
|
||||||
|
|
@ -564,7 +564,7 @@
|
||||||
#define OSCILLOSCOPE_VOL_UP BUTTON_UP
|
#define OSCILLOSCOPE_VOL_UP BUTTON_UP
|
||||||
#define OSCILLOSCOPE_VOL_DOWN BUTTON_DOWN
|
#define OSCILLOSCOPE_VOL_DOWN BUTTON_DOWN
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
||||||
|
|
|
||||||
|
|
@ -398,7 +398,7 @@
|
||||||
#define PACMAN_1UP BUTTON_VOL_UP
|
#define PACMAN_1UP BUTTON_VOL_UP
|
||||||
#define PACMAN_COIN BUTTON_PLAY
|
#define PACMAN_COIN BUTTON_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define PACMAN_UP BUTTON_TOPMIDDLE
|
#define PACMAN_UP BUTTON_TOPMIDDLE
|
||||||
#define PACMAN_DOWN BUTTON_BOTTOMMIDDLE
|
#define PACMAN_DOWN BUTTON_BOTTOMMIDDLE
|
||||||
#define PACMAN_LEFT BUTTON_MIDLEFT
|
#define PACMAN_LEFT BUTTON_MIDLEFT
|
||||||
|
|
|
||||||
|
|
@ -728,7 +728,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
#define LVL_UP_TEXT "UP+MENU"
|
#define LVL_UP_TEXT "UP+MENU"
|
||||||
#define LVL_DOWN_TEXT "DOWN+MENU"
|
#define LVL_DOWN_TEXT "DOWN+MENU"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
#define PONG_RIGHT_UP BUTTON_BACK
|
#define PONG_RIGHT_UP BUTTON_BACK
|
||||||
#define PONG_RIGHT_DOWN BUTTON_RIGHT
|
#define PONG_RIGHT_DOWN BUTTON_RIGHT
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -361,7 +361,7 @@
|
||||||
#define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
|
#define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
|
||||||
#define REVERSI_BUTTON_MENU BUTTON_MENU
|
#define REVERSI_BUTTON_MENU BUTTON_MENU
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif (CONFIG_KEYPAD == MA_PAD)
|
#elif (CONFIG_KEYPAD == MA_PAD)
|
||||||
|
|
|
||||||
|
|
@ -468,7 +468,7 @@
|
||||||
#define ROCKBLOX_RESTART BUTTON_BACK
|
#define ROCKBLOX_RESTART BUTTON_BACK
|
||||||
#define ROCKBLOX_SCROLL_ENABLED 1
|
#define ROCKBLOX_SCROLL_ENABLED 1
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
@ -549,7 +549,7 @@
|
||||||
#define LEVEL_Y 140
|
#define LEVEL_Y 140
|
||||||
#define LINES_Y 210
|
#define LINES_Y 210
|
||||||
|
|
||||||
#elif (LCD_WIDTH == 480) && (LCD_HEIGHT == 640)
|
#elif (LCD_WIDTH == 480) && (LCD_HEIGHT >= 640)
|
||||||
|
|
||||||
#define BLOCK_WIDTH 30
|
#define BLOCK_WIDTH 30
|
||||||
#define BLOCK_HEIGHT 30
|
#define BLOCK_HEIGHT 30
|
||||||
|
|
|
||||||
|
|
@ -468,7 +468,7 @@ static void setoptions (void)
|
||||||
options.SELECT = BUTTON_VOL_UP;
|
options.SELECT = BUTTON_VOL_UP;
|
||||||
options.MENU = BUTTON_POWER;
|
options.MENU = BUTTON_POWER;
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -404,7 +404,7 @@
|
||||||
#define ROCKPAINT_LEFT BUTTON_LEFT
|
#define ROCKPAINT_LEFT BUTTON_LEFT
|
||||||
#define ROCKPAINT_RIGHT BUTTON_RIGHT
|
#define ROCKPAINT_RIGHT BUTTON_RIGHT
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == EROSQ_PAD
|
#elif CONFIG_KEYPAD == EROSQ_PAD
|
||||||
|
|
|
||||||
|
|
@ -357,7 +357,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
#define PUZZLE_SHUFFLE BUTTON_BACK
|
#define PUZZLE_SHUFFLE BUTTON_BACK
|
||||||
#define PUZZLE_PICTURE BUTTON_PLAY
|
#define PUZZLE_PICTURE BUTTON_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -313,7 +313,7 @@ dir is the current direction of the snake - 0=up, 1=right, 2=down, 3=left;
|
||||||
#define SNAKE_DOWN BUTTON_DOWN
|
#define SNAKE_DOWN BUTTON_DOWN
|
||||||
#define SNAKE_PLAYPAUSE BUTTON_PLAY
|
#define SNAKE_PLAYPAUSE BUTTON_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -458,7 +458,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
#define SNAKE2_PLAYPAUSE BUTTON_PLAY
|
#define SNAKE2_PLAYPAUSE BUTTON_PLAY
|
||||||
#define SNAKE2_PLAYPAUSE_TEXT "PLAY"
|
#define SNAKE2_PLAYPAUSE_TEXT "PLAY"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -696,7 +696,7 @@
|
||||||
#define BUTTON_SAVE BUTTON_BACK
|
#define BUTTON_SAVE BUTTON_BACK
|
||||||
#define BUTTON_SAVE_NAME "BACK"
|
#define BUTTON_SAVE_NAME "BACK"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -741,7 +741,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
# define HK_CUR2STACK "HOLD SELECT"
|
# define HK_CUR2STACK "HOLD SELECT"
|
||||||
# define HK_REM2STACK "VOL+"
|
# define HK_REM2STACK "VOL+"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
# define SOL_QUIT BUTTON_POWER
|
# define SOL_QUIT BUTTON_POWER
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
||||||
|
|
|
||||||
|
|
@ -372,7 +372,7 @@
|
||||||
#define AST_RIGHT BUTTON_RIGHT
|
#define AST_RIGHT BUTTON_RIGHT
|
||||||
#define AST_FIRE BUTTON_PLAY
|
#define AST_FIRE BUTTON_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -668,7 +668,7 @@
|
||||||
#define STAR_LEVEL_DOWN_NAME "VOL-"
|
#define STAR_LEVEL_DOWN_NAME "VOL-"
|
||||||
#define STAR_LEVEL_REPEAT_NAME "BACK"
|
#define STAR_LEVEL_REPEAT_NAME "BACK"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define STAR_QUIT BUTTON_POWER
|
#define STAR_QUIT BUTTON_POWER
|
||||||
#define STAR_QUIT_NAME "POWER"
|
#define STAR_QUIT_NAME "POWER"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -469,7 +469,7 @@
|
||||||
#define SUDOKU_BUTTON_TOGGLE BUTTON_PLAY
|
#define SUDOKU_BUTTON_TOGGLE BUTTON_PLAY
|
||||||
#define SUDOKU_BUTTON_POSSIBLE BUTTON_BACK
|
#define SUDOKU_BUTTON_POSSIBLE BUTTON_BACK
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
#elif CONFIG_KEYPAD == CREATIVE_ZENXFI2_PAD
|
#elif CONFIG_KEYPAD == CREATIVE_ZENXFI2_PAD
|
||||||
#define TOUCHSCREEN_QUIT BUTTON_POWER
|
#define TOUCHSCREEN_QUIT BUTTON_POWER
|
||||||
#define TOUCHSCREEN_TOGGLE BUTTON_MENU
|
#define TOUCHSCREEN_TOGGLE BUTTON_MENU
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define TOUCHSCREEN_QUIT BUTTON_POWER
|
#define TOUCHSCREEN_QUIT BUTTON_POWER
|
||||||
#define TOUCHSCREEN_TOGGLE BUTTON_PLAY
|
#define TOUCHSCREEN_TOGGLE BUTTON_PLAY
|
||||||
#elif (CONFIG_KEYPAD == ANDROID_PAD)
|
#elif (CONFIG_KEYPAD == ANDROID_PAD)
|
||||||
|
|
|
||||||
|
|
@ -572,7 +572,7 @@
|
||||||
#define TV_LINE_DOWN BUTTON_SCROLL_FWD
|
#define TV_LINE_DOWN BUTTON_SCROLL_FWD
|
||||||
#define TV_BOOKMARK BUTTON_PLAY
|
#define TV_BOOKMARK BUTTON_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
#define TV_BOOKMARK BUTTON_PLAY
|
#define TV_BOOKMARK BUTTON_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -454,7 +454,7 @@
|
||||||
#define LABEL_MENU "MENU"
|
#define LABEL_MENU "MENU"
|
||||||
#define LABEL_VOLUME "VOL+/VOL-"
|
#define LABEL_VOLUME "VOL+/VOL-"
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -407,7 +407,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
#define BTN_QUIT BUTTON_POWER
|
#define BTN_QUIT BUTTON_POWER
|
||||||
#define BTN_STOPRESET BUTTON_BACK
|
#define BTN_STOPRESET BUTTON_BACK
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
@ -522,7 +522,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
#define SPEED 4
|
#define SPEED 4
|
||||||
#define MAX_WORM_SEGMENTS 512
|
#define MAX_WORM_SEGMENTS 512
|
||||||
#elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \
|
#elif ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \
|
||||||
((LCD_WIDTH == 480) && (LCD_HEIGHT == 640))
|
((LCD_WIDTH == 480) && (LCD_HEIGHT >= 640))
|
||||||
#define FOOD_SIZE 14
|
#define FOOD_SIZE 14
|
||||||
#define ARGH_SIZE 16
|
#define ARGH_SIZE 16
|
||||||
#define SPEED 4
|
#define SPEED 4
|
||||||
|
|
|
||||||
|
|
@ -360,7 +360,7 @@ CONFIG_KEYPAD == MROBE500_PAD
|
||||||
#define DOWN BUTTON_DOWN
|
#define DOWN BUTTON_DOWN
|
||||||
#define PAUSE BUTTON_PLAY
|
#define PAUSE BUTTON_PLAY
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
#elif CONFIG_KEYPAD == RG_NANO_PAD
|
||||||
|
|
|
||||||
|
|
@ -290,7 +290,7 @@
|
||||||
#define ZX_UP BUTTON_UP
|
#define ZX_UP BUTTON_UP
|
||||||
#define ZX_DOWN BUTTON_DOWN
|
#define ZX_DOWN BUTTON_DOWN
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD
|
#elif CONFIG_KEYPAD == SHANLING_Q1_PAD || CONFIG_KEYPAD == HIBY_R3PROII_PAD
|
||||||
/* use touchscreen */
|
/* use touchscreen */
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MA_PAD
|
#elif CONFIG_KEYPAD == MA_PAD
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,9 @@
|
||||||
#include "statusbar-skinned.h"
|
#include "statusbar-skinned.h"
|
||||||
#include "bootchart.h"
|
#include "bootchart.h"
|
||||||
#include "scroll_engine.h"
|
#include "scroll_engine.h"
|
||||||
|
#ifdef HAVE_GENERAL_PURPOSE_LED
|
||||||
|
#include "led-general-purpose.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __PCTOOL__
|
#ifndef __PCTOOL__
|
||||||
struct user_settings global_settings;
|
struct user_settings global_settings;
|
||||||
|
|
@ -1093,10 +1096,14 @@ void settings_apply(bool read_disk)
|
||||||
|
|
||||||
#if defined(DX50) || defined(DX90)
|
#if defined(DX50) || defined(DX90)
|
||||||
ibasso_set_usb_mode(global_settings.usb_mode);
|
ibasso_set_usb_mode(global_settings.usb_mode);
|
||||||
|
#elif (defined(HIBY_R3PROII) || defined(HIBY_R1)) && !defined(SIMULATOR)
|
||||||
|
hiby_set_usb_mode(global_settings.usb_mode);
|
||||||
#elif defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR)
|
#elif defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR)
|
||||||
usb_set_mode(global_settings.usb_mode);
|
usb_set_mode(global_settings.usb_mode);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_GENERAL_PURPOSE_LED)
|
||||||
|
led_hw_on();
|
||||||
|
#endif
|
||||||
#if defined(DX50) || defined(DX90)
|
#if defined(DX50) || defined(DX90)
|
||||||
ibasso_set_governor(global_settings.governor);
|
ibasso_set_governor(global_settings.governor);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -935,6 +935,9 @@ struct user_settings
|
||||||
int hp_lo_select; /* indicates automatic, headphone-only, or lineout-only operation */
|
int hp_lo_select; /* indicates automatic, headphone-only, or lineout-only operation */
|
||||||
#endif
|
#endif
|
||||||
bool playback_log; /* ROCKBOX_DIR/playback.log for tracks played */
|
bool playback_log; /* ROCKBOX_DIR/playback.log for tracks played */
|
||||||
|
#if defined(HAVE_GENERAL_PURPOSE_LED)
|
||||||
|
bool use_led_indicators;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/* global settings */
|
/* global settings */
|
||||||
|
|
|
||||||
|
|
@ -2399,7 +2399,7 @@ const struct settings_list settings[] = {
|
||||||
USBMODE_DEFAULT,
|
USBMODE_DEFAULT,
|
||||||
"usb mode",
|
"usb mode",
|
||||||
"mass storage,charge"
|
"mass storage,charge"
|
||||||
#if defined(DX50) || defined(DX90)
|
#if defined(DX50) || defined(DX90) || defined(HIBY_R3PROII) || defined(HIBY_R1)
|
||||||
",adb"
|
",adb"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
|
|
@ -2408,11 +2408,15 @@ const struct settings_list settings[] = {
|
||||||
3,
|
3,
|
||||||
#else
|
#else
|
||||||
usb_set_mode,
|
usb_set_mode,
|
||||||
|
#if defined(HIBY_R3PROII) || defined(HIBY_R1)
|
||||||
|
3,
|
||||||
|
#else
|
||||||
2,
|
2,
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
ID2P(LANG_USB_MODE_MASS_STORAGE),
|
ID2P(LANG_USB_MODE_MASS_STORAGE),
|
||||||
ID2P(LANG_USB_MODE_CHARGE)
|
ID2P(LANG_USB_MODE_CHARGE)
|
||||||
#if defined(DX50) || defined(DX90)
|
#if defined(DX50) || defined(DX90) || defined(HIBY_R3PROII) || defined(HIBY_R1)
|
||||||
,ID2P(LANG_USB_MODE_ADB)
|
,ID2P(LANG_USB_MODE_ADB)
|
||||||
#endif
|
#endif
|
||||||
),
|
),
|
||||||
|
|
@ -2430,6 +2434,9 @@ const struct settings_list settings[] = {
|
||||||
ID2P(LANG_AUTO), ID2P(LANG_HEADPHONE), ID2P(LANG_LINEOUT)),
|
ID2P(LANG_AUTO), ID2P(LANG_HEADPHONE), ID2P(LANG_LINEOUT)),
|
||||||
#endif
|
#endif
|
||||||
OFFON_SETTING(0, playback_log, LANG_LOGGING, false, "play log", NULL),
|
OFFON_SETTING(0, playback_log, LANG_LOGGING, false, "play log", NULL),
|
||||||
|
#if defined(HAVE_GENERAL_PURPOSE_LED)
|
||||||
|
OFFON_SETTING(0, use_led_indicators, LANG_USE_LED_INDICATORS, false, "LED indicators", NULL),
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const int nb_settings = sizeof(settings)/sizeof(*settings);
|
const int nb_settings = sizeof(settings)/sizeof(*settings);
|
||||||
|
|
|
||||||
BIN
backdrops/cabbiev2.480x720x16.bmp
Normal file
BIN
backdrops/cabbiev2.480x720x16.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1,013 KiB |
|
|
@ -47,6 +47,9 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
//#define ENABLE_LOGGING
|
||||||
|
//#define AUTO_ENABLE_ADB
|
||||||
|
|
||||||
/* Basic configuration */
|
/* Basic configuration */
|
||||||
#if defined(AGPTEK_ROCKER)
|
#if defined(AGPTEK_ROCKER)
|
||||||
#define ICON_WIDTH 70
|
#define ICON_WIDTH 70
|
||||||
|
|
@ -101,6 +104,28 @@
|
||||||
#define BUTTON_LEFT BUTTON_SCROLL_BACK
|
#define BUTTON_LEFT BUTTON_SCROLL_BACK
|
||||||
#define BUTTON_RIGHT BUTTON_SCROLL_FWD
|
#define BUTTON_RIGHT BUTTON_SCROLL_FWD
|
||||||
#include "bitmaps/hibyicon.h"
|
#include "bitmaps/hibyicon.h"
|
||||||
|
#elif defined(HIBY_R3PROII)
|
||||||
|
#define ICON_WIDTH 130
|
||||||
|
#define ICON_HEIGHT 130
|
||||||
|
#define ICON_NAME bm_hibyicon
|
||||||
|
#define OF_NAME "HIBY PLAYER"
|
||||||
|
#define BUTTON_UP BUTTON_PREV
|
||||||
|
#define BUTTON_DOWN BUTTON_NEXT
|
||||||
|
#define BUTTON_SELECT BUTTON_PLAY
|
||||||
|
#define BUTTON_LEFT BUTTON_VOL_DOWN
|
||||||
|
#define BUTTON_RIGHT BUTTON_VOL_UP
|
||||||
|
#include "bitmaps/hibyicon.h"
|
||||||
|
#elif defined(HIBY_R1)
|
||||||
|
#define ICON_WIDTH 130
|
||||||
|
#define ICON_HEIGHT 130
|
||||||
|
#define ICON_NAME bm_hibyicon
|
||||||
|
#define OF_NAME "HIBY PLAYER"
|
||||||
|
#define BUTTON_UP BUTTON_PREV
|
||||||
|
#define BUTTON_DOWN BUTTON_NEXT
|
||||||
|
#define BUTTON_SELECT BUTTON_PLAY
|
||||||
|
#define BUTTON_LEFT BUTTON_VOL_DOWN
|
||||||
|
#define BUTTON_RIGHT BUTTON_VOL_UP
|
||||||
|
#include "bitmaps/hibyicon.h"
|
||||||
#else
|
#else
|
||||||
#error "must define ICON_WIDTH/HEIGHT"
|
#error "must define ICON_WIDTH/HEIGHT"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -254,12 +279,14 @@ static enum boot_mode get_boot_mode(void)
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
/* on usb detect, immediately boot with last choice */
|
/* on usb detect, immediately boot with last choice */
|
||||||
|
#if !defined(HIBY_R3PROII) && !defined(HIBY_R1)
|
||||||
if(!adb_running && power_input_status() & POWER_INPUT_USB_CHARGER)
|
if(!adb_running && power_input_status() & POWER_INPUT_USB_CHARGER)
|
||||||
{
|
{
|
||||||
/* save last choice */
|
/* save last choice */
|
||||||
save_boot_mode(mode);
|
save_boot_mode(mode);
|
||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* inactivity detection */
|
/* inactivity detection */
|
||||||
int timeout = last_activity + get_inactivity_tmo(init_mode == mode);
|
int timeout = last_activity + get_inactivity_tmo(init_mode == mode);
|
||||||
if(TIME_AFTER(current_tick, timeout))
|
if(TIME_AFTER(current_tick, timeout))
|
||||||
|
|
@ -499,7 +526,11 @@ static void adb(int start)
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
if(pid == 0)
|
if(pid == 0)
|
||||||
{
|
{
|
||||||
|
#if defined(HIBY_R3PROII) || defined(HIBY_R1)
|
||||||
|
execlp("/etc/init.d/T90adb", "T90adb", start ? "start" : "stop", NULL);
|
||||||
|
#else
|
||||||
execlp("/etc/init.d/K90adb", "K90adb", start ? "start" : "stop", NULL);
|
execlp("/etc/init.d/K90adb", "K90adb", start ? "start" : "stop", NULL);
|
||||||
|
#endif
|
||||||
_exit(42);
|
_exit(42);
|
||||||
}
|
}
|
||||||
int status;
|
int status;
|
||||||
|
|
@ -572,7 +603,7 @@ static void tools_screen(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#ifdef ENABLE_LOGGING
|
||||||
/* open log file */
|
/* open log file */
|
||||||
static int open_log(void)
|
static int open_log(void)
|
||||||
{
|
{
|
||||||
|
|
@ -597,7 +628,13 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
(void) argc;
|
(void) argc;
|
||||||
(void) argv;
|
(void) argv;
|
||||||
#if 0
|
|
||||||
|
#ifdef AUTO_ENABLE_ADB
|
||||||
|
// Boot with adb for debugging
|
||||||
|
adb(1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_LOGGING
|
||||||
/* redirect stdout and stderr to have error messages logged somewhere on the
|
/* redirect stdout and stderr to have error messages logged somewhere on the
|
||||||
* user partition */
|
* user partition */
|
||||||
int fd = open_log();
|
int fd = open_log();
|
||||||
|
|
@ -611,7 +648,7 @@ int main(int argc, char **argv)
|
||||||
printf("Rockbox boot loader\n");
|
printf("Rockbox boot loader\n");
|
||||||
printf("Version: %s\n", rbversion);
|
printf("Version: %s\n", rbversion);
|
||||||
printf("%s\n", MODEL_NAME);
|
printf("%s\n", MODEL_NAME);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
system_init();
|
system_init();
|
||||||
core_allocator_init();
|
core_allocator_init();
|
||||||
|
|
@ -635,7 +672,7 @@ int main(int argc, char **argv)
|
||||||
enum boot_mode mode = get_boot_mode();
|
enum boot_mode mode = get_boot_mode();
|
||||||
if (mode == BOOT_OF)
|
if (mode == BOOT_OF)
|
||||||
{
|
{
|
||||||
#if 0
|
#ifdef ENABLE_LOGGING
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
close(fileno(stdout));
|
close(fileno(stdout));
|
||||||
|
|
@ -657,11 +694,26 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
else if(mode == BOOT_ROCKBOX)
|
else if(mode == BOOT_ROCKBOX)
|
||||||
{
|
{
|
||||||
|
#if defined(HIBY_R3PROII) || defined(HIBY_R1)
|
||||||
|
/* Suspend bluetooth as it's not currently supported */
|
||||||
|
system("/usr/bin/bt_suspend");
|
||||||
|
#endif
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
mount_storage(true);
|
mount_storage(true);
|
||||||
system("/bin/cp " BASE_DIR "/.rockbox/" BOOTFILE " /tmp");
|
system("/bin/cp " BASE_DIR "/.rockbox/" BOOTFILE " /tmp");
|
||||||
system("/bin/chmod +x /tmp/" BOOTFILE);
|
system("/bin/chmod +x /tmp/" BOOTFILE);
|
||||||
|
#ifdef HIBY_R1
|
||||||
|
/* Load libasound from Rockbox directory */
|
||||||
|
char *argvr1[] = { "/tmp/" BOOTFILE, 0 };
|
||||||
|
char *envpr1[] =
|
||||||
|
{
|
||||||
|
"LD_LIBRARY_PATH=/data/mnt/sd_0/.rockbox",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
execve(argvr1[0], &argvr1[0], envpr1);
|
||||||
|
#else
|
||||||
execl("/tmp/" BOOTFILE, BOOTFILE, NULL);
|
execl("/tmp/" BOOTFILE, BOOTFILE, NULL);
|
||||||
|
#endif
|
||||||
printf("execvp failed: %s\n", strerror(errno));
|
printf("execvp failed: %s\n", strerror(errno));
|
||||||
error_screen("Cannot boot Rockbox!");
|
error_screen("Cannot boot Rockbox!");
|
||||||
mode = BOOT_TOOLS;
|
mode = BOOT_TOOLS;
|
||||||
|
|
|
||||||
|
|
@ -750,6 +750,7 @@ Gyúróczki Norbert
|
||||||
Ivan Romaniuk-Mikhailovsky
|
Ivan Romaniuk-Mikhailovsky
|
||||||
Matthieu BACHELIER
|
Matthieu BACHELIER
|
||||||
Petr Mikhalitsyn
|
Petr Mikhalitsyn
|
||||||
|
Melissa Autumn
|
||||||
|
|
||||||
The libmad team
|
The libmad team
|
||||||
The wavpack team
|
The wavpack team
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,26 @@ target/hosted/lcd-linuxfb.c
|
||||||
target/hosted/power-linux.c
|
target/hosted/power-linux.c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HIBY_R3PROII) && !defined(SIMULATOR)
|
||||||
|
target/hosted/hiby/usb-hiby-gadget.c
|
||||||
|
target/hosted/hiby/r3proii/button-r3proii.c
|
||||||
|
target/hosted/hiby/r3proii/powermgmt-r3proii.c
|
||||||
|
#ifndef BOOTLOADER
|
||||||
|
target/hosted/hiby/r3proii/led-r3proii.c
|
||||||
|
target/hosted/hiby/hibylinux_codec.c
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(HIBY_R1) && !defined(SIMULATOR)
|
||||||
|
target/hosted/hiby/usb-hiby-gadget.c
|
||||||
|
target/hosted/hiby/r1/button-r1.c
|
||||||
|
target/hosted/hiby/r1/powermgmt-r1.c
|
||||||
|
#ifndef BOOTLOADER
|
||||||
|
target/hosted/hiby/r1/led-r1.c
|
||||||
|
target/hosted/hiby/hibylinux_codec.c
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(AGPTEK_ROCKER) && !defined(SIMULATOR)
|
#if defined(AGPTEK_ROCKER) && !defined(SIMULATOR)
|
||||||
target/hosted/agptek/button-agptek.c
|
target/hosted/agptek/button-agptek.c
|
||||||
target/hosted/agptek/debug-agptek.c
|
target/hosted/agptek/debug-agptek.c
|
||||||
|
|
@ -184,10 +204,13 @@ target/hosted/xduoo/xduoolinux_codec.c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HIBY_LINUX) && !defined(SIMULATOR)
|
#if defined(HIBY_LINUX) && !defined(SIMULATOR)
|
||||||
target/hosted/usb-hiby.c
|
|
||||||
target/hosted/button-devinput.c
|
target/hosted/button-devinput.c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HIBY_LINUX) && !defined(HIBY_R3PROII) && !defined(HIBY_R1) && !defined(SIMULATOR)
|
||||||
|
target/hosted/usb-hiby.c
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(FIIO_M3K_LINUX) && !defined(SIMULATOR)
|
#if defined(FIIO_M3K_LINUX) && !defined(SIMULATOR)
|
||||||
target/hosted/fiio/buttonlight-fiio.c
|
target/hosted/fiio/buttonlight-fiio.c
|
||||||
target/hosted/fiio/button-fiio.c
|
target/hosted/fiio/button-fiio.c
|
||||||
|
|
|
||||||
|
|
@ -243,6 +243,8 @@ struct sound_settings_info
|
||||||
#include "erosqlinux_codec.h"
|
#include "erosqlinux_codec.h"
|
||||||
#elif defined(HAVE_TLV320AIC3104)
|
#elif defined(HAVE_TLV320AIC3104)
|
||||||
#include "tlv320aic3104_codec.h"
|
#include "tlv320aic3104_codec.h"
|
||||||
|
#elif defined(HAVE_HIBY_LINUX_CODEC)
|
||||||
|
#include "hibylinux_codec.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_X1000_ICODEC_REC) && !defined(HAVE_X1000_ICODEC_PLAY)
|
#if defined(HAVE_X1000_ICODEC_REC) && !defined(HAVE_X1000_ICODEC_PLAY)
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@
|
||||||
#define SURFANS_F28_PAD 76
|
#define SURFANS_F28_PAD 76
|
||||||
#define RG_NANO_PAD 77
|
#define RG_NANO_PAD 77
|
||||||
#define CTRU_PAD 78
|
#define CTRU_PAD 78
|
||||||
|
#define HIBY_R3PROII_PAD 79
|
||||||
|
|
||||||
/* CONFIG_REMOTE_KEYPAD */
|
/* CONFIG_REMOTE_KEYPAD */
|
||||||
#define H100_REMOTE 1
|
#define H100_REMOTE 1
|
||||||
|
|
@ -618,6 +619,10 @@ Lyre prototype 1 */
|
||||||
#include "config/rgnano.h"
|
#include "config/rgnano.h"
|
||||||
#elif defined(CTRU)
|
#elif defined(CTRU)
|
||||||
#include "config/ctru.h"
|
#include "config/ctru.h"
|
||||||
|
#elif defined(HIBY_R3PROII)
|
||||||
|
#include "config/hibyr3proii.h"
|
||||||
|
#elif defined(HIBY_R1)
|
||||||
|
#include "config/hibyr1.h"
|
||||||
#else
|
#else
|
||||||
#error "unknown hardware platform!"
|
#error "unknown hardware platform!"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#ifndef SIMULATOR
|
||||||
#define CONFIG_PLATFORM (PLATFORM_HOSTED)
|
#define CONFIG_PLATFORM (PLATFORM_HOSTED)
|
||||||
|
#ifndef PIVOT_ROOT
|
||||||
#define PIVOT_ROOT "/mnt/sd_0"
|
#define PIVOT_ROOT "/mnt/sd_0"
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#define HAVE_FPU
|
#define HAVE_FPU
|
||||||
|
|
||||||
|
|
@ -41,9 +43,13 @@
|
||||||
|
|
||||||
#define CONFIG_LCD LCD_INGENIC_LINUX
|
#define CONFIG_LCD LCD_INGENIC_LINUX
|
||||||
|
|
||||||
|
#ifndef LCD_DEPTH
|
||||||
#define LCD_DEPTH 32
|
#define LCD_DEPTH 32
|
||||||
|
#endif
|
||||||
|
#ifndef LCD_PIXELFORMAT
|
||||||
/* Check that but should not matter */
|
/* Check that but should not matter */
|
||||||
#define LCD_PIXELFORMAT XRGB8888
|
#define LCD_PIXELFORMAT XRGB8888
|
||||||
|
#endif
|
||||||
|
|
||||||
#define HAVE_BACKLIGHT
|
#define HAVE_BACKLIGHT
|
||||||
#define HAVE_BACKLIGHT_BRIGHTNESS
|
#define HAVE_BACKLIGHT_BRIGHTNESS
|
||||||
|
|
@ -51,13 +57,23 @@
|
||||||
/* Main LCD backlight brightness range and defaults: the backlight driver
|
/* Main LCD backlight brightness range and defaults: the backlight driver
|
||||||
* has levels from 0 to 255. But 0 is off so start at 1.
|
* has levels from 0 to 255. But 0 is off so start at 1.
|
||||||
*/
|
*/
|
||||||
|
#ifndef MIN_BRIGHTNESS_SETTING
|
||||||
#define MIN_BRIGHTNESS_SETTING 1
|
#define MIN_BRIGHTNESS_SETTING 1
|
||||||
|
#endif
|
||||||
|
#ifndef MAX_BRIGHTNESS_SETTING
|
||||||
#define MAX_BRIGHTNESS_SETTING 255
|
#define MAX_BRIGHTNESS_SETTING 255
|
||||||
|
#endif
|
||||||
|
#ifndef BRIGHTNESS_STEP
|
||||||
#define BRIGHTNESS_STEP 5
|
#define BRIGHTNESS_STEP 5
|
||||||
|
#endif
|
||||||
|
#ifndef DEFAULT_BRIGHTNESS_SETTING
|
||||||
#define DEFAULT_BRIGHTNESS_SETTING 255
|
#define DEFAULT_BRIGHTNESS_SETTING 255
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Which backlight fading type? */
|
/* Which backlight fading type? */
|
||||||
|
#if !defined(CONFIG_BACKLIGHT_FADING)
|
||||||
#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING
|
#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING
|
||||||
|
#endif
|
||||||
|
|
||||||
/* define this if you have a real-time clock */
|
/* define this if you have a real-time clock */
|
||||||
#define CONFIG_RTC RTC_HOSTED
|
#define CONFIG_RTC RTC_HOSTED
|
||||||
|
|
@ -81,12 +97,18 @@
|
||||||
#define NUM_DRIVES 2
|
#define NUM_DRIVES 2
|
||||||
#define HAVE_HOTSWAP
|
#define HAVE_HOTSWAP
|
||||||
#define HAVE_HOTSWAP_STORAGE_AS_MAIN
|
#define HAVE_HOTSWAP_STORAGE_AS_MAIN
|
||||||
|
#ifndef MULTIDRIVE_DIR
|
||||||
#define MULTIDRIVE_DIR "/mnt/usb"
|
#define MULTIDRIVE_DIR "/mnt/usb"
|
||||||
|
#endif
|
||||||
#define MULTIDRIVE_DEV "/sys/block/sda"
|
#define MULTIDRIVE_DEV "/sys/block/sda"
|
||||||
#define ROOTDRIVE_DEV "/sys/block/mmcblk0"
|
#define ROOTDRIVE_DEV "/sys/block/mmcblk0"
|
||||||
|
|
||||||
/* More common stuff */
|
/* More common stuff */
|
||||||
|
#ifndef BATTERY_DEV_NAME
|
||||||
#ifndef EROS_Q
|
#ifndef EROS_Q
|
||||||
#define BATTERY_DEV_NAME "battery"
|
#define BATTERY_DEV_NAME "battery"
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef POWER_DEV_NAME
|
||||||
#define POWER_DEV_NAME "usb"
|
#define POWER_DEV_NAME "usb"
|
||||||
|
#endif
|
||||||
|
|
|
||||||
90
firmware/export/config/hibyr1.h
Normal file
90
firmware/export/config/hibyr1.h
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
/*
|
||||||
|
* This config file is for the HiBy R1
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* For Rolo and boot loader */
|
||||||
|
#define MODEL_NUMBER 124
|
||||||
|
#define MODEL_NAME "HIBY R1"
|
||||||
|
|
||||||
|
#define PIVOT_ROOT "/data/mnt/sd_0"
|
||||||
|
#define MULTIDRIVE_DIR "/data/mnt/usb"
|
||||||
|
|
||||||
|
/* LCD dimensions */
|
||||||
|
/* sqrt(width^2 + height^2) / 4 = 233 */
|
||||||
|
#define LCD_WIDTH 480
|
||||||
|
#define LCD_HEIGHT 800
|
||||||
|
#define LCD_DPI 233
|
||||||
|
|
||||||
|
#define HAVE_LCD_SLEEP
|
||||||
|
#define LCD_SLEEP_TIMEOUT (2*HZ)
|
||||||
|
|
||||||
|
#define LCD_DEPTH 16 /* 65536 colours */
|
||||||
|
#define LCD_PIXELFORMAT RGB565 /* rgb565 */
|
||||||
|
|
||||||
|
#define CPU_FREQ 1008000000
|
||||||
|
|
||||||
|
#ifndef SIMULATOR
|
||||||
|
#define HAVE_GENERAL_PURPOSE_LED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* define this if you have access to the quickscreen */
|
||||||
|
#define HAVE_QUICKSCREEN
|
||||||
|
#define HAVE_HOTKEY
|
||||||
|
|
||||||
|
#define HAVE_HEADPHONE_DETECTION
|
||||||
|
#define NO_BUTTON_LR
|
||||||
|
|
||||||
|
#ifndef BOOTLOADER
|
||||||
|
#define HAVE_BUTTON_DATA
|
||||||
|
#define HAVE_TOUCHSCREEN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_BACKLIGHT_FADING
|
||||||
|
#undef CONFIG_BACKLIGHT_FADING
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* KeyPad configuration for plugins */
|
||||||
|
#define CONFIG_KEYPAD HIBY_R3PROII_PAD
|
||||||
|
|
||||||
|
/* define this if the target has volume keys which can be used in the lists */
|
||||||
|
#define HAVE_VOLUME_IN_LIST
|
||||||
|
|
||||||
|
/* Battery */
|
||||||
|
#define BATTERY_TYPES_COUNT 1
|
||||||
|
|
||||||
|
/* Audio codec */
|
||||||
|
#define HAVE_HIBY_LINUX_CODEC
|
||||||
|
|
||||||
|
/* We don't have hardware controls */
|
||||||
|
#define HAVE_SW_TONE_CONTROLS
|
||||||
|
|
||||||
|
/* HW codec is flexible */
|
||||||
|
#define HW_SAMPR_CAPS SAMPR_CAP_ALL_192
|
||||||
|
|
||||||
|
/* Battery */
|
||||||
|
#define CONFIG_BATTERY_MEASURE (VOLTAGE_MEASURE|PERCENTAGE_MEASURE|TIME_MEASURE)
|
||||||
|
|
||||||
|
#define BATTERY_CAPACITY_DEFAULT 100 /* default battery capacity */
|
||||||
|
#define BATTERY_CAPACITY_MIN 100 /* min. capacity selectable */
|
||||||
|
#define BATTERY_CAPACITY_MAX 100 /* max. capacity selectable */
|
||||||
|
#define BATTERY_CAPACITY_INC 0 /* capacity increment */
|
||||||
|
|
||||||
|
/* Special backlight paths */
|
||||||
|
#define BACKLIGHT_HIBY
|
||||||
|
|
||||||
|
#define MIN_BRIGHTNESS_SETTING 1
|
||||||
|
#define MAX_BRIGHTNESS_SETTING 100
|
||||||
|
#define BRIGHTNESS_STEP 5
|
||||||
|
#define DEFAULT_BRIGHTNESS_SETTING 100
|
||||||
|
|
||||||
|
/* ROLO */
|
||||||
|
#define BOOTFILE_EXT "r1"
|
||||||
|
#define BOOTFILE "rockbox." BOOTFILE_EXT
|
||||||
|
#define BOOTDIR "/.rockbox"
|
||||||
|
|
||||||
|
/* USB */
|
||||||
|
#define USB_VID_STR "32BB"
|
||||||
|
#define USB_PID_STR "0101"
|
||||||
|
|
||||||
|
/* Generic HiBy stuff */
|
||||||
|
#include "hibylinux.h"
|
||||||
94
firmware/export/config/hibyr3proii.h
Normal file
94
firmware/export/config/hibyr3proii.h
Normal file
|
|
@ -0,0 +1,94 @@
|
||||||
|
/*
|
||||||
|
* This config file is for the HiBy R3 Pro II based on the x1600E soc
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* For Rolo and boot loader */
|
||||||
|
#define MODEL_NUMBER 123
|
||||||
|
#define MODEL_NAME "HIBY R3 PRO II"
|
||||||
|
|
||||||
|
#define PIVOT_ROOT "/data/mnt/sd_0"
|
||||||
|
#define MULTIDRIVE_DIR "/data/mnt/usb"
|
||||||
|
|
||||||
|
/* LCD dimensions */
|
||||||
|
/* sqrt(width^2 + height^2) / 4 = 216 */
|
||||||
|
#define LCD_WIDTH 480
|
||||||
|
#define LCD_HEIGHT 720
|
||||||
|
#define LCD_DPI 216
|
||||||
|
|
||||||
|
#define HAVE_LCD_SLEEP
|
||||||
|
#define LCD_SLEEP_TIMEOUT (2*HZ)
|
||||||
|
|
||||||
|
#define LCD_DEPTH 16 /* 65536 colours */
|
||||||
|
#define LCD_PIXELFORMAT RGB565 /* rgb565 */
|
||||||
|
|
||||||
|
#define CPU_FREQ 1008000000
|
||||||
|
|
||||||
|
#ifndef SIMULATOR
|
||||||
|
#define HAVE_GENERAL_PURPOSE_LED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* define this if you have access to the quickscreen */
|
||||||
|
#define HAVE_QUICKSCREEN
|
||||||
|
#define HAVE_HOTKEY
|
||||||
|
|
||||||
|
#define HAVE_HEADPHONE_DETECTION
|
||||||
|
#define NO_BUTTON_LR
|
||||||
|
|
||||||
|
#ifndef BOOTLOADER
|
||||||
|
#define HAVE_BUTTON_DATA
|
||||||
|
#define HAVE_TOUCHSCREEN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_BACKLIGHT_FADING
|
||||||
|
#undef CONFIG_BACKLIGHT_FADING
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* KeyPad configuration for plugins */
|
||||||
|
#define CONFIG_KEYPAD HIBY_R3PROII_PAD
|
||||||
|
|
||||||
|
/* define this if the target has volume keys which can be used in the lists */
|
||||||
|
#define HAVE_VOLUME_IN_LIST
|
||||||
|
|
||||||
|
/* Battery doesn't update its charging status, but the charger does. */
|
||||||
|
#define POWER_DEV_NAME "mp2731-charger"
|
||||||
|
#define BATTERY_DEV_NAME "mp2731-charger"
|
||||||
|
|
||||||
|
/* Battery */
|
||||||
|
#define BATTERY_TYPES_COUNT 1
|
||||||
|
|
||||||
|
/* Audio codec */
|
||||||
|
#define HAVE_HIBY_LINUX_CODEC
|
||||||
|
|
||||||
|
/* We don't have hardware controls */
|
||||||
|
#define HAVE_SW_TONE_CONTROLS
|
||||||
|
|
||||||
|
/* HW codec is flexible */
|
||||||
|
#define HW_SAMPR_CAPS SAMPR_CAP_ALL_192
|
||||||
|
|
||||||
|
/* Battery */
|
||||||
|
#define CONFIG_BATTERY_MEASURE (VOLTAGE_MEASURE|PERCENTAGE_MEASURE|TIME_MEASURE)
|
||||||
|
|
||||||
|
#define BATTERY_CAPACITY_DEFAULT 100 /* default battery capacity */
|
||||||
|
#define BATTERY_CAPACITY_MIN 100 /* min. capacity selectable */
|
||||||
|
#define BATTERY_CAPACITY_MAX 100 /* max. capacity selectable */
|
||||||
|
#define BATTERY_CAPACITY_INC 0 /* capacity increment */
|
||||||
|
|
||||||
|
/* Special backlight paths */
|
||||||
|
#define BACKLIGHT_HIBY
|
||||||
|
|
||||||
|
#define MIN_BRIGHTNESS_SETTING 1
|
||||||
|
#define MAX_BRIGHTNESS_SETTING 100
|
||||||
|
#define BRIGHTNESS_STEP 5
|
||||||
|
#define DEFAULT_BRIGHTNESS_SETTING 100
|
||||||
|
|
||||||
|
/* ROLO */
|
||||||
|
#define BOOTFILE_EXT "r3proii"
|
||||||
|
#define BOOTFILE "rockbox." BOOTFILE_EXT
|
||||||
|
#define BOOTDIR "/.rockbox"
|
||||||
|
|
||||||
|
/* USB */
|
||||||
|
#define USB_VID_STR "32BB"
|
||||||
|
#define USB_PID_STR "0101"
|
||||||
|
|
||||||
|
/* Generic HiBy stuff */
|
||||||
|
#include "hibylinux.h"
|
||||||
17
firmware/export/hibylinux_codec.h
Normal file
17
firmware/export/hibylinux_codec.h
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
#ifndef __HIBYLINUX_CODEC__
|
||||||
|
#define __HIBYLINUX_CODEC__
|
||||||
|
|
||||||
|
#define AUDIOHW_CAPS (FILTER_ROLL_OFF_CAP)
|
||||||
|
AUDIOHW_SETTING(VOLUME, "dB", 1, 5, -102*10, 0, -30*10)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//#define AUDIOHW_MUTE_ON_STOP
|
||||||
|
#define AUDIOHW_MUTE_ON_SRATE_CHANGE
|
||||||
|
//#define AUDIOHW_NEEDS_INITIAL_UNMUTE
|
||||||
|
|
||||||
|
AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 4, 0)
|
||||||
|
#define AUDIOHW_HAVE_SHORT2_ROLL_OFF
|
||||||
|
|
||||||
|
void audiohw_mute(int mute);
|
||||||
|
void hiby_set_output(int ps);
|
||||||
|
int hiby_get_outputs(void);
|
||||||
35
firmware/export/led-general-purpose.h
Normal file
35
firmware/export/led-general-purpose.h
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 Melissa Autumn
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef __LED_GENERAL_PURPOSE_H__
|
||||||
|
#define __LED_GENERAL_PURPOSE_H__
|
||||||
|
|
||||||
|
#ifdef HAVE_GENERAL_PURPOSE_LED
|
||||||
|
|
||||||
|
extern void led_hw_set_mode(bool mode);
|
||||||
|
extern void led_hw_brightness(int brightness);
|
||||||
|
extern void led_hw_on(void);
|
||||||
|
extern void led_hw_off(void);
|
||||||
|
extern void led_hw_charging(void);
|
||||||
|
extern void led_hw_charged(void);
|
||||||
|
|
||||||
|
#endif /* HAVE_GENERAL_PURPOSE_LED */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
@ -87,7 +87,8 @@
|
||||||
|
|
||||||
#if defined(APPLICATION) && \
|
#if defined(APPLICATION) && \
|
||||||
!(defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) || \
|
!(defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) || \
|
||||||
defined(DX50) || defined(DX90) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX) || defined(CTRU))
|
defined(DX50) || defined(DX90) || defined(SONY_NWZ_LINUX) || \
|
||||||
|
defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX) || defined(CTRU))
|
||||||
|
|
||||||
#define PLUGIN_DATA_DIR ROCKBOX_DIR "/rocks.data"
|
#define PLUGIN_DATA_DIR ROCKBOX_DIR "/rocks.data"
|
||||||
#define PLUGIN_GAMES_DATA_DIR PLUGIN_DATA_DIR
|
#define PLUGIN_GAMES_DATA_DIR PLUGIN_DATA_DIR
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,14 @@
|
||||||
#define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT)
|
#define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT)
|
||||||
|
|
||||||
#define MAX_NUM_QUEUES 32
|
#define MAX_NUM_QUEUES 32
|
||||||
|
#if defined(HAVE_TOUCHSCREEN) /* Multitouch generates more events */
|
||||||
|
#define QUEUE_LENGTH 32 /* MUST be a power of 2 */
|
||||||
|
#else
|
||||||
#define QUEUE_LENGTH 16 /* MUST be a power of 2 */
|
#define QUEUE_LENGTH 16 /* MUST be a power of 2 */
|
||||||
|
#endif
|
||||||
#define QUEUE_LENGTH_MASK (QUEUE_LENGTH - 1)
|
#define QUEUE_LENGTH_MASK (QUEUE_LENGTH - 1)
|
||||||
|
|
||||||
|
|
||||||
struct queue_event
|
struct queue_event
|
||||||
{
|
{
|
||||||
long id;
|
long id;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017 Marcin Bukat
|
* Copyright (C) 2017 Marcin Bukat
|
||||||
* Copyright (C) 2019 by Roman Stolyarov
|
* Copyright (C) 2019 by Roman Stolyarov
|
||||||
|
* Copyright (C) 2025 by Melissa Autumn
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -31,12 +32,18 @@
|
||||||
#include "panic.h"
|
#include "panic.h"
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
|
|
||||||
#ifdef BACKLIGHT_RG_NANO
|
#if defined(BACKLIGHT_RG_NANO)
|
||||||
static const char * const sysfs_bl_brightness =
|
static const char * const sysfs_bl_brightness =
|
||||||
"/sys/class/backlight/backlight/brightness";
|
"/sys/class/backlight/backlight/brightness";
|
||||||
|
|
||||||
static const char * const sysfs_bl_power =
|
static const char * const sysfs_bl_power =
|
||||||
"/sys/class/backlight/backlight/bl_power";
|
"/sys/class/backlight/backlight/bl_power";
|
||||||
|
#elif defined(BACKLIGHT_HIBY)
|
||||||
|
static const char * const sysfs_bl_brightness =
|
||||||
|
"/sys/class/backlight/backlight_pwm0/brightness";
|
||||||
|
|
||||||
|
static const char * const sysfs_bl_power =
|
||||||
|
"/sys/class/backlight/backlight_pwm0/bl_power";
|
||||||
#else
|
#else
|
||||||
static const char * const sysfs_bl_brightness =
|
static const char * const sysfs_bl_brightness =
|
||||||
"/sys/class/backlight/pwm-backlight.0/brightness";
|
"/sys/class/backlight/pwm-backlight.0/brightness";
|
||||||
|
|
@ -60,25 +67,30 @@ bool backlight_hw_init(void)
|
||||||
|
|
||||||
static int last_bl = -1;
|
static int last_bl = -1;
|
||||||
|
|
||||||
|
/* Ref: https://www.kernel.org/doc/html/latest/gpu/backlight.html#c.backlight_properties */
|
||||||
|
#define BACKLIGHT_POWER_ON 0
|
||||||
|
#define BACKLIGHT_POWER_REDUCED 1
|
||||||
|
#define BACKLIGHT_POWER_OFF 4
|
||||||
|
|
||||||
void backlight_hw_on(void)
|
void backlight_hw_on(void)
|
||||||
{
|
{
|
||||||
if (last_bl != 1) {
|
if (last_bl != BACKLIGHT_POWER_ON) {
|
||||||
#ifdef HAVE_LCD_ENABLE
|
#ifdef HAVE_LCD_ENABLE
|
||||||
lcd_enable(true);
|
lcd_enable(true);
|
||||||
#endif
|
#endif
|
||||||
sysfs_set_int(sysfs_bl_power, 0);
|
last_bl = BACKLIGHT_POWER_ON;
|
||||||
last_bl = 1;
|
sysfs_set_int(sysfs_bl_power, last_bl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void backlight_hw_off(void)
|
void backlight_hw_off(void)
|
||||||
{
|
{
|
||||||
if (last_bl != 0) {
|
if (last_bl != BACKLIGHT_POWER_REDUCED) {
|
||||||
sysfs_set_int(sysfs_bl_power, 1);
|
last_bl = BACKLIGHT_POWER_REDUCED;
|
||||||
|
sysfs_set_int(sysfs_bl_power, last_bl);
|
||||||
#ifdef HAVE_LCD_ENABLE
|
#ifdef HAVE_LCD_ENABLE
|
||||||
lcd_enable(false);
|
lcd_enable(false);
|
||||||
#endif
|
#endif
|
||||||
last_bl = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -92,3 +104,21 @@ void backlight_hw_brightness(int brightness)
|
||||||
|
|
||||||
sysfs_set_int(sysfs_bl_brightness, brightness);
|
sysfs_set_int(sysfs_bl_brightness, brightness);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_SLEEP
|
||||||
|
void lcd_awake(void)
|
||||||
|
{
|
||||||
|
/* Nothing to do */
|
||||||
|
}
|
||||||
|
|
||||||
|
void lcd_sleep(void)
|
||||||
|
{
|
||||||
|
if (last_bl != BACKLIGHT_POWER_OFF) {
|
||||||
|
last_bl = BACKLIGHT_POWER_OFF;
|
||||||
|
sysfs_set_int(sysfs_bl_power, last_bl);
|
||||||
|
#ifdef HAVE_LCD_ENABLE
|
||||||
|
lcd_enable(false);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -109,27 +109,21 @@ static enum
|
||||||
#define EVENT_VALUE_TOUCHSCREEN_PRESS 1
|
#define EVENT_VALUE_TOUCHSCREEN_PRESS 1
|
||||||
#define EVENT_VALUE_TOUCHSCREEN_RELEASE -1
|
#define EVENT_VALUE_TOUCHSCREEN_RELEASE -1
|
||||||
|
|
||||||
static int ts_enabled = 0;
|
static int ts_enabled = 1;
|
||||||
|
|
||||||
void touchscreen_enable_device(bool en)
|
void touchscreen_enable_device(bool en)
|
||||||
{
|
{
|
||||||
ts_enabled = en;
|
ts_enabled = en;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool handle_touchscreen_event(__u16 code, __s32 value)
|
static void handle_touchscreen_event(__u16 code, __s32 value)
|
||||||
{
|
{
|
||||||
bool read_more = false;
|
|
||||||
|
|
||||||
switch(code)
|
switch(code)
|
||||||
{
|
{
|
||||||
case ABS_X:
|
case ABS_X:
|
||||||
case ABS_MT_POSITION_X:
|
case ABS_MT_POSITION_X:
|
||||||
{
|
{
|
||||||
_last_x = value;
|
_last_x = value;
|
||||||
|
|
||||||
/* x -> next will be y. */
|
|
||||||
read_more = true;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,22 +136,17 @@ static bool handle_touchscreen_event(__u16 code, __s32 value)
|
||||||
|
|
||||||
case ABS_MT_TRACKING_ID:
|
case ABS_MT_TRACKING_ID:
|
||||||
{
|
{
|
||||||
if(value == EVENT_VALUE_TOUCHSCREEN_PRESS)
|
if(value == EVENT_VALUE_TOUCHSCREEN_RELEASE)
|
||||||
{
|
{
|
||||||
_last_touch_state = TOUCHSCREEN_STATE_DOWN;
|
_last_touch_state = TOUCHSCREEN_STATE_UP;
|
||||||
|
|
||||||
/* Press -> next will be x. */
|
|
||||||
read_more = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_last_touch_state = TOUCHSCREEN_STATE_UP;
|
_last_touch_state = TOUCHSCREEN_STATE_DOWN;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return read_more;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -227,7 +216,7 @@ int button_read_device(BDATA)
|
||||||
#if defined(HAVE_TOUCHSCREEN) && defined(BUTTON_TOUCH)
|
#if defined(HAVE_TOUCHSCREEN) && defined(BUTTON_TOUCH)
|
||||||
/* Some touchscreens give us actual touch/untouch as a "key" */
|
/* Some touchscreens give us actual touch/untouch as a "key" */
|
||||||
if (bmap & BUTTON_TOUCH) {
|
if (bmap & BUTTON_TOUCH) {
|
||||||
handle_touchscreen_event(ABS_MT_TRACKING_ID, 0);
|
handle_touchscreen_event(ABS_MT_TRACKING_ID, EVENT_VALUE_TOUCHSCREEN_RELEASE);
|
||||||
bmap &= ~BUTTON_TOUCH;
|
bmap &= ~BUTTON_TOUCH;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
0
firmware/target/hosted/hiby/adc-target.h
Normal file
0
firmware/target/hosted/hiby/adc-target.h
Normal file
158
firmware/target/hosted/hiby/hibylinux_codec.c
Normal file
158
firmware/target/hosted/hiby/hibylinux_codec.c
Normal file
|
|
@ -0,0 +1,158 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Copyright (c) 2018 Marcin Bukat
|
||||||
|
* Copyright (c) 2025 Solomon Peachy
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
//#define LOGF_ENABLE
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "audio.h"
|
||||||
|
#include "audiohw.h"
|
||||||
|
#include "button.h"
|
||||||
|
#include "system.h"
|
||||||
|
#include "kernel.h"
|
||||||
|
#include "panic.h"
|
||||||
|
#include "sysfs.h"
|
||||||
|
#include "alsa-controls.h"
|
||||||
|
#include "pcm-alsa.h"
|
||||||
|
|
||||||
|
#include "logf.h"
|
||||||
|
|
||||||
|
int hiby_has_valid_output(void);
|
||||||
|
|
||||||
|
static int hw_init = 0;
|
||||||
|
|
||||||
|
static long int vol_l_hw = 255;
|
||||||
|
static long int vol_r_hw = 255;
|
||||||
|
static long int last_ps = -1;
|
||||||
|
|
||||||
|
static int muted = -1;
|
||||||
|
|
||||||
|
void audiohw_mute(int mute)
|
||||||
|
{
|
||||||
|
if (hw_init < 0 || muted == mute)
|
||||||
|
return;
|
||||||
|
|
||||||
|
muted = mute;
|
||||||
|
|
||||||
|
alsa_controls_set_bool("Mute Output", !!mute);
|
||||||
|
}
|
||||||
|
|
||||||
|
int hiby_has_valid_output(void) {
|
||||||
|
long int ps = 0; // Muted, if nothing is plugged in!
|
||||||
|
|
||||||
|
int status = 0;
|
||||||
|
|
||||||
|
if (!hw_init) return ps;
|
||||||
|
|
||||||
|
const char * const sysfs_hs_switch = "/sys/class/switch/headset/state";
|
||||||
|
const char * const sysfs_bal_switch = "/sys/class/switch/balance/state";
|
||||||
|
|
||||||
|
sysfs_get_int(sysfs_hs_switch, &status);
|
||||||
|
if (status) ps = 2; // headset
|
||||||
|
|
||||||
|
sysfs_get_int(sysfs_bal_switch, &status);
|
||||||
|
if (status) ps = 3; // balanced output
|
||||||
|
|
||||||
|
return ps;
|
||||||
|
}
|
||||||
|
|
||||||
|
int hiby_get_outputs(void){
|
||||||
|
long int ps = hiby_has_valid_output();
|
||||||
|
|
||||||
|
hiby_set_output(ps);
|
||||||
|
|
||||||
|
return ps;
|
||||||
|
}
|
||||||
|
|
||||||
|
void hiby_set_output(int ps)
|
||||||
|
{
|
||||||
|
if (!hw_init || muted) return;
|
||||||
|
|
||||||
|
if (last_ps != ps)
|
||||||
|
{
|
||||||
|
logf("set out %d/%d", ps, last_ps);
|
||||||
|
/* Output port switch */
|
||||||
|
last_ps = ps;
|
||||||
|
alsa_controls_set_ints("Output Port Switch", 1, &last_ps);
|
||||||
|
audiohw_set_volume(vol_l_hw, vol_r_hw);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void audiohw_preinit(void)
|
||||||
|
{
|
||||||
|
logf("hw preinit");
|
||||||
|
alsa_controls_init("default");
|
||||||
|
hw_init = 1;
|
||||||
|
|
||||||
|
audiohw_mute(false); /* No need ? */
|
||||||
|
alsa_controls_set_bool("DOP_EN", 0); //isDSD
|
||||||
|
}
|
||||||
|
|
||||||
|
void audiohw_postinit(void)
|
||||||
|
{
|
||||||
|
logf("hw postinit");
|
||||||
|
}
|
||||||
|
|
||||||
|
void audiohw_close(void)
|
||||||
|
{
|
||||||
|
logf("hw close");
|
||||||
|
hw_init = 0;
|
||||||
|
alsa_controls_close();
|
||||||
|
}
|
||||||
|
|
||||||
|
void audiohw_set_frequency(int fsel)
|
||||||
|
{
|
||||||
|
(void)fsel;
|
||||||
|
}
|
||||||
|
|
||||||
|
void audiohw_set_volume(int vol_l, int vol_r)
|
||||||
|
{
|
||||||
|
logf("hw vol %d %d", vol_l, vol_r);
|
||||||
|
|
||||||
|
long l,r;
|
||||||
|
|
||||||
|
vol_l_hw = vol_l;
|
||||||
|
vol_r_hw = vol_r;
|
||||||
|
|
||||||
|
l = -vol_l/5;
|
||||||
|
r = -vol_r/5;
|
||||||
|
|
||||||
|
if (!hw_init)
|
||||||
|
return;
|
||||||
|
|
||||||
|
alsa_controls_set_ints("Left Playback Volume", 1, &l);
|
||||||
|
alsa_controls_set_ints("Right Playback Volume", 1, &r);
|
||||||
|
}
|
||||||
|
|
||||||
|
void audiohw_set_filter_roll_off(int value)
|
||||||
|
{
|
||||||
|
logf("rolloff %d", value);
|
||||||
|
/* 0 = Sharp;
|
||||||
|
* 1 = Slow;
|
||||||
|
* 2 = Short Sharp
|
||||||
|
* 3 = Short Slow
|
||||||
|
* 4 = Super Slow */
|
||||||
|
long int value_hw = value;
|
||||||
|
alsa_controls_set_ints("Digital Filter", 1, &value_hw);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
32
firmware/target/hosted/hiby/lcd-target.h
Normal file
32
firmware/target/hosted/hiby/lcd-target.h
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2016 Amaury Pouly
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __LCD_TARGET_H__
|
||||||
|
#define __LCD_TARGET_H__
|
||||||
|
|
||||||
|
/* hibyos needs special ioctl() to redraw updated framebuffer content */
|
||||||
|
#define LCD_OPTIMIZED_UPDATE
|
||||||
|
#define LCD_OPTIMIZED_UPDATE_RECT
|
||||||
|
|
||||||
|
extern fb_data *framebuffer;
|
||||||
|
#define LCD_FRAMEBUF_ADDR(col, row) (framebuffer + (row)*LCD_WIDTH + (col))
|
||||||
|
|
||||||
|
extern void lcd_set_active(bool active);
|
||||||
|
#endif /* __LCD_TARGET_H__ */
|
||||||
81
firmware/target/hosted/hiby/r1/button-r1.c
Normal file
81
firmware/target/hosted/hiby/r1/button-r1.c
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Marcin Bukat
|
||||||
|
* Copyright (C) 2025 by Melissa Autumn/Marc Aarts
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#include <linux/input.h>
|
||||||
|
|
||||||
|
#include "sysfs.h"
|
||||||
|
#include "button.h"
|
||||||
|
#include "button-target.h"
|
||||||
|
#include "hibylinux_codec.h"
|
||||||
|
#include "touchscreen.h"
|
||||||
|
#ifdef HAVE_BACKLIGHT
|
||||||
|
#include "backlight.h"
|
||||||
|
#endif /* HAVE_BACKLIGHT */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* /dev/input/event0: md-gpio-keys (power/next)
|
||||||
|
* /dev/input/event1: hyn_ts (touchscreen)
|
||||||
|
* /dev/input/event2: jz adc keyboard (play/volume+/volume-)
|
||||||
|
* /dev/input/event3: earpods_adc
|
||||||
|
*/
|
||||||
|
|
||||||
|
int button_map(int keycode)
|
||||||
|
{
|
||||||
|
switch(keycode)
|
||||||
|
{
|
||||||
|
case KEY_VOLUMEDOWN:
|
||||||
|
return BUTTON_VOL_DOWN;
|
||||||
|
case KEY_VOLUMEUP:
|
||||||
|
return BUTTON_VOL_UP;
|
||||||
|
case KEY_PLAYPAUSE:
|
||||||
|
return BUTTON_PLAY;
|
||||||
|
case KEY_NEXTSONG:
|
||||||
|
return BUTTON_NEXT;
|
||||||
|
case KEY_PREVIOUSSONG:
|
||||||
|
return BUTTON_PREV;
|
||||||
|
case KEY_POWER:
|
||||||
|
return BUTTON_POWER;
|
||||||
|
case BTN_TOUCH:
|
||||||
|
{
|
||||||
|
#ifdef HAVE_BACKLIGHT
|
||||||
|
if (is_backlight_on(true)) {
|
||||||
|
return BUTTON_TOUCH;
|
||||||
|
}
|
||||||
|
// Ignore
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
return BUTTON_TOUCH
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool headphones_inserted(void)
|
||||||
|
{
|
||||||
|
#ifdef BOOTLOADER
|
||||||
|
int ps = 0;
|
||||||
|
#else
|
||||||
|
int ps = hiby_get_outputs();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return (ps == 2);
|
||||||
|
}
|
||||||
60
firmware/target/hosted/hiby/r1/button-target.h
Normal file
60
firmware/target/hosted/hiby/r1/button-target.h
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 by Melissa Autumn
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef _BUTTON_TARGET_H_
|
||||||
|
#define _BUTTON_TARGET_H_
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
/* Main unit's buttons */
|
||||||
|
#define BUTTON_POWER 0x00000001
|
||||||
|
#define BUTTON_PREV 0x00000002 /* there is no PREV */
|
||||||
|
#define BUTTON_NEXT 0x00000004
|
||||||
|
#define BUTTON_PLAY 0x00000008
|
||||||
|
#define BUTTON_VOL_UP 0x00000010
|
||||||
|
#define BUTTON_VOL_DOWN 0x00000020
|
||||||
|
#define BUTTON_MAIN 0x0000003f
|
||||||
|
|
||||||
|
#define BUTTON_TOUCH 0x00000040
|
||||||
|
|
||||||
|
/* Touchscreen virtual buttons */
|
||||||
|
#define BUTTON_TOPLEFT 0x00001000
|
||||||
|
#define BUTTON_TOPMIDDLE 0x00002000
|
||||||
|
#define BUTTON_TOPRIGHT 0x00004000
|
||||||
|
#define BUTTON_MIDLEFT 0x00008000
|
||||||
|
#define BUTTON_CENTER 0x00010000
|
||||||
|
#define BUTTON_MIDRIGHT 0x00020000
|
||||||
|
#define BUTTON_BOTTOMLEFT 0x00040000
|
||||||
|
#define BUTTON_BOTTOMMIDDLE 0x00080000
|
||||||
|
#define BUTTON_BOTTOMRIGHT 0x00100000
|
||||||
|
|
||||||
|
/* Software power-off */
|
||||||
|
#define POWEROFF_BUTTON BUTTON_POWER
|
||||||
|
#define POWEROFF_COUNT 25
|
||||||
|
|
||||||
|
/* For the simulator/sdl plugins/xworld */
|
||||||
|
#ifndef BOOTLOADER
|
||||||
|
#define BUTTON_LEFT BUTTON_NEXT
|
||||||
|
#define BUTTON_RIGHT BUTTON_PREV
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int button_map(int keycode);
|
||||||
|
|
||||||
|
#endif /* _BUTTON_TARGET_H_ */
|
||||||
140
firmware/target/hosted/hiby/r1/led-r1.c
Normal file
140
firmware/target/hosted/hiby/r1/led-r1.c
Normal file
|
|
@ -0,0 +1,140 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 Melissa Autumn
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "config.h"
|
||||||
|
#include "backlight-target.h"
|
||||||
|
#include "sysfs.h"
|
||||||
|
#include "panic.h"
|
||||||
|
#include "lcd.h"
|
||||||
|
#include "settings.h"
|
||||||
|
#include "power.h"
|
||||||
|
|
||||||
|
static const char * const sysfs_blue_led =
|
||||||
|
"/sys/class/leds/blue/brightness";
|
||||||
|
static const char * const sysfs_red_led =
|
||||||
|
"/sys/class/leds/red/brightness";
|
||||||
|
static const char * const sysfs_red_trigger =
|
||||||
|
"/sys/class/leds/red/trigger";
|
||||||
|
|
||||||
|
/* Ref: https://guide.hiby.com/en/docs/products/audio_player/hiby_r1/guide#led-indicator
|
||||||
|
|
||||||
|
Note: The red breathing effect seems to be just the "breathing" led trigger.
|
||||||
|
By default red is turned off and blue is set to 50 brightness.
|
||||||
|
*/
|
||||||
|
enum R1_LEDS {
|
||||||
|
LED_INVALID = -1,
|
||||||
|
LED_OFF = 0,
|
||||||
|
LED_BLUE,
|
||||||
|
LED_RED,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define DEFAULT_BRIGHTNESS 50
|
||||||
|
|
||||||
|
int _last_brightness = DEFAULT_BRIGHTNESS;
|
||||||
|
int _last_led = LED_INVALID;
|
||||||
|
|
||||||
|
void _set_led(enum R1_LEDS led) {
|
||||||
|
if (_last_led != led) {
|
||||||
|
_last_led = led;
|
||||||
|
|
||||||
|
if (_last_brightness == 0) {
|
||||||
|
_last_brightness = DEFAULT_BRIGHTNESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(led) {
|
||||||
|
case LED_OFF:
|
||||||
|
sysfs_set_int(sysfs_blue_led, 0);
|
||||||
|
sysfs_set_int(sysfs_red_led, 0);
|
||||||
|
break;
|
||||||
|
case LED_BLUE:
|
||||||
|
sysfs_set_int(sysfs_blue_led, _last_brightness);
|
||||||
|
sysfs_set_int(sysfs_red_led, 0);
|
||||||
|
break;
|
||||||
|
case LED_RED:
|
||||||
|
sysfs_set_int(sysfs_blue_led, 0);
|
||||||
|
sysfs_set_int(sysfs_red_led, _last_brightness);
|
||||||
|
sysfs_set_string(sysfs_red_trigger, "breathing");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_GENERAL_PURPOSE_LED
|
||||||
|
void led_hw_brightness(int brightness)
|
||||||
|
{
|
||||||
|
if (brightness != _last_brightness) {
|
||||||
|
_last_brightness = brightness;
|
||||||
|
_set_led(_last_led);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_hw_charged(void)
|
||||||
|
{
|
||||||
|
if (global_settings.use_led_indicators) {
|
||||||
|
_set_led(LED_BLUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_hw_charging(void)
|
||||||
|
{
|
||||||
|
_set_led(LED_RED);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_hw_off(void)
|
||||||
|
{
|
||||||
|
// Don't turn off led if charging
|
||||||
|
if (!charging_state()) {
|
||||||
|
_set_led(LED_OFF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_hw_on(void)
|
||||||
|
{
|
||||||
|
if (charging_state()) {
|
||||||
|
led_hw_charging();
|
||||||
|
} else {
|
||||||
|
if (global_settings.use_led_indicators) {
|
||||||
|
_set_led(LED_BLUE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
led_hw_off();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_hw_set_mode(bool mode)
|
||||||
|
{
|
||||||
|
if (mode) {
|
||||||
|
led_hw_on();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
led_hw_off();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
39
firmware/target/hosted/hiby/r1/powermgmt-r1.c
Normal file
39
firmware/target/hosted/hiby/r1/powermgmt-r1.c
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Marcin Bukat
|
||||||
|
* Copyright (C) 2025 by Melissa Autumn
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#include "powermgmt.h"
|
||||||
|
#include "power.h"
|
||||||
|
|
||||||
|
unsigned short battery_level_disksafe = 3470;
|
||||||
|
|
||||||
|
/* the OF shuts down at this voltage */
|
||||||
|
unsigned short battery_level_shutoff = 3400;
|
||||||
|
|
||||||
|
/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
|
||||||
|
unsigned short percent_to_volt_discharge[11] =
|
||||||
|
{
|
||||||
|
3400, 3675, 3715, 3750, 3775, 3810, 3850, 4028, 4125, 4237, 4376
|
||||||
|
};
|
||||||
|
|
||||||
|
/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
|
||||||
|
unsigned short percent_to_volt_charge[11] =
|
||||||
|
{
|
||||||
|
3485, 3780, 3836, 3857, 3890, 3930, 3986, 4028, 4125, 4237, 4376
|
||||||
|
};
|
||||||
81
firmware/target/hosted/hiby/r3proii/button-r3proii.c
Normal file
81
firmware/target/hosted/hiby/r3proii/button-r3proii.c
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Marcin Bukat
|
||||||
|
* Copyright (C) 2025 by Melissa Autumn
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#include <linux/input.h>
|
||||||
|
|
||||||
|
#include "sysfs.h"
|
||||||
|
#include "button.h"
|
||||||
|
#include "button-target.h"
|
||||||
|
#include "hibylinux_codec.h"
|
||||||
|
#include "touchscreen.h"
|
||||||
|
#ifdef HAVE_BACKLIGHT
|
||||||
|
#include "backlight.h"
|
||||||
|
#endif /* HAVE_BACKLIGHT */
|
||||||
|
/*
|
||||||
|
* /dev/input/event0: gpios (power/next)
|
||||||
|
* /dev/input/event1: touchscreen
|
||||||
|
* /dev/input/event2: adc (prev/play/left/right)
|
||||||
|
* /dev/input/event3: ????
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
int button_map(int keycode)
|
||||||
|
{
|
||||||
|
switch(keycode)
|
||||||
|
{
|
||||||
|
case KEY_VOLUMEDOWN:
|
||||||
|
return BUTTON_VOL_DOWN;
|
||||||
|
case KEY_VOLUMEUP:
|
||||||
|
return BUTTON_VOL_UP;
|
||||||
|
case KEY_PLAYPAUSE:
|
||||||
|
return BUTTON_PLAY;
|
||||||
|
case KEY_NEXTSONG:
|
||||||
|
return BUTTON_NEXT;
|
||||||
|
case KEY_PREVIOUSSONG:
|
||||||
|
return BUTTON_PREV;
|
||||||
|
case KEY_POWER:
|
||||||
|
return BUTTON_POWER;
|
||||||
|
case BTN_TOUCH:
|
||||||
|
{
|
||||||
|
#ifdef HAVE_BACKLIGHT
|
||||||
|
if (is_backlight_on(true)) {
|
||||||
|
return BUTTON_TOUCH;
|
||||||
|
}
|
||||||
|
// Ignore
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
return BUTTON_TOUCH
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool headphones_inserted(void)
|
||||||
|
{
|
||||||
|
#ifdef BOOTLOADER
|
||||||
|
int ps = 0;
|
||||||
|
#else
|
||||||
|
int ps = hiby_get_outputs();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return (ps == 2 || ps == 3);
|
||||||
|
}
|
||||||
60
firmware/target/hosted/hiby/r3proii/button-target.h
Normal file
60
firmware/target/hosted/hiby/r3proii/button-target.h
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 by Melissa Autumn
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef _BUTTON_TARGET_H_
|
||||||
|
#define _BUTTON_TARGET_H_
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
/* Main unit's buttons */
|
||||||
|
#define BUTTON_POWER 0x00000001
|
||||||
|
#define BUTTON_PREV 0x00000002
|
||||||
|
#define BUTTON_NEXT 0x00000004
|
||||||
|
#define BUTTON_PLAY 0x00000008
|
||||||
|
#define BUTTON_VOL_UP 0x00000010
|
||||||
|
#define BUTTON_VOL_DOWN 0x00000020
|
||||||
|
#define BUTTON_MAIN 0x0000003f
|
||||||
|
|
||||||
|
#define BUTTON_TOUCH 0x00000040
|
||||||
|
|
||||||
|
/* Touchscreen virtual buttons */
|
||||||
|
#define BUTTON_TOPLEFT 0x00001000
|
||||||
|
#define BUTTON_TOPMIDDLE 0x00002000
|
||||||
|
#define BUTTON_TOPRIGHT 0x00004000
|
||||||
|
#define BUTTON_MIDLEFT 0x00008000
|
||||||
|
#define BUTTON_CENTER 0x00010000
|
||||||
|
#define BUTTON_MIDRIGHT 0x00020000
|
||||||
|
#define BUTTON_BOTTOMLEFT 0x00040000
|
||||||
|
#define BUTTON_BOTTOMMIDDLE 0x00080000
|
||||||
|
#define BUTTON_BOTTOMRIGHT 0x00100000
|
||||||
|
|
||||||
|
/* Software power-off */
|
||||||
|
#define POWEROFF_BUTTON BUTTON_POWER
|
||||||
|
#define POWEROFF_COUNT 25
|
||||||
|
|
||||||
|
/* For the simulator/sdl plugins/xworld */
|
||||||
|
#ifndef BOOTLOADER
|
||||||
|
#define BUTTON_LEFT BUTTON_NEXT
|
||||||
|
#define BUTTON_RIGHT BUTTON_PREV
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int button_map(int keycode);
|
||||||
|
|
||||||
|
#endif /* _BUTTON_TARGET_H_ */
|
||||||
132
firmware/target/hosted/hiby/r3proii/led-r3proii.c
Normal file
132
firmware/target/hosted/hiby/r3proii/led-r3proii.c
Normal file
|
|
@ -0,0 +1,132 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 Melissa Autumn
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "config.h"
|
||||||
|
#include "backlight-target.h"
|
||||||
|
#include "sysfs.h"
|
||||||
|
#include "panic.h"
|
||||||
|
#include "lcd.h"
|
||||||
|
#include "settings.h"
|
||||||
|
#include "power.h"
|
||||||
|
|
||||||
|
static const char * const sysfs_led_type =
|
||||||
|
"/sys/class/leds/sgm31324-leds/led_pattern";
|
||||||
|
|
||||||
|
/* Ref: https://guide.hiby.com/en/docs/products/audio_player/hiby_r3proii/guide#led-indicator-light
|
||||||
|
|
||||||
|
Defined in leds_sgm31324_add.sh (off is defined in driver)
|
||||||
|
|
||||||
|
...
|
||||||
|
echo regs="00000000540001010706" > sgm31324
|
||||||
|
echo regs="000000004500380B0000" > sgm31324
|
||||||
|
echo regs="00000000540000060600" > sgm31324
|
||||||
|
echo regs="00000000450040040000" > sgm31324
|
||||||
|
echo regs="00000000000000000006" > sgm31324
|
||||||
|
echo regs="001E7D0042BB2F000006" > sgm31324
|
||||||
|
echo regs="000E7D0042663F000006" > sgm31324
|
||||||
|
echo regs="00000000440000050006" > sgm31324
|
||||||
|
echo regs="00000000540000000D06" > sgm31324
|
||||||
|
echo regs="0000000051001C000506" > sgm31324
|
||||||
|
echo regs="00000000000000000006" > sgm31324
|
||||||
|
...
|
||||||
|
|
||||||
|
*/
|
||||||
|
enum R3PROII_LED_PATTERNS {
|
||||||
|
LED_PATTERN_INVALID = -1,
|
||||||
|
LED_PATTERN_OFF = 0,
|
||||||
|
LED_PATTERN_LIGHT_BLUE,
|
||||||
|
LED_PATTERN_YELLOW,
|
||||||
|
LED_PATTERN_CYAN,
|
||||||
|
LED_PATTERN_ORANGE,
|
||||||
|
LED_PATTERN_UNK_1, /* This might do something, but it seems to just be off */
|
||||||
|
LED_PATTERN_NORMAL_RED_BLINK,
|
||||||
|
LED_PATTERN_FAST_RED_BLINK,
|
||||||
|
LED_PATTERN_GREEN,
|
||||||
|
LED_PATTERN_BLUE, /* A slightly more blue blue */
|
||||||
|
LED_PATTERN_PINK,
|
||||||
|
LED_PATTERN_WHITE,
|
||||||
|
};
|
||||||
|
|
||||||
|
int _last_buttonlight = LED_PATTERN_INVALID;
|
||||||
|
|
||||||
|
void _set_pattern(enum R3PROII_LED_PATTERNS pattern) {
|
||||||
|
if (_last_buttonlight != pattern) {
|
||||||
|
_last_buttonlight = pattern;
|
||||||
|
sysfs_set_int(sysfs_led_type, _last_buttonlight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_GENERAL_PURPOSE_LED
|
||||||
|
void led_hw_brightness(int brightness)
|
||||||
|
{
|
||||||
|
(void)brightness;
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_hw_charged(void)
|
||||||
|
{
|
||||||
|
if (global_settings.use_led_indicators) {
|
||||||
|
_set_pattern(LED_PATTERN_GREEN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_hw_charging(void)
|
||||||
|
{
|
||||||
|
_set_pattern(LED_PATTERN_NORMAL_RED_BLINK);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_hw_off(void)
|
||||||
|
{
|
||||||
|
// Don't turn off led if charging
|
||||||
|
if (_last_buttonlight != LED_PATTERN_NORMAL_RED_BLINK) {
|
||||||
|
_set_pattern(LED_PATTERN_OFF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_hw_on(void)
|
||||||
|
{
|
||||||
|
if (charging_state()) {
|
||||||
|
led_hw_charging();
|
||||||
|
} else {
|
||||||
|
if (global_settings.use_led_indicators) {
|
||||||
|
_set_pattern(LED_PATTERN_LIGHT_BLUE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
led_hw_off();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_hw_set_mode(bool mode)
|
||||||
|
{
|
||||||
|
if (mode) {
|
||||||
|
led_hw_on();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
led_hw_off();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
42
firmware/target/hosted/hiby/r3proii/powermgmt-r3proii.c
Normal file
42
firmware/target/hosted/hiby/r3proii/powermgmt-r3proii.c
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Marcin Bukat
|
||||||
|
* Copyright (C) 2025 by Melissa Autumn
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#include "powermgmt.h"
|
||||||
|
#include "power.h"
|
||||||
|
|
||||||
|
/* FIXME: Haven't adjusted these values besides max voltage */
|
||||||
|
// max voltage is 4370
|
||||||
|
|
||||||
|
unsigned short battery_level_disksafe = 3470;
|
||||||
|
|
||||||
|
/* the OF shuts down at this voltage */
|
||||||
|
unsigned short battery_level_shutoff = 3400;
|
||||||
|
|
||||||
|
/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
|
||||||
|
unsigned short percent_to_volt_discharge[11] =
|
||||||
|
{
|
||||||
|
3400, 3675, 3715, 3750, 3775, 3810, 3850, 4028, 4125, 4237, 4376
|
||||||
|
};
|
||||||
|
|
||||||
|
/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
|
||||||
|
unsigned short percent_to_volt_charge[11] =
|
||||||
|
{
|
||||||
|
3485, 3780, 3836, 3857, 3890, 3930, 3986, 4028, 4125, 4237, 4376
|
||||||
|
};
|
||||||
29
firmware/target/hosted/hiby/system-target.h
Normal file
29
firmware/target/hosted/hiby/system-target.h
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Marcin Bukat
|
||||||
|
* Copyright (C) 2016 Amaury Pouly
|
||||||
|
* Copyright (C) 2025 by Melissa Autumn
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef __SYSTEM_TARGET_H__
|
||||||
|
#define __SYSTEM_TARGET_H__
|
||||||
|
|
||||||
|
#include "kernel-unix.h"
|
||||||
|
#include "system-hosted.h"
|
||||||
|
|
||||||
|
#define NEED_GENERIC_BYTESWAPS
|
||||||
|
#endif /* __SYSTEM_TARGET_H__ */
|
||||||
323
firmware/target/hosted/hiby/usb-hiby-gadget.c
Normal file
323
firmware/target/hosted/hiby/usb-hiby-gadget.c
Normal file
|
|
@ -0,0 +1,323 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 by Marcin Bukat
|
||||||
|
* Copyright (C) 2025 by Melissa Autumn
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <dirent.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include "config.h"
|
||||||
|
#include "dir.h"
|
||||||
|
#include "disk.h"
|
||||||
|
#include "usb.h"
|
||||||
|
#include "sysfs.h"
|
||||||
|
#include "power.h"
|
||||||
|
#include "usb-hiby-gadget.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_GENERAL_PURPOSE_LED
|
||||||
|
#include "led-general-purpose.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LOGF_ENABLE
|
||||||
|
#include "logf.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
static int _usb_mode = -1;
|
||||||
|
static bool _usb_init = false;
|
||||||
|
static bool is_adb_running = false;
|
||||||
|
|
||||||
|
void enable_adb(void);
|
||||||
|
void enable_mass_storage(void);
|
||||||
|
void enable_charging(void);
|
||||||
|
void enable_usb_audio(void);
|
||||||
|
|
||||||
|
void disable_adb(void);
|
||||||
|
void disable_mass_storage(void);
|
||||||
|
void disable_usb_audio(void);
|
||||||
|
|
||||||
|
#ifdef HAVE_MULTIDRIVE
|
||||||
|
void cleanup_rbhome(void);
|
||||||
|
void startup_rbhome(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void hiby_set_usb_mode(int mode) {
|
||||||
|
logf(">>>>>>>>>>>>>>>>> hiby_set_usb_mode(%d)\n", mode);
|
||||||
|
if (!_usb_init) {
|
||||||
|
logf("Need to init usb!\n");
|
||||||
|
usb_init_device();
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(mode) {
|
||||||
|
case USB_MODE_MASS_STORAGE:
|
||||||
|
logf("Enabling Mass Storage\n");
|
||||||
|
enable_mass_storage();
|
||||||
|
break;
|
||||||
|
case USB_MODE_CHARGE:
|
||||||
|
logf("Enabling Charge\n");
|
||||||
|
enable_charging();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
_usb_mode = mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO: implement usb detection properly */
|
||||||
|
int usb_detect(void)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_GENERAL_PURPOSE_LED
|
||||||
|
led_hw_on();
|
||||||
|
#endif
|
||||||
|
return power_input_status() == POWER_INPUT_USB_CHARGER ? USB_INSERTED : USB_EXTRACTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
void usb_enable(bool on)
|
||||||
|
{
|
||||||
|
logf(">>>>>>>>>>>>>>>>> usb_enable(%d)\n", on);
|
||||||
|
logf("usb enable %d %d\n", on, _usb_mode);
|
||||||
|
|
||||||
|
/* Ignore usb enable/disable when ADB is enabled so we can fireup adb shell
|
||||||
|
* without entering ums mode
|
||||||
|
*/
|
||||||
|
//if (_usb_mode != USB_MODE_ADB) {
|
||||||
|
sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/UDC", on ? "13500000.otg_new" : "");
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This is called by usb thread after usb extract in order to return
|
||||||
|
* regular FS access
|
||||||
|
*
|
||||||
|
* returns the # of successful mounts
|
||||||
|
*/
|
||||||
|
int disk_mount_all(void)
|
||||||
|
{
|
||||||
|
logf(">>>>>>>>>>>>>>>>> disk_mount_all()\n");
|
||||||
|
|
||||||
|
#ifdef HAVE_MULTIDRIVE
|
||||||
|
startup_rbhome();
|
||||||
|
#endif
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This is called by usb thread after all threads ACKs usb inserted message
|
||||||
|
*
|
||||||
|
* returns the # of successful unmounts
|
||||||
|
*/
|
||||||
|
int disk_unmount_all(void)
|
||||||
|
{
|
||||||
|
// We're always mounted as rockbox lives on the sdcard
|
||||||
|
logf(">>>>>>>>>>>>>>>>> disk_unmount_all()\n");
|
||||||
|
|
||||||
|
#ifdef HAVE_MULTIDRIVE
|
||||||
|
cleanup_rbhome();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MULTIDRIVE
|
||||||
|
startup_rbhome();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void enable_charging(void) {
|
||||||
|
logf(">>>>>>>>>>>>>>>>> enable_charging()\n");
|
||||||
|
|
||||||
|
disable_mass_storage();
|
||||||
|
disable_adb();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
void enable_adb(void) {
|
||||||
|
logf(">>>>>>>>>>>>>>>>> set_adb()\n");
|
||||||
|
|
||||||
|
// Disable mass storage if it was running
|
||||||
|
disable_mass_storage();
|
||||||
|
|
||||||
|
// Remove any lingering adb daemon
|
||||||
|
system("killall -9 adbd");
|
||||||
|
|
||||||
|
system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409");
|
||||||
|
system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/functions/ffs.adb");
|
||||||
|
|
||||||
|
// Now we'll override configuration and MaxPower
|
||||||
|
sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", "adb");
|
||||||
|
sysfs_set_int("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", 120);
|
||||||
|
|
||||||
|
// And link up the adb function to the usb gadget config
|
||||||
|
system("ln -s /sys/kernel/config/usb_gadget/adb_demo/functions/ffs.adb /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/");
|
||||||
|
|
||||||
|
int is_mounted = !system("mountpoint -q /dev/usb-ffs/adb");
|
||||||
|
|
||||||
|
if (!is_mounted) {
|
||||||
|
system("mkdir -p /dev/usb-ffs/adb");
|
||||||
|
/* This seems to fail, but adb will still work and then it will be mounted. Not sure what's up here... */
|
||||||
|
system("mount -t functionfs adb /dev/usb-ffs/adb");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Boot adb daemon
|
||||||
|
system("/usr/bin/adbd &");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void disable_adb(void) {
|
||||||
|
// Remove any lingering adb daemon
|
||||||
|
system("killall -9 adbd");
|
||||||
|
|
||||||
|
// Remove the adb link to config
|
||||||
|
if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/ffs.adb", F_OK) == 0) {
|
||||||
|
system("rm /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/ffs.adb");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the adb function
|
||||||
|
if (access("/sys/kernel/config/usb_gadget/adb_demo/functions/ffs.adb", F_OK) == 0) {
|
||||||
|
system("rm -rf /sys/kernel/config/usb_gadget/adb_demo/functions/ffs.adb");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset the MaxPower to its default value
|
||||||
|
if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", F_OK) == 0) {
|
||||||
|
sysfs_set_int("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", 120);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable storage or adb configs
|
||||||
|
if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", F_OK) == 0) {
|
||||||
|
sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unmount adb
|
||||||
|
if (!system("mountpoint -q /dev/usb-ffs/adb")) {
|
||||||
|
system("unmount /dev/usb-ffs/adb");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void enable_adb(void) {}
|
||||||
|
void disable_adb(void) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void enable_mass_storage(void) {
|
||||||
|
logf(">>>>>>>>>>>>>>>>> set_mass_storage()\n");
|
||||||
|
|
||||||
|
// Disable adb if it's running
|
||||||
|
disable_adb();
|
||||||
|
|
||||||
|
system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/functions/mass_storage.0/lun.0");
|
||||||
|
system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409");
|
||||||
|
|
||||||
|
if (is_adb_running) {
|
||||||
|
sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", "adb,storage");
|
||||||
|
} else {
|
||||||
|
sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", "storage");
|
||||||
|
}
|
||||||
|
sysfs_set_int("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", 120);
|
||||||
|
|
||||||
|
system("ln -s /sys/kernel/config/usb_gadget/adb_demo/functions/mass_storage.0 /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/");
|
||||||
|
|
||||||
|
char mount_device[32] = "/dev/mmcblk0p1";
|
||||||
|
|
||||||
|
// If partition 1 doesn't exist we'll try the main device
|
||||||
|
if (access(mount_device, F_OK) != 0) {
|
||||||
|
memset(mount_device, 0, sizeof(mount_device));
|
||||||
|
strcpy(mount_device, "/dev/mmcblk0");
|
||||||
|
}
|
||||||
|
|
||||||
|
sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/functions/mass_storage.0/lun.0/file", mount_device);
|
||||||
|
}
|
||||||
|
|
||||||
|
void disable_mass_storage(void) {
|
||||||
|
// Remove the mass_storage.0 link to config
|
||||||
|
if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/mass_storage.0", F_OK) == 0) {
|
||||||
|
system("rm /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/mass_storage.0");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the mass_storage.0 function
|
||||||
|
if (access("/sys/kernel/config/usb_gadget/adb_demo/functions/mass_storage.0", F_OK) == 0) {
|
||||||
|
system("rm -rf /sys/kernel/config/usb_gadget/adb_demo/functions/mass_storage.0");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset the MaxPower to its default value
|
||||||
|
if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", F_OK) == 0) {
|
||||||
|
sysfs_set_int("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/MaxPower", 120);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disable storage or adb configs
|
||||||
|
if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", F_OK) == 0) {
|
||||||
|
sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_USB_AUDIO)
|
||||||
|
void enable_usb_audio(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void disable_usb_audio(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void enable_usb_audio(void) {}
|
||||||
|
void disable_usb_audio(void) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void usb_init_device(void)
|
||||||
|
{
|
||||||
|
logf(">>>>>>>>>>>>>>>>> usb_init_device()\n");
|
||||||
|
if (_usb_init) {
|
||||||
|
logf("usb is already init, skipping!\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
char functions[128] = {0};
|
||||||
|
|
||||||
|
/* Before we can do anything here we need to mount configfs */
|
||||||
|
int is_mounted = !system("mountpoint -q /sys/kernel/config");
|
||||||
|
|
||||||
|
if (!is_mounted && system("mount -t configfs none /sys/kernel/config")) {
|
||||||
|
logf("mount configfs failed, can't do usb functionality! ErrNo: %d\n", errno);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_usb_init = true;
|
||||||
|
|
||||||
|
system("ls -la /sys/kernel/config/usb_gadget");
|
||||||
|
|
||||||
|
/* os_mkdir doesn't seem to work here for whatever reason */
|
||||||
|
system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo");
|
||||||
|
system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/strings/0x409");
|
||||||
|
|
||||||
|
system("ls -la /sys/kernel/config/usb_gadget/adb_demo");
|
||||||
|
system("ls -la /sys/kernel/config/usb_gadget/adb_demo/configs/");
|
||||||
|
|
||||||
|
system("mkdir -p /sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409");
|
||||||
|
|
||||||
|
/* Check if ADB was activated in bootloader */
|
||||||
|
logf("checking if adb is already on\n");
|
||||||
|
|
||||||
|
if (access("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", F_OK) == 0) {
|
||||||
|
logf("found usb config string!\n");
|
||||||
|
|
||||||
|
sysfs_get_string("/sys/kernel/config/usb_gadget/adb_demo/configs/c.1/strings/0x409/configuration", functions, sizeof(functions));
|
||||||
|
is_adb_running = (strstr(functions, "adb") == NULL) ? false : true;
|
||||||
|
}
|
||||||
|
|
||||||
|
sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/strings/0x409/manufacturer", "Rockbox.org");
|
||||||
|
sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/strings/0x409/product", "Rockbox media player");
|
||||||
|
sysfs_set_string("/sys/kernel/config/usb_gadget/adb_demo/strings/0x409/serialnumber", "0123456789ABCDEF");
|
||||||
|
}
|
||||||
30
firmware/target/hosted/hiby/usb-hiby-gadget.h
Normal file
30
firmware/target/hosted/hiby/usb-hiby-gadget.h
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
*
|
||||||
|
* Copyright (C) 2025 by Melissa Autumn
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
#ifndef __USB_HIBY_H__
|
||||||
|
#define __USB_HIBY_H__
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the setting and unsetting of adb usb mode
|
||||||
|
*/
|
||||||
|
void hiby_set_usb_mode(int mode);
|
||||||
|
|
||||||
|
#endif /* __USB_HIBY_H__ */
|
||||||
|
|
@ -39,6 +39,7 @@
|
||||||
# define BATTERY_VOLTAGE_PATH BATTERY_SYSFS_PATH "/voltage_now"
|
# define BATTERY_VOLTAGE_PATH BATTERY_SYSFS_PATH "/voltage_now"
|
||||||
# define BATTERY_CURRENT_PATH BATTERY_SYSFS_PATH "/current_now"
|
# define BATTERY_CURRENT_PATH BATTERY_SYSFS_PATH "/current_now"
|
||||||
# define BATTERY_LEVEL_PATH BATTERY_SYSFS_PATH "/capacity"
|
# define BATTERY_LEVEL_PATH BATTERY_SYSFS_PATH "/capacity"
|
||||||
|
# define BATTERY_TTE_PATH BATTERY_SYSFS_PATH "/time_to_empty_now"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Voltage is normally in microvolts */
|
/* Voltage is normally in microvolts */
|
||||||
|
|
@ -116,6 +117,16 @@ int _battery_level(void)
|
||||||
return (level * BATTERY_LEVEL_SCALE_MUL) / BATTERY_LEVEL_SCALE_DIV;
|
return (level * BATTERY_LEVEL_SCALE_MUL) / BATTERY_LEVEL_SCALE_DIV;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (CONFIG_BATTERY_MEASURE & TIME_MEASURE)
|
||||||
|
int _battery_time(void)
|
||||||
|
{
|
||||||
|
int battery_tte = 0;
|
||||||
|
sysfs_get_int(BATTERY_TTE_PATH, &battery_tte);
|
||||||
|
|
||||||
|
return battery_tte;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned int power_input_status(void)
|
unsigned int power_input_status(void)
|
||||||
|
|
|
||||||
|
|
@ -544,6 +544,20 @@
|
||||||
#define UI_LCD_POSY 78
|
#define UI_LCD_POSY 78
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(HIBY_R3PROII)
|
||||||
|
#define UI_TITLE "Hiby R3 Pro II"
|
||||||
|
#define UI_WIDTH 645
|
||||||
|
#define UI_HEIGHT 924
|
||||||
|
#define UI_LCD_POSX 79
|
||||||
|
#define UI_LCD_POSY 63
|
||||||
|
|
||||||
|
#elif defined(HIBY_R1)
|
||||||
|
#define UI_TITLE "Hiby R1"
|
||||||
|
#define UI_WIDTH 634
|
||||||
|
#define UI_HEIGHT 1016
|
||||||
|
#define UI_LCD_POSX 77
|
||||||
|
#define UI_LCD_POSY 74
|
||||||
|
|
||||||
#elif defined(SIMULATOR)
|
#elif defined(SIMULATOR)
|
||||||
#error no UI defines
|
#error no UI defines
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,11 @@ static void sig_handler(int sig, siginfo_t *siginfo, void *context)
|
||||||
unsigned long pc = uc->uc_mcontext.pc;
|
unsigned long pc = uc->uc_mcontext.pc;
|
||||||
unsigned long sp = uc->uc_mcontext.gregs[29];
|
unsigned long sp = uc->uc_mcontext.gregs[29];
|
||||||
|
|
||||||
lcd_putsf(0, line++, "%s at %08x", strsignal(sig), pc);
|
lcd_putsf(0, line++, "%s at %08lx", strsignal(sig), pc);
|
||||||
|
|
||||||
if(sig == SIGILL || sig == SIGFPE || sig == SIGSEGV || sig == SIGBUS || sig == SIGTRAP)
|
if(sig == SIGILL || sig == SIGFPE || sig == SIGSEGV || sig == SIGBUS || sig == SIGTRAP) {
|
||||||
lcd_putsf(0, line++, "address %p", siginfo->si_addr);
|
lcd_putsf(0, line++, "address %p", siginfo->si_addr);
|
||||||
|
}
|
||||||
|
|
||||||
if(!triggered)
|
if(!triggered)
|
||||||
{
|
{
|
||||||
|
|
@ -82,7 +83,10 @@ static void sig_handler(int sig, siginfo_t *siginfo, void *context)
|
||||||
|
|
||||||
system_exception_wait(); /* If this returns, try to reboot */
|
system_exception_wait(); /* If this returns, try to reboot */
|
||||||
system_reboot();
|
system_reboot();
|
||||||
while (1); /* halt */
|
while (1) {
|
||||||
|
// Make sure we're not throttling the cpu
|
||||||
|
usleep(1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void power_off(void)
|
void power_off(void)
|
||||||
|
|
@ -90,7 +94,10 @@ void power_off(void)
|
||||||
backlight_hw_off();
|
backlight_hw_off();
|
||||||
sync();
|
sync();
|
||||||
system("/sbin/poweroff");
|
system("/sbin/poweroff");
|
||||||
while (1); /* halt */
|
while (1) {
|
||||||
|
// Make sure we're not throttling the cpu
|
||||||
|
usleep(1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void system_init(void)
|
void system_init(void)
|
||||||
|
|
@ -117,7 +124,10 @@ void system_reboot(void)
|
||||||
{
|
{
|
||||||
backlight_hw_off();
|
backlight_hw_off();
|
||||||
system("/sbin/reboot");
|
system("/sbin/reboot");
|
||||||
while (1); /* halt */
|
while (1) {
|
||||||
|
// Make sure we're not throttling the cpu
|
||||||
|
usleep(1000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void system_exception_wait(void)
|
void system_exception_wait(void)
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,10 @@
|
||||||
#include "gui/skin_engine/skin_engine.h"
|
#include "gui/skin_engine/skin_engine.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HIBY_R3PROII) || defined(HIBY_R1)
|
||||||
|
#include "usb-hiby-gadget.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(IPOD_ACCESSORY_PROTOCOL)
|
#if defined(IPOD_ACCESSORY_PROTOCOL)
|
||||||
#include "iap.h"
|
#include "iap.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -161,6 +165,8 @@ void usb_set_mode(int mode)
|
||||||
usb_mode = mode;
|
usb_mode = mode;
|
||||||
#if defined(DX50) || defined(DX90)
|
#if defined(DX50) || defined(DX90)
|
||||||
ibasso_set_usb_mode(mode);
|
ibasso_set_usb_mode(mode);
|
||||||
|
#elif defined(HIBY_R3PROII) || defined(HIBY_R1)
|
||||||
|
hiby_set_usb_mode(mode);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -660,7 +660,9 @@ sub buildzip {
|
||||||
# until buildwps.pl is fixed, manually copy the classic_statusbar theme across
|
# until buildwps.pl is fixed, manually copy the classic_statusbar theme across
|
||||||
mkdir "$temp_dir/wps/classic_statusbar", 0777;
|
mkdir "$temp_dir/wps/classic_statusbar", 0777;
|
||||||
glob_copy("$ROOT/wps/classic_statusbar/*.bmp", "$temp_dir/wps/classic_statusbar");
|
glob_copy("$ROOT/wps/classic_statusbar/*.bmp", "$temp_dir/wps/classic_statusbar");
|
||||||
if ($depth == 16) {
|
if ($depth >= 16 && $height > 480) {
|
||||||
|
copy("$ROOT/wps/classic_statusbar.24.sbs", "$temp_dir/wps/classic_statusbar.sbs");
|
||||||
|
} elsif ($depth == 16) {
|
||||||
copy("$ROOT/wps/classic_statusbar.sbs", "$temp_dir/wps");
|
copy("$ROOT/wps/classic_statusbar.sbs", "$temp_dir/wps");
|
||||||
} elsif ($depth > 1) {
|
} elsif ($depth > 1) {
|
||||||
copy("$ROOT/wps/classic_statusbar.grey.sbs", "$temp_dir/wps/classic_statusbar.sbs");
|
copy("$ROOT/wps/classic_statusbar.grey.sbs", "$temp_dir/wps/classic_statusbar.sbs");
|
||||||
|
|
|
||||||
61
tools/configure
vendored
61
tools/configure
vendored
|
|
@ -1736,11 +1736,15 @@ cat <<EOF
|
||||||
244) M3K Linux 249) Eros Q / K native
|
244) M3K Linux 249) Eros Q / K native
|
||||||
246) M3K baremetal ==xDuoo== (hw4 bl only)
|
246) M3K baremetal ==xDuoo== (hw4 bl only)
|
||||||
241) X3
|
241) X3
|
||||||
==Shanling== 242) X3II ==Nintendo==
|
==Shanling== 242) X3II ==HiBy==
|
||||||
260) Q1 243) X20 290) Nintendo 3DS (WIP)
|
260) Q1 243) X20 300) R3 Pro II
|
||||||
|
301) R1
|
||||||
==Echo project== ==Surfans==
|
==Echo project== ==Surfans==
|
||||||
270) Echo R1 (WIP) 280) F28 (WIP)
|
270) Echo R1 (WIP) 280) F28 (WIP)
|
||||||
|
|
||||||
|
==Nintendo==
|
||||||
|
290) Nintendo 3DS (WIP)
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
buildfor=`input`;
|
buildfor=`input`;
|
||||||
|
|
@ -4389,6 +4393,57 @@ fi
|
||||||
t_model="app"
|
t_model="app"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
300|hibyr3proii)
|
||||||
|
target_id=123
|
||||||
|
application=yes
|
||||||
|
app_type="hibyos"
|
||||||
|
modelname="hibyr3proii"
|
||||||
|
target="HIBY_R3PROII"
|
||||||
|
memory=16 # The device has 64mb but let's make sure it still boots with things in the background
|
||||||
|
mipsellinuxcc
|
||||||
|
tool="cp "
|
||||||
|
boottool="cp "
|
||||||
|
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
|
||||||
|
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
|
||||||
|
output="rockbox.r3proii"
|
||||||
|
bootoutput="bootloader.r3proii"
|
||||||
|
appextra="recorder:gui:hosted"
|
||||||
|
plugins="yes"
|
||||||
|
# architecture, manufacturer and model for the target-tree build
|
||||||
|
# These align with
|
||||||
|
t_cpu="hosted"
|
||||||
|
t_manufacturer="hiby"
|
||||||
|
t_model="r3proii"
|
||||||
|
sysfontbl="24-Terminus"
|
||||||
|
sysfont="20-Terminus"
|
||||||
|
;;
|
||||||
|
|
||||||
|
301|hibyr1)
|
||||||
|
target_id=124
|
||||||
|
application=yes
|
||||||
|
app_type="hibyos"
|
||||||
|
modelname="hibyr1"
|
||||||
|
target="HIBY_R1"
|
||||||
|
memory=16 # The device has 64mb but let's make sure it still boots with things in the background
|
||||||
|
mipsellinuxcc
|
||||||
|
tool="cp "
|
||||||
|
boottool="cp "
|
||||||
|
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
|
||||||
|
bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
|
||||||
|
output="rockbox.r1"
|
||||||
|
bootoutput="bootloader.r1"
|
||||||
|
appextra="recorder:gui:hosted"
|
||||||
|
plugins="yes"
|
||||||
|
# architecture, manufacturer and model for the target-tree build
|
||||||
|
# These align with
|
||||||
|
t_cpu="hosted"
|
||||||
|
t_manufacturer="hiby"
|
||||||
|
t_model="r1"
|
||||||
|
sysfontbl="24-Terminus"
|
||||||
|
sysfont="20-Terminus"
|
||||||
|
;;
|
||||||
|
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Please select a supported target platform!"
|
echo "Please select a supported target platform!"
|
||||||
exit 7
|
exit 7
|
||||||
|
|
|
||||||
10
tools/r1_patcher/hiby_player.sh
Executable file
10
tools/r1_patcher/hiby_player.sh
Executable file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
killall hiby_player &>/dev/null
|
||||||
|
killall -9 hiby_player &>/dev/null
|
||||||
|
|
||||||
|
killall bootloader.r1 &>/dev/null
|
||||||
|
killall -9 bootloader.r1 &>/dev/null
|
||||||
|
|
||||||
|
/usr/bin/bootloader.r1
|
||||||
|
sleep 1s
|
||||||
133
tools/r1_patcher/r1_patcher.sh
Executable file
133
tools/r1_patcher/r1_patcher.sh
Executable file
|
|
@ -0,0 +1,133 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ $# -ne 2 ]]; then
|
||||||
|
echo 'usage: ./r1_patcher.sh r1.upt bootloader.r1' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
### init
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
currentdir=$(pwd)
|
||||||
|
updatefile="$(basename $1)"
|
||||||
|
updatefile_rb="${updatefile%.*}_rb.upt"
|
||||||
|
|
||||||
|
workingdir=$(realpath ./working_dir)
|
||||||
|
workingdir_in=$workingdir"/in"
|
||||||
|
workingdir_out=$workingdir"/out"
|
||||||
|
|
||||||
|
rm -rf $workingdir
|
||||||
|
|
||||||
|
mkdir $workingdir
|
||||||
|
mkdir $workingdir_in
|
||||||
|
mkdir $workingdir_out
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
### extract
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# extract iso
|
||||||
|
mkdir -p $workingdir_in/image_contents
|
||||||
|
7z -o$workingdir_in/image_contents x $updatefile
|
||||||
|
|
||||||
|
# create xImage (unchanged)
|
||||||
|
mkdir -p $workingdir_out/xImage
|
||||||
|
cat $workingdir_in/image_contents/ota_v0/xImage.* > $workingdir_out/xImage/xImage
|
||||||
|
|
||||||
|
# create rootfs
|
||||||
|
mkdir -p $workingdir_in/rootfs
|
||||||
|
mkdir -p $workingdir_in/rootfs/extracted
|
||||||
|
cat $workingdir_in/image_contents/ota_v0/rootfs.squashfs.* > $workingdir_in/rootfs/rootfs.squashfs
|
||||||
|
|
||||||
|
# extract rootfs
|
||||||
|
unsquashfs -f -d $workingdir_in/rootfs/extracted $workingdir_in/rootfs/rootfs.squashfs
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
### update
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# copy 'bootloader'
|
||||||
|
cp $2 $workingdir_in/rootfs/extracted/usr/bin/
|
||||||
|
|
||||||
|
# copy modified 'hibyplayer.sh' script
|
||||||
|
cp hiby_player.sh $workingdir_in/rootfs/extracted/usr/bin/
|
||||||
|
chmod 0755 $workingdir_in/rootfs/extracted/usr/bin/hiby_player.sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
### rebuild
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
mkdir "$workingdir_out/image_contents"
|
||||||
|
mkdir "$workingdir_out/image_contents/ota_v0"
|
||||||
|
|
||||||
|
mksquashfs $workingdir_in/rootfs/extracted $workingdir_out/rootfs.squashfs -comp lzo
|
||||||
|
|
||||||
|
cd "$workingdir_out/image_contents/ota_v0"
|
||||||
|
|
||||||
|
# rootfs.squashfs
|
||||||
|
split -b 512k $workingdir_out/rootfs.squashfs --numeric-suffixes=0 -a 4 rootfs.squashfs.
|
||||||
|
|
||||||
|
rootfs_md5=($(md5sum $workingdir_out/rootfs.squashfs))
|
||||||
|
rootfs_size=$(stat -c%s "$workingdir_out/rootfs.squashfs")
|
||||||
|
md5=$rootfs_md5
|
||||||
|
|
||||||
|
ota_md5_rootfs="ota_md5_rootfs.squashfs.$md5"
|
||||||
|
|
||||||
|
parts=`find . -name 'rootfs.squashfs.*'`
|
||||||
|
for part in $parts; do
|
||||||
|
md5next=($(md5sum $part))
|
||||||
|
echo $md5next >> $ota_md5_rootfs
|
||||||
|
mv $part "$part.$md5"
|
||||||
|
md5=$md5next
|
||||||
|
done
|
||||||
|
|
||||||
|
# xImage
|
||||||
|
split -b 512k $workingdir_out/xImage/xImage --numeric-suffixes=0 -a 4 xImage.
|
||||||
|
|
||||||
|
ximage_md5=($(md5sum $workingdir_out/xImage/xImage))
|
||||||
|
ximage_size=$(stat -c%s "$workingdir_out/xImage/xImage")
|
||||||
|
md5=$ximage_md5
|
||||||
|
|
||||||
|
ota_md5_xImage="ota_md5_xImage.$md5"
|
||||||
|
|
||||||
|
parts=`find . -name 'xImage.*'`
|
||||||
|
for part in $parts; do
|
||||||
|
md5next=($(md5sum $part))
|
||||||
|
echo $md5next >> $ota_md5_xImage
|
||||||
|
mv $part "$part.$md5"
|
||||||
|
md5=$md5next
|
||||||
|
done
|
||||||
|
|
||||||
|
# ota_update.in
|
||||||
|
|
||||||
|
echo "ota_version=0
|
||||||
|
|
||||||
|
img_type=kernel
|
||||||
|
img_name=xImage
|
||||||
|
img_size=$ximage_size
|
||||||
|
img_md5=$ximage_md5
|
||||||
|
|
||||||
|
img_type=rootfs
|
||||||
|
img_name=rootfs.squashfs
|
||||||
|
img_size=$rootfs_size
|
||||||
|
img_md5=$rootfs_md5
|
||||||
|
" > ota_update.in
|
||||||
|
|
||||||
|
echo > ota_v0.ok
|
||||||
|
|
||||||
|
# ota_config.in
|
||||||
|
cd "$workingdir_out/image_contents"
|
||||||
|
|
||||||
|
echo "current_version=0" > ota_config.in
|
||||||
|
|
||||||
|
# iso
|
||||||
|
genisoimage -f -U -J -joliet-long -r -allow-lowercase -allow-multidot -o $currentdir/$updatefile_rb $workingdir_out/image_contents/
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
### cleanup
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
rm -rf $workingdir
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
@ -105,6 +105,8 @@ endif
|
||||||
ifneq (,$(findstring bootloader,$(APPSDIR)))
|
ifneq (,$(findstring bootloader,$(APPSDIR)))
|
||||||
ifneq (,$(findstring sonynwz,$(APP_TYPE)))
|
ifneq (,$(findstring sonynwz,$(APP_TYPE)))
|
||||||
include $(ROOTDIR)/firmware/target/hosted/sonynwz/sonynwz.make
|
include $(ROOTDIR)/firmware/target/hosted/sonynwz/sonynwz.make
|
||||||
|
else ifneq (,$(findstring hiby_x1600,$(APP_TYPE)))
|
||||||
|
include $(ROOTDIR)/firmware/target/hosted/hiby/hiby.make
|
||||||
else ifneq (,$(findstring hibyos,$(APP_TYPE)))
|
else ifneq (,$(findstring hibyos,$(APP_TYPE)))
|
||||||
include $(ROOTDIR)/firmware/target/hosted/hibyos.make
|
include $(ROOTDIR)/firmware/target/hosted/hibyos.make
|
||||||
else ifneq (,$(findstring fiio,$(APP_TYPE)))
|
else ifneq (,$(findstring fiio,$(APP_TYPE)))
|
||||||
|
|
@ -149,6 +151,10 @@ else # core
|
||||||
include $(ROOTDIR)/firmware/target/hosted/sonynwz/sonynwz.make
|
include $(ROOTDIR)/firmware/target/hosted/sonynwz/sonynwz.make
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(findstring hiby_x1600,$(APP_TYPE)))
|
||||||
|
include $(ROOTDIR)/firmware/target/hosted/hiby/hiby.make
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq (,$(findstring hibyos,$(APP_TYPE)))
|
ifneq (,$(findstring hibyos,$(APP_TYPE)))
|
||||||
include $(ROOTDIR)/firmware/target/hosted/hibyos.make
|
include $(ROOTDIR)/firmware/target/hosted/hibyos.make
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
BIN
uisimulator/bitmaps/UI-hibyr1.bmp
Normal file
BIN
uisimulator/bitmaps/UI-hibyr1.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 MiB |
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue