summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/debug-as3525.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525/debug-as3525.c')
-rw-r--r--firmware/target/arm/as3525/debug-as3525.c49
1 files changed, 47 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
index 8a2f8838d6..a08d33e3da 100644
--- a/firmware/target/arm/as3525/debug-as3525.c
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -21,15 +21,60 @@
21 21
22#include <stdbool.h> 22#include <stdbool.h>
23#include "debug-target.h" 23#include "debug-target.h"
24#include "button.h"
25#include "lcd.h"
26#include "font.h"
27#include "system.h"
28#include "sprintf.h"
29
30
31#define _DEBUG_PRINTF(a,varargs...) \
32 snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf)
24 33
25/* TODO */ 34/* TODO */
26 35
27bool __dbg_ports(void) 36bool __dbg_hw_info(void)
28{ 37{
29 return false; 38 return false;
30} 39}
31 40
32bool __dbg_hw_info(void) 41bool __dbg_ports(void)
33{ 42{
43 char buf[50];
44 int line, i;
45 char counter = 0;
46
47 lcd_clear_display();
48 lcd_setfont(FONT_SYSFIXED);
49 char gpio_data[4] = {0,0,0,0};
50
51 while(1)
52 {
53 line = 0;
54 for (i = 0; i < 8; i++)
55 {
56 gpio_data[0] |= GPIOA_PIN(i) & (1<<i);
57 gpio_data[1] |= GPIOB_PIN(i) & (1<<i);
58 gpio_data[2] |= GPIOC_PIN(i) & (1<<i);
59 gpio_data[3] |= GPIOD_PIN(i) & (1<<i);
60 }
61
62 line++;
63 _DEBUG_PRINTF("[GPIO Values and Directions]");
64 _DEBUG_PRINTF("GPIOA: %2x DIR: %2x", gpio_data[0], GPIOA_DIR);
65 _DEBUG_PRINTF("GPIOB: %2x DIR: %2x", gpio_data[1], GPIOB_DIR);
66 _DEBUG_PRINTF("GPIOC: %2x DIR: %2x", gpio_data[2], GPIOC_DIR);
67 _DEBUG_PRINTF("GPIOD: %2x DIR: %2x", gpio_data[3], GPIOD_DIR);
68 line++;
69#ifdef TRACK_DBOP_DIN
70 _DEBUG_PRINTF("[DBOP_DIN]");
71 _DEBUG_PRINTF("DBOP_DIN: %4x", _dbop_din);
72#endif
73 memset(gpio_data, 0, sizeof(gpio_data));
74 lcd_update();
75 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
76 break;
77 }
78 lcd_setfont(FONT_UI);
34 return false; 79 return false;
35} 80}