Fix yellow
[kugel-rb.git] / firmware / target / arm / as3525 / debug-as3525.c
blob8d7c1468d8b737aa58ad187f60ac49d9cd5c5bae
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright © 2008 Rafaël Carré
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include <stdbool.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 #include "string.h"
31 #define _DEBUG_PRINTF(a,varargs...) \
32 snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf)
34 /* TODO */
36 bool __dbg_hw_info(void)
38 return false;
41 bool __dbg_ports(void)
43 char buf[50];
44 int line, i;
46 lcd_clear_display();
47 lcd_setfont(FONT_SYSFIXED);
48 char gpio_data[4] = {0,0,0,0};
50 while(1)
52 line = 0;
53 for (i = 0; i < 8; i++)
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);
61 line++;
62 _DEBUG_PRINTF("[GPIO Values and Directions]");
63 _DEBUG_PRINTF("GPIOA: %2x DIR: %2x", gpio_data[0], GPIOA_DIR);
64 _DEBUG_PRINTF("GPIOB: %2x DIR: %2x", gpio_data[1], GPIOB_DIR);
65 _DEBUG_PRINTF("GPIOC: %2x DIR: %2x", gpio_data[2], GPIOC_DIR);
66 _DEBUG_PRINTF("GPIOD: %2x DIR: %2x", gpio_data[3], GPIOD_DIR);
67 line++;
68 #ifdef TRACK_DBOP_DIN
69 _DEBUG_PRINTF("[DBOP_DIN]");
70 _DEBUG_PRINTF("DBOP_DIN: %4x", _dbop_din);
71 #endif
72 memset(gpio_data, 0, sizeof(gpio_data));
73 lcd_update();
74 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
75 break;
77 lcd_setfont(FONT_UI);
78 return false;