diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2009-07-11 14:41:43 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2009-07-11 14:41:43 +0000 |
commit | 27c60fde0d5b3fdd129c4c1ad7bc7c6a9396171d (patch) | |
tree | 0c14352b6543717b47062dff90065de05e6306c9 /firmware/target/arm/s5l8700 | |
parent | 405d12de7e5f1a5eb5a001fe183345f8f8aec72c (diff) | |
download | rockbox-27c60fde0d5b3fdd129c4c1ad7bc7c6a9396171d.tar.gz 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/s5l8700')
-rw-r--r-- | firmware/target/arm/s5l8700/debug-s5l8700.c | 93 | ||||
-rw-r--r-- | firmware/target/arm/s5l8700/debug-target.h | 33 |
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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright © 2008 Rafaël Carré | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include <stdbool.h> | ||
23 | #include "config.h" | ||
24 | #include "kernel.h" | ||
25 | #include "debug-target.h" | ||
26 | #include "button.h" | ||
27 | #include "lcd.h" | ||
28 | #include "font.h" | ||
29 | #include "sprintf.h" | ||
30 | |||
31 | /* Skeleton for adding target specific debug info to the debug menu | ||
32 | */ | ||
33 | |||
34 | #define _DEBUG_PRINTF(a,varargs...) do { \ | ||
35 | snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf); \ | ||
36 | } while(0) | ||
37 | |||
38 | |||
39 | bool __dbg_hw_info(void) | ||
40 | { | ||
41 | char buf[50]; | ||
42 | int line; | ||
43 | |||
44 | lcd_clear_display(); | ||
45 | lcd_setfont(FONT_SYSFIXED); | ||
46 | |||
47 | while(1) | ||
48 | { | ||
49 | while(1) | ||
50 | { | ||
51 | lcd_clear_display(); | ||
52 | line = 0; | ||
53 | |||
54 | /* _DEBUG_PRINTF statements can be added here to show debug info */ | ||
55 | _DEBUG_PRINTF("__dbg_hw_info"); | ||
56 | |||
57 | lcd_update(); | ||
58 | int btn = button_get_w_tmo(HZ/10); | ||
59 | if(btn == (DEBUG_CANCEL|BUTTON_REL)) | ||
60 | goto end; | ||
61 | else if(btn == (BUTTON_DOWN|BUTTON_REL)) | ||
62 | break; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | end: | ||
67 | lcd_setfont(FONT_UI); | ||
68 | return false; | ||
69 | } | ||
70 | |||
71 | bool __dbg_ports(void) | ||
72 | { | ||
73 | char buf[50]; | ||
74 | int line; | ||
75 | |||
76 | lcd_clear_display(); | ||
77 | lcd_setfont(FONT_SYSFIXED); | ||
78 | |||
79 | while(1) | ||
80 | { | ||
81 | line = 0; | ||
82 | |||
83 | /* _DEBUG_PRINTF statements can be added here to show debug info */ | ||
84 | _DEBUG_PRINTF("__dbg_ports"); | ||
85 | |||
86 | lcd_update(); | ||
87 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) | ||
88 | break; | ||
89 | } | ||
90 | lcd_setfont(FONT_UI); | ||
91 | return false; | ||
92 | } | ||
93 | |||
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 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 by Karl Kurbjun | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef _DEBUG_TARGET_H_ | ||
23 | #define _DEBUG_TARGET_H_ | ||
24 | |||
25 | #include <stdbool.h> | ||
26 | |||
27 | #define DEBUG_CANCEL BUTTON_LEFT | ||
28 | |||
29 | bool __dbg_hw_info(void); | ||
30 | bool __dbg_ports(void); | ||
31 | |||
32 | #endif /* _DEBUG_TARGET_H_ */ | ||
33 | |||