summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2009-07-11 14:41:43 +0000
committerBertrik Sikken <bertrik@sikken.nl>2009-07-11 14:41:43 +0000
commit27c60fde0d5b3fdd129c4c1ad7bc7c6a9396171d (patch)
tree0c14352b6543717b47062dff90065de05e6306c9 /firmware/target/arm
parent405d12de7e5f1a5eb5a001fe183345f8f8aec72c (diff)
downloadrockbox-27c60fde0d5b3fdd129c4c1ad7bc7c6a9396171d.tar.gz
rockbox-27c60fde0d5b3fdd129c4c1ad7bc7c6a9396171d.tar.bz2
rockbox-27c60fde0d5b3fdd129c4c1ad7bc7c6a9396171d.zip
S5L8700: add skeleton for __dbg_hw_info and __dbg_ports items in the debug menu
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21777 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/s5l8700/debug-s5l8700.c93
-rw-r--r--firmware/target/arm/s5l8700/debug-target.h33
2 files changed, 126 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8700/debug-s5l8700.c b/firmware/target/arm/s5l8700/debug-s5l8700.c
new file mode 100644
index 0000000000..04d2b05021
--- /dev/null
+++ b/firmware/target/arm/s5l8700/debug-s5l8700.c
@@ -0,0 +1,93 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright © 2008 Rafaël Carré
+ *
+ * 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 <stdbool.h>
+#include "config.h"
+#include "kernel.h"
+#include "debug-target.h"
+#include "button.h"
+#include "lcd.h"
+#include "font.h"
+#include "sprintf.h"
+
+/* Skeleton for adding target specific debug info to the debug menu
+ */
+
+#define _DEBUG_PRINTF(a,varargs...) do { \
+ snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf); \
+ } while(0)
+
+
+bool __dbg_hw_info(void)
+{
+ char buf[50];
+ int line;
+
+ lcd_clear_display();
+ lcd_setfont(FONT_SYSFIXED);
+
+ while(1)
+ {
+ while(1)
+ {
+ lcd_clear_display();
+ line = 0;
+
+ /* _DEBUG_PRINTF statements can be added here to show debug info */
+ _DEBUG_PRINTF("__dbg_hw_info");
+
+ lcd_update();
+ int btn = button_get_w_tmo(HZ/10);
+ if(btn == (DEBUG_CANCEL|BUTTON_REL))
+ goto end;
+ else if(btn == (BUTTON_DOWN|BUTTON_REL))
+ break;
+ }
+ }
+
+end:
+ lcd_setfont(FONT_UI);
+ return false;
+}
+
+bool __dbg_ports(void)
+{
+ char buf[50];
+ int line;
+
+ lcd_clear_display();
+ lcd_setfont(FONT_SYSFIXED);
+
+ while(1)
+ {
+ line = 0;
+
+ /* _DEBUG_PRINTF statements can be added here to show debug info */
+ _DEBUG_PRINTF("__dbg_ports");
+
+ lcd_update();
+ if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
+ break;
+ }
+ lcd_setfont(FONT_UI);
+ return false;
+}
+
diff --git a/firmware/target/arm/s5l8700/debug-target.h b/firmware/target/arm/s5l8700/debug-target.h
new file mode 100644
index 0000000000..7f10211f2f
--- /dev/null
+++ b/firmware/target/arm/s5l8700/debug-target.h
@@ -0,0 +1,33 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2007 by Karl Kurbjun
+ *
+ * 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 _DEBUG_TARGET_H_
+#define _DEBUG_TARGET_H_
+
+#include <stdbool.h>
+
+#define DEBUG_CANCEL BUTTON_LEFT
+
+bool __dbg_hw_info(void);
+bool __dbg_ports(void);
+
+#endif /* _DEBUG_TARGET_H_ */
+