From 582942016bdf3599952b343858ba9fb9785494e8 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Sat, 20 Jun 2009 10:54:13 +0000 Subject: [PATCH] * Commit a modified FS#10354 (thanks to Davide Quarta) - add support the VX747+ in scramble and configure * Add support for the VX777 * Remove the touchscreen mode switching combo from the button driver git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21379 a1c6a512-1295-4272-9138-f99709370657 --- apps/SOURCES | 2 + apps/keymaps/keymap-ondavx777.c | 171 ++++++++++++++++++ bootloader/SOURCES | 2 +- docs/CREDITS | 1 + firmware/SOURCES | 4 +- firmware/export/config-ondavx747.h | 11 +- firmware/export/config.h | 3 +- .../onda_vx747/sadc-onda_vx747.c | 15 +- tools/configure | 29 ++- tools/scramble.c | 7 +- 10 files changed, 229 insertions(+), 16 deletions(-) create mode 100644 apps/keymaps/keymap-ondavx777.c diff --git a/apps/SOURCES b/apps/SOURCES index 4caf32d822..7475826015 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -234,6 +234,8 @@ keymaps/keymap-logikdax.c keymaps/keymap-fuze.c #elif CONFIG_KEYPAD == ONDAVX747_PAD keymaps/keymap-ondavx747.c +#elif CONFIG_KEYPAD == ONDAVX777_PAD +keymaps/keymap-ondavx777.c #elif CONFIG_KEYPAD == ONDAVX767_PAD keymaps/keymap-ondavx767.c #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD diff --git a/apps/keymaps/keymap-ondavx777.c b/apps/keymaps/keymap-ondavx777.c new file mode 100644 index 0000000000..99f509b18f --- /dev/null +++ b/apps/keymaps/keymap-ondavx777.c @@ -0,0 +1,171 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2009 by Maurus Cuelenaere + * + * 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. + * + ****************************************************************************/ + +/* Button Code Definitions for the Onda VX747 target */ +/* NB: Up/Down/Left/Right are not physical buttons - touchscreen emulation */ + +#include +#include +#include + +#include "config.h" +#include "action.h" +#include "button.h" +#include "settings.h" + +/* + * The format of the list is as follows + * { Action Code, Button code, Prereq button code } + * if there's no need to check the previous button's value, use BUTTON_NONE + * Insert LAST_ITEM_IN_LIST at the end of each mapping + */ + +static const struct button_mapping button_context_standard[] = { + LAST_ITEM_IN_LIST +}; /* button_context_standard */ + + +static const struct button_mapping button_context_wps[] = { + LAST_ITEM_IN_LIST +}; /* button_context_wps */ + +static const struct button_mapping button_context_list[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_list */ + +static const struct button_mapping button_context_tree[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST) +}; /* button_context_tree */ + +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[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_settings */ + +static const struct button_mapping button_context_settings_right_is_inc[] = { + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_settingsgraphical */ + +static const struct button_mapping button_context_yesno[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_settings_yesno */ + +static const struct button_mapping button_context_colorchooser[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), +}; /* button_context_colorchooser */ + +static const struct button_mapping button_context_eq[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), +}; /* button_context_eq */ + +/** Bookmark Screen **/ +static const struct button_mapping button_context_bmark[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), +}; /* button_context_bmark */ + +static const struct button_mapping button_context_time[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), +}; /* button_context_time */ + +static const struct button_mapping button_context_quickscreen[] = { + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_quickscreen */ + +static const struct button_mapping button_context_pitchscreen[] = { +}; /* button_context_pitchcreen */ + +/** FM Radio Screen **/ +static const struct button_mapping button_context_radio[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) +}; /* button_context_radio */ + +static const struct button_mapping button_context_keyboard[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_keyboard */ + +#ifdef HAVE_USBSTACK +static const struct button_mapping button_context_usb_hid[] = { + LAST_ITEM_IN_LIST +}; /* button_context_usb_hid */ +#endif + +const struct button_mapping* target_get_context_mapping(int context) +{ + switch (context) + { + case CONTEXT_STD: + return button_context_standard; + case CONTEXT_WPS: + return button_context_wps; + + case CONTEXT_LIST: + return button_context_list; + case CONTEXT_MAINMENU: + case CONTEXT_TREE: + if (global_settings.hold_lr_for_scroll_in_list) + return button_context_listtree_scroll_without_combo; + else + return button_context_listtree_scroll_with_combo; + case CONTEXT_CUSTOM|CONTEXT_TREE: + return button_context_tree; + + case CONTEXT_SETTINGS: + return button_context_settings; + case CONTEXT_CUSTOM|CONTEXT_SETTINGS: + case CONTEXT_SETTINGS_RECTRIGGER: + return button_context_settings_right_is_inc; + + 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_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_KEYBOARD: + return button_context_keyboard; +#ifdef HAVE_USBSTACK + case CONTEXT_USB_HID: + return button_context_usb_hid; +#endif + } + return button_context_standard; +} diff --git a/bootloader/SOURCES b/bootloader/SOURCES index 7ad12610d1..942467af4d 100644 --- a/bootloader/SOURCES +++ b/bootloader/SOURCES @@ -41,7 +41,7 @@ meizu_m6sl.c meizu_m6sp.c #elif defined(MEIZU_M3) meizu_m3.c -#elif defined(ONDA_VX747) || defined(ONDA_VX747P) || defined(ONDA_VX767) +#elif defined(ONDA_VX747) || defined(ONDA_VX747P) || defined(ONDA_VX767) || defined(ONDA_VX777) ondavx747.c #elif defined(CREATIVE_ZVx) creativezvm.c diff --git a/docs/CREDITS b/docs/CREDITS index 4989f677ce..14a3df6f37 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -474,6 +474,7 @@ Frederick Full Jeffrey Goode Raafat Akkad Michaƫl Burtin +Davide Quarta The libmad team The wavpack team diff --git a/firmware/SOURCES b/firmware/SOURCES index bba9ef1dc5..742a582d6f 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -1267,13 +1267,13 @@ target/mips/ingenic_jz47xx/pcm-jz4740.c drivers/nand_id.c #endif /* CONFIG_CPU == JZ4732 */ -#if defined(ONDA_VX747) || defined(ONDA_VX747P) +#if defined(ONDA_VX747) || defined(ONDA_VX747P) || defined(ONDA_VX777) target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c target/mips/ingenic_jz47xx/onda_vx747/speaker-onda_vx747.c -#endif /* ONDA_VX747 || ONDA_VX747P */ +#endif /* ONDA_VX747 || ONDA_VX747P || ONDA_VX777 */ #ifdef ONDA_VX767 target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx7X7.c diff --git a/firmware/export/config-ondavx747.h b/firmware/export/config-ondavx747.h index 9a9defcf2f..5625635c89 100644 --- a/firmware/export/config-ondavx747.h +++ b/firmware/export/config-ondavx747.h @@ -20,7 +20,7 @@ ****************************************************************************/ /* - * This config file is for the Onda VX747(+) + * This config file is for the Onda VX747(+)/VX777 */ #define TARGET_TREE /* this target is using the target tree system */ @@ -29,8 +29,11 @@ #ifdef ONDA_VX747P #define MODEL_NAME "Onda VX747+" -#define MODEL_NUMBER 44 +#define MODEL_NUMBER 54 /* Define something for camera interface... */ +#elif defined(ONDA_VX777) +#define MODEL_NAME "Onda VX777" +#define MODEL_NUMBER 61 #else #define MODEL_NAME "Onda VX747" #define MODEL_NUMBER 45 @@ -87,7 +90,11 @@ /* Define this if your LCD can be enabled/disabled */ #define HAVE_LCD_ENABLE +#ifdef ONDA_VX777 +#define CONFIG_KEYPAD ONDAVX777_PAD +#else #define CONFIG_KEYPAD ONDAVX747_PAD +#endif #define HAVE_TOUCHSCREEN #define HAVE_BUTTON_DATA diff --git a/firmware/export/config.h b/firmware/export/config.h index e53e19ac1d..5148096a30 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -110,6 +110,7 @@ #define SANSA_FUZE_PAD 36 #define LYRE_PROTO1_PAD 37 #define SAMSUNG_YH_PAD 38 +#define ONDAVX777_PAD 39 /* CONFIG_REMOTE_KEYPAD */ #define H100_REMOTE 1 @@ -351,7 +352,7 @@ Lyre prototype 1*/ #include "config-meizu-m6sp.h" #elif defined(MEIZU_M3) #include "config-meizu-m3.h" -#elif defined(ONDA_VX747) || defined(ONDA_VX747P) +#elif defined(ONDA_VX747) || defined(ONDA_VX747P) || defined(ONDA_VX777) #include "config-ondavx747.h" #elif defined(ONDA_VX767) #include "config-ondavx767.h" diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c index ebc2f214a9..24caac0100 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c @@ -42,6 +42,8 @@ #define BTN_HOLD (1 << 22) /* on REG_GPIO_PXPIN(2) */ #define BTN_MENU (1 << 20) #define BTN_VOL_UP (1 << 19) +#elif defined(ONDA_VX777) +/* TODO */ #else #error No buttons defined! #endif @@ -123,7 +125,7 @@ unsigned int battery_adc_voltage(void) } void button_init_device(void) -{ +{ #ifdef ONDA_VX747 __gpio_as_input(32*3 + 29); __gpio_as_input(32*3 + 27); @@ -146,6 +148,8 @@ bool button_hold(void) (~REG_GPIO_PXPIN(3)) & BTN_HOLD #elif defined(ONDA_VX747P) (~REG_GPIO_PXPIN(2)) & BTN_HOLD +#elif defined(ONDA_VX777) + false /* TODO */ #endif ? true : false ); @@ -153,13 +157,14 @@ bool button_hold(void) int button_read_device(int *data) { - int ret = 0, tmp; + int ret = 0; /* Filter button events out if HOLD button is pressed at firmware/ level */ if(button_hold()) return 0; - tmp = (~REG_GPIO_PXPIN(3)) & BTN_MASK; +#ifndef ONDA_VX777 + int tmp = (~REG_GPIO_PXPIN(3)) & BTN_MASK; if(tmp & BTN_VOL_DOWN) ret |= BUTTON_VOL_DOWN; @@ -169,6 +174,7 @@ int button_read_device(int *data) ret |= BUTTON_MENU; if(tmp & BTN_OFF) ret |= BUTTON_POWER; +#endif if(cur_touch != 0 && pen_down) { @@ -176,9 +182,6 @@ int button_read_device(int *data) if( UNLIKELY(!is_backlight_on(true)) ) *data = 0; } - - if(ret & (BUTTON_VOL_DOWN|BUTTON_VOL_UP)) - touchscreen_set_mode( touchscreen_get_mode() == TOUCHSCREEN_BUTTON ? TOUCHSCREEN_POINT : TOUCHSCREEN_BUTTON); return ret; } diff --git a/tools/configure b/tools/configure index 50091a5da3..e90a884602 100755 --- a/tools/configure +++ b/tools/configure @@ -774,6 +774,7 @@ cat <