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.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
index 8d7c1468d8..a388f12601 100644
--- a/firmware/target/arm/as3525/debug-as3525.c
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -26,7 +26,7 @@
26#include "font.h" 26#include "font.h"
27#include "system.h" 27#include "system.h"
28#include "sprintf.h" 28#include "sprintf.h"
29#include "string.h" 29#include "cpu.h"
30 30
31#define _DEBUG_PRINTF(a,varargs...) \ 31#define _DEBUG_PRINTF(a,varargs...) \
32 snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf) 32 snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf)
@@ -41,35 +41,24 @@ bool __dbg_hw_info(void)
41bool __dbg_ports(void) 41bool __dbg_ports(void)
42{ 42{
43 char buf[50]; 43 char buf[50];
44 int line, i; 44 int line;
45 45
46 lcd_clear_display(); 46 lcd_clear_display();
47 lcd_setfont(FONT_SYSFIXED); 47 lcd_setfont(FONT_SYSFIXED);
48 char gpio_data[4] = {0,0,0,0};
49 48
50 while(1) 49 while(1)
51 { 50 {
52 line = 0; 51 line = 0;
53 for (i = 0; i < 8; i++)
54 {
55 gpio_data[0] |= GPIOA_PIN(i) & (1<<i);
56 gpio_data[1] |= GPIOB_PIN(i) & (1<<i);
57 gpio_data[2] |= GPIOC_PIN(i) & (1<<i);
58 gpio_data[3] |= GPIOD_PIN(i) & (1<<i);
59 }
60
61 line++;
62 _DEBUG_PRINTF("[GPIO Values and Directions]"); 52 _DEBUG_PRINTF("[GPIO Values and Directions]");
63 _DEBUG_PRINTF("GPIOA: %2x DIR: %2x", gpio_data[0], GPIOA_DIR); 53 _DEBUG_PRINTF("GPIOA: %2x DIR: %2x", GPIOA_DATA, GPIOA_DIR);
64 _DEBUG_PRINTF("GPIOB: %2x DIR: %2x", gpio_data[1], GPIOB_DIR); 54 _DEBUG_PRINTF("GPIOB: %2x DIR: %2x", GPIOB_DATA, GPIOB_DIR);
65 _DEBUG_PRINTF("GPIOC: %2x DIR: %2x", gpio_data[2], GPIOC_DIR); 55 _DEBUG_PRINTF("GPIOC: %2x DIR: %2x", GPIOC_DATA, GPIOC_DIR);
66 _DEBUG_PRINTF("GPIOD: %2x DIR: %2x", gpio_data[3], GPIOD_DIR); 56 _DEBUG_PRINTF("GPIOD: %2x DIR: %2x", GPIOD_DATA, GPIOD_DIR);
67 line++;
68#ifdef TRACK_DBOP_DIN 57#ifdef TRACK_DBOP_DIN
58 line++;
69 _DEBUG_PRINTF("[DBOP_DIN]"); 59 _DEBUG_PRINTF("[DBOP_DIN]");
70 _DEBUG_PRINTF("DBOP_DIN: %4x", _dbop_din); 60 _DEBUG_PRINTF("DBOP_DIN: %4x", _dbop_din);
71#endif 61#endif
72 memset(gpio_data, 0, sizeof(gpio_data));
73 lcd_update(); 62 lcd_update();
74 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) 63 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
75 break; 64 break;