summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-05-03 14:43:43 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-05-03 14:43:43 +0000
commited5f1ed3e21e44cf052834c7d6fd70abfd1a6196 (patch)
tree2a7ea36bf7739227091878407c1484f2a1a3cb5a
parent5fc59065032fda288e5f64405492ba8a949819f1 (diff)
1) add debug menu for USB & PIC
2) update keymap 3) fix yellow git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17324 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/debug_menu.c54
-rw-r--r--apps/keymaps/keymap-creativezvm.c114
-rw-r--r--firmware/drivers/isp1583.c54
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c81
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/usb-target.h1
-rwxr-xr-xfirmware/target/arm/tms320dm320/debug-dm320.c18
6 files changed, 261 insertions, 61 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 59344f6f71..55c371dc25 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -2396,6 +2396,54 @@ static bool usb_reconnect(void)
}
#endif
+#if CONFIG_USBOTG == USBOTG_ISP1583
+extern int dbg_usb_num_items(void);
+extern char* dbg_usb_item(int selected_item, void *data, char *buffer, size_t buffer_len);
+
+static int isp1583_action_callback(int action, struct gui_synclist *lists)
+{
+ (void)lists;
+ if (action == ACTION_NONE)
+ action = ACTION_REDRAW;
+ return action;
+}
+
+static bool dbg_isp1583(void)
+{
+ struct simplelist_info isp1583;
+ simplelist_info_init(&isp1583, "ISP1583", dbg_usb_num_items(), NULL);
+ isp1583.timeout = HZ/100;
+ isp1583.hide_selection = true;
+ isp1583.get_name = dbg_usb_item;
+ isp1583.action_callback = isp1583_action_callback;
+ return simplelist_show_list(&isp1583);
+}
+#endif
+
+#ifdef CREATIVE_ZVM
+extern int pic_dbg_num_items(void);
+extern char* pic_dbg_item(int selected_item, void *data, char *buffer, size_t buffer_len);
+
+static int pic_action_callback(int action, struct gui_synclist *lists)
+{
+ (void)lists;
+ if (action == ACTION_NONE)
+ action = ACTION_REDRAW;
+ return action;
+}
+
+static bool dbg_pic(void)
+{
+ struct simplelist_info pic;
+ simplelist_info_init(&pic, "PIC", pic_dbg_num_items(), NULL);
+ pic.timeout = HZ/100;
+ pic.hide_selection = true;
+ pic.get_name = pic_dbg_item;
+ pic.action_callback = pic_action_callback;
+ return simplelist_show_list(&pic);
+}
+#endif
+
/****** The menu *********/
struct the_menu_item {
@@ -2472,6 +2520,12 @@ static const struct the_menu_item menuitems[] = {
#if defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS)
{ "Write back EEPROM", dbg_write_eeprom },
#endif
+#if CONFIG_USBOTG == USBOTG_ISP1583
+ { "View ISP1583 info", dbg_isp1583 },
+#endif
+#ifdef CREATIVE_ZVM
+ { "View PIC info", dbg_pic },
+#endif
#ifdef ROCKBOX_HAS_LOGF
{"logf", logfdisplay },
{"logfdump", logfdump },
diff --git a/apps/keymaps/keymap-creativezvm.c b/apps/keymaps/keymap-creativezvm.c
index 221830e15e..4944e0baef 100644
--- a/apps/keymaps/keymap-creativezvm.c
+++ b/apps/keymaps/keymap-creativezvm.c
@@ -43,31 +43,57 @@ CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker scree
*/
-#define BUTTON_VOL_UP BUTTON_NONE
-#define BUTTON_VOL_DOWN BUTTON_NONE
-
static const struct button_mapping button_context_standard[] = {
{ ACTION_STD_PREV, BUTTON_UP|BUTTON_REL, BUTTON_NONE },
{ ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_NEXT, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE },
{ ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
- { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT },
+ { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
- { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
+ { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
- { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
LAST_ITEM_IN_LIST
}; /* button_context_standard */
static const struct button_mapping button_context_wps[] = {
+ { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
+
+ { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+
+ { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
+ { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
+
+ //{ ACTION_WPS_ABSETB_NEXTDIR,BUTTON_RIGHT, BUTTON_CUSTOM },
+ //{ ACTION_WPS_ABSETA_PREVDIR,BUTTON_LEFT, BUTTON_CUSTOM },
+ //{ ACTION_WPS_ABRESET, BUTTON_CUSTOM|BUTTON_REPEAT, BUTTON_NONE },
+
+ { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
+
+ { ACTION_WPS_PITCHSCREEN, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK },
+
+ { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
+ { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
+ { ACTION_WPS_MENU, BUTTON_POWER, BUTTON_NONE },
+ { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+
+ { ACTION_WPS_ID3SCREEN, BUTTON_BACK|BUTTON_REL, BUTTON_NONE },
+ { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_BACK },
LAST_ITEM_IN_LIST
}; /* button_context_wps */
@@ -76,14 +102,23 @@ static const struct button_mapping button_context_list[] = {
}; /* button_context_list */
static const struct button_mapping button_context_tree[] = {
+ { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_TREE_STOP, BUTTON_POWER, BUTTON_NONE },
+ { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE },
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[] = {
+ { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
+ { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
};
@@ -96,30 +131,41 @@ static const struct button_mapping button_context_settings[] = {
{ ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
{ ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_SETTINGS_RESET, BUTTON_PLAY, BUTTON_NONE },
-
+ { ACTION_SETTINGS_RESET, BUTTON_PLAY, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
}; /* button_context_settings */
static const struct button_mapping button_context_settings_right_is_inc[] = {
-
+ { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
+ { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_RESET, BUTTON_BACK, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
}; /* button_context_settingsgraphical */
static const struct button_mapping button_context_yesno[] = {
+ { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
}; /* button_context_settings_yesno */
static const struct button_mapping button_context_colorchooser[] = {
+ { ACTION_STD_OK, BUTTON_BACK|BUTTON_REL, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
}; /* button_context_colorchooser */
static const struct button_mapping button_context_eq[] = {
+ { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
}; /* button_context_eq */
/** Bookmark Screen **/
static const struct button_mapping button_context_bmark[] = {
+ { ACTION_BMS_DELETE, BUTTON_BACK, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
}; /* button_context_bmark */
@@ -128,7 +174,15 @@ static const struct button_mapping button_context_time[] = {
}; /* button_context_time */
static const struct button_mapping button_context_quickscreen[] = {
-
+ { ACTION_QS_DOWNINV, BUTTON_UP, BUTTON_NONE },
+ { ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
}; /* button_context_quickscreen */
@@ -138,7 +192,24 @@ static const struct button_mapping button_context_pitchscreen[] = {
}; /* button_context_pitchcreen */
static const struct button_mapping button_context_keyboard[] = {
-
+ { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_CURSOR_LEFT, BUTTON_CUSTOM, BUTTON_NONE },
+ { ACTION_KBD_CURSOR_LEFT, BUTTON_CUSTOM|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY, BUTTON_NONE },
+ { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
+ { ACTION_KBD_PAGE_FLIP, BUTTON_BACK|BUTTON_MENU, BUTTON_NONE },
+ { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
+ { ACTION_KBD_ABORT, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
+ { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE },
+ { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
LAST_ITEM_IN_LIST
}; /* button_context_keyboard */
@@ -154,10 +225,7 @@ const struct button_mapping* get_context_mapping(int context)
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;
+ return button_context_listtree_scroll_without_combo;
case CONTEXT_CUSTOM|CONTEXT_TREE:
return button_context_tree;
case CONTEXT_SETTINGS:
diff --git a/firmware/drivers/isp1583.c b/firmware/drivers/isp1583.c
index 351618d566..7e78f87468 100644
--- a/firmware/drivers/isp1583.c
+++ b/firmware/drivers/isp1583.c
@@ -26,6 +26,7 @@
#include "isp1583.h"
#include "thread.h"
#include "logf.h"
+#include <stdio.h>
#define DIR_RX 0
#define DIR_TX 1
@@ -149,7 +150,7 @@ static void usb_enable_endpoint(int idx)
endpoints[epidx_n(idx)].enabled[epidx_dir(idx)] = 1;
}
-
+/*
static void usb_disable_endpoint(int idx, bool set_struct)
{
usb_select_endpoint(idx);
@@ -159,7 +160,7 @@ static void usb_disable_endpoint(int idx, bool set_struct)
if(set_struct)
endpoints[epidx_n(idx)].enabled[epidx_dir(idx)] = 0;
}
-
+*/
static int usb_get_packet(unsigned char *buf, int max_len)
{
int len, i;
@@ -389,7 +390,7 @@ void usb_helper(void)
if(ISP1583_GEN_INT_READ & ISP1583_INIT_INTEN_READ)
{
#ifdef DEBUG
- //logf("Helper detected interrupt... [%d]", current_tick);
+ logf("Helper detected interrupt... [%d]", current_tick);
#endif
usb_drv_int();
}
@@ -712,6 +713,53 @@ void usb_drv_set_address(int address)
usb_status_ack(0, DIR_TX);
}
+int dbg_usb_num_items(void)
+{
+ return 2+NUM_ENDPOINTS*2;
+}
+
+char* dbg_usb_item(int selected_item, void *data, char *buffer, size_t buffer_len)
+{
+ if(selected_item < 2)
+ {
+ switch(selected_item)
+ {
+ case 0:
+ snprintf(buffer, buffer_len, "USB connected: %s", (usb_drv_connected() ? "Yes" : "No"));
+ return buffer;
+ case 1:
+ snprintf(buffer, buffer_len, "HS mode: %s", (high_speed_mode ? "Yes" : "No"));
+ return buffer;
+ }
+ }
+ else
+ {
+ int n = ep_index((selected_item - 2) / 2, (selected_item - 2) % 2);
+ if(endpoints[n].enabled == false)
+ snprintf(buffer, buffer_len, "EP%d[%s]: DISABLED", epidx_n(n), (epidx_dir(n) ? "TX" : "RX"));
+ else
+ {
+ if(epidx_dir(n))
+ {
+ if(endpoints[n].out_in_progress)
+ snprintf(buffer, buffer_len, "EP%d[TX]: TRANSFERRING DATA -> %d bytes/%d bytes", epidx_n(n), (endpoints[n].out_len - endpoints[n].out_ptr), endpoints[n].out_len);
+ else
+ snprintf(buffer, buffer_len, "EP%d[TX]: STANDBY", epidx_n(n));
+ }
+ else
+ {
+ if(endpoints[n].in_buf && !endpoints[n].in_ack)
+ snprintf(buffer, buffer_len, "EP%d[RX]: RECEIVING DATA -> %d bytes/%d bytes", epidx_n(n), endpoints[n].in_ptr, endpoints[n].in_max_len);
+ else
+ snprintf(buffer, buffer_len, "EP%d[RX]: STANDBY", epidx_n(n));
+ }
+ }
+ return buffer;
+ }
+ return NULL;
+ (void)data;
+}
+
void usb_drv_set_test_mode(int mode)
{
logf("usb_drv_set_test_mode(%d)", mode);
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c
index 09d3cf7c67..334ef25683 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c
@@ -25,7 +25,6 @@
#include "button-target.h"
#include "i2c-dm320.h"
-
#include "lcd-target.h"
#include "lcd.h"
#include "sprintf.h"
@@ -46,8 +45,10 @@
#define BTN_REL 1
#define BTN_TOUCHPAD_PRESS 0x1F00
+#define BTN_TOUCHPAD_SCROLL_DOWN 0x0F03
#define BTN_TOUCHPAD_CORNER_DOWN 0xAF00
#define BTN_TOUCHPAD_CORNER_UP 0x3F00
+#define BTN_TOUCHPAD_SCROLL_UP 0x0F04
#define HEADPHONE_PLUGIN_A 0x5707
#define HEADPHONE_PLUGIN_B 0x5F07
@@ -176,6 +177,9 @@ static bool sw = false;
void GIO0(void)
{
+ /* Mask GIO0 interrupt */
+ IO_INTC_IRQ1 = INTR_IRQ1_EXT0;
+
unsigned char msg[4];
i2c_read(PIC_ADR, msg, sizeof(msg));
tick_diff = current_tick - last_tick;
@@ -200,6 +204,12 @@ void GIO0(void)
map_button(BTN_TOUCHPAD_PRESS, BUTTON_SELECT);
map_button(BTN_TOUCHPAD_CORNER_DOWN, BUTTON_DOWN);
map_button(BTN_TOUCHPAD_CORNER_UP, BUTTON_UP);
+ case BTN_TOUCHPAD_SCROLL_DOWN:
+ btn = BUTTON_DOWN;
+ break;
+ case BTN_TOUCHPAD_SCROLL_UP:
+ btn = BUTTON_UP;
+ break;
case BTN_HOLD:
hold_switch = true;
break;
@@ -252,8 +262,6 @@ void GIO0(void)
lcd_update();
sw = !sw;
#endif
- /* Mask GIO0 interrupt */
- IO_INTC_IRQ1 = INTR_IRQ1_EXT0;
}
void send_command_to_pic(unsigned char in, unsigned char* out,
@@ -292,8 +300,7 @@ void button_init_device(void)
it? */
/* Enable GIO0 interrupt */
IO_INTC_EINT1 |= INTR_EINT1_EXT0;
- btn = nonbtn = pic_init_value = pic_init2_value = last_btn = hold_switch =
- 0;
+ btn=nonbtn=pic_init_value=pic_init2_value=last_btn=hold_switch=0;
/* Initialize PIC */
send_command_to_pic(1, (unsigned char *)&pic_init_value,
sizeof(pic_init_value));
@@ -301,27 +308,12 @@ void button_init_device(void)
sizeof(pic_init2_value));
}
-int get_debug_info(int choice)
-{
- switch(choice)
- {
- case 1:
- return pic_init_value;
- case 2:
- return pic_init2_value;
- case 3:
- return last_btn;
- case 4:
- return nonbtn;
- case 5:
- return tick_diff;
- }
- return -1;
-}
-
int button_read_device(void)
{
- return btn;
+ if(hold_switch)
+ return 0;
+ else
+ return btn;
}
bool button_hold(void)
@@ -333,3 +325,44 @@ bool button_usb_connected(void)
{
return (bool)(nonbtn & NONBUTTON_USB);
}
+
+int pic_dbg_num_items(void)
+{
+ return 13;
+}
+
+char* pic_dbg_item(int selected_item, void *data, char *buffer, size_t buffer_len)
+{
+ (void)data;
+ switch(selected_item)
+ {
+ case 0:
+ snprintf(buffer, buffer_len, "Init value 1: 0x%04x", pic_init_value);
+ return buffer;
+ case 1:
+ snprintf(buffer, buffer_len, "Init value 2: 0x%04x", pic_init2_value);
+ return buffer;
+ case 2:
+ snprintf(buffer, buffer_len, "Last button value: 0x%04x Raw value: 0x%04x", last_btn, btn);
+ return buffer;
+ case 3:
+ snprintf(buffer, buffer_len, "Last button differs in ticks: 0x%04x", tick_diff);
+ return buffer;
+ case 4:
+ snprintf(buffer, buffer_len, "Dock values: 0x%04x", nonbtn);
+ return buffer;
+ #define B(n,w,b) case n: \
+ snprintf(buffer, buffer_len, "%s: 0x%04x", w, b); \
+ return buffer;
+ B(5, "MASK_TV_OUT", MASK_TV_OUT(pic_init_value));
+ B(6, "MASK_xx1", MASK_xx1(pic_init_value));
+ B(7, "MASK_xx2", MASK_xx2(pic_init_value));
+ B(8, "MASK_xx3", MASK_xx3(pic_init_value));
+ B(9, "MASK_xx4", MASK_xx4(pic_init_value));
+ B(10, "MASK_xx5", MASK_xx5(pic_init_value));
+ B(11, "MASK_xx6", MASK_xx6(pic_init_value));
+ B(12, "MASK_xx7", MASK_xx7(pic_init_value));
+ #undef B
+ }
+ return NULL;
+}
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h b/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h
index 4e3303911c..14ddc6eb0a 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h
+++ b/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h
@@ -22,6 +22,7 @@
#include "dm320.h"
+/* General purpose memory region #2 */
#define ISP1583_IOBASE 0x60FFC000
#define ISP1583_H_OVERRIDE
diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c
index abfb5b09bc..23257ddcc6 100755
--- a/firmware/target/arm/tms320dm320/debug-dm320.c
+++ b/firmware/target/arm/tms320dm320/debug-dm320.c
@@ -82,6 +82,13 @@ bool __dbg_hw_info(void)
lcd_puts(0, line++, buf);
snprintf(buf, sizeof(buf), " IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x ", IO_CLK_MOD2, IO_CLK_LPCTL0);
lcd_puts(0, line++, buf);
+ lcd_puts(0, line++, "Interrupt info:");
+ snprintf(buf, sizeof(buf), " IO_INTC_EINT0: 0x%04x IO_INTC_EINT1: 0x%04x ", IO_INTC_EINT0, IO_INTC_EINT1);
+ lcd_puts(0, line++, buf);
+ snprintf(buf, sizeof(buf), " IO_INTC_EINT2: 0x%04x IO_INTC_IRQ0: 0x%04x ", IO_INTC_EINT2, IO_INTC_IRQ0);
+ lcd_puts(0, line++, buf);
+ snprintf(buf, sizeof(buf), " IO_INTC_IRQ1: 0x%04x IO_INTC_IRQ2: 0x%04x ", IO_INTC_IRQ1, IO_INTC_IRQ2);
+ lcd_puts(0, line++, buf);
#endif
lcd_puts(0, line++, "Board revision:");
@@ -130,17 +137,6 @@ bool __dbg_hw_info(void)
else if(button & BUTTON_RIGHT)
lcd_set_direct_fb(true);
- lcd_puts(0, line++, "PIC info:");
- snprintf(buf, sizeof(buf), " Init value 1: 0x%04x", get_debug_info(1));
- lcd_puts(0, line++, buf);
- snprintf(buf, sizeof(buf), " Init value 2: 0x%04x", get_debug_info(2));
- lcd_puts(0, line++, buf);
- snprintf(buf, sizeof(buf), " Last button value: 0x%04x Raw value: 0x%04x", get_debug_info(3), button_read_device());
- lcd_puts(0, line++, buf);
- snprintf(buf, sizeof(buf), " Last button at: 0x%04x", get_debug_info(5));
- lcd_puts(0, line++, buf);
- snprintf(buf, sizeof(buf), " Dock values: 0x%04x", get_debug_info(4));
- lcd_puts(0, line++, buf);
lcd_puts(0, line++, "LCD info:");
snprintf(buf, sizeof(buf), " LCD direct FB access? %s", (lcd_get_direct_fb() ? "yes" : "no"));
lcd_puts(0, line++, buf);