2008-05-02 19:12:09 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 by Rob Purchase
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* 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.
|
2008-05-02 19:12:09 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "system.h"
|
|
|
|
#include "string.h"
|
2010-08-28 10:17:19 +00:00
|
|
|
#include <stdio.h>
|
2008-05-02 19:12:09 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include "button.h"
|
|
|
|
#include "lcd.h"
|
|
|
|
#include "font.h"
|
|
|
|
#include "debug-target.h"
|
|
|
|
#include "adc.h"
|
|
|
|
|
2010-11-06 14:24:25 +00:00
|
|
|
bool dbg_ports(void)
|
2008-05-02 19:12:09 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-06-05 10:26:06 +00:00
|
|
|
bool dbg_hw_info(void)
|
2008-05-02 19:12:09 +00:00
|
|
|
{
|
|
|
|
int line = 0, i, button, oldline;
|
|
|
|
bool done=false;
|
|
|
|
|
|
|
|
lcd_setfont(FONT_SYSFIXED);
|
|
|
|
lcd_clear_display();
|
|
|
|
|
|
|
|
/* Put all the static text before the while loop */
|
|
|
|
lcd_puts(0, line++, "[Hardware info]");
|
|
|
|
|
|
|
|
line++;
|
|
|
|
oldline=line;
|
|
|
|
while(!done)
|
|
|
|
{
|
|
|
|
line = oldline;
|
|
|
|
button = button_get(false);
|
|
|
|
|
|
|
|
button &= ~BUTTON_REPEAT;
|
2008-09-06 17:50:59 +00:00
|
|
|
#ifdef BUTTON_SELECT
|
2008-05-02 19:12:09 +00:00
|
|
|
if (button == BUTTON_SELECT)
|
2008-09-06 17:50:59 +00:00
|
|
|
#else
|
|
|
|
if (button == BUTTON_STOP)
|
|
|
|
#endif
|
2008-05-02 19:12:09 +00:00
|
|
|
done=true;
|
|
|
|
|
2010-08-28 23:12:11 +00:00
|
|
|
lcd_putsf(0, line++, "current tick: %08lx Seconds running: %08ld",
|
|
|
|
current_tick, current_tick/HZ);
|
2008-05-02 19:12:09 +00:00
|
|
|
|
2010-08-28 23:12:11 +00:00
|
|
|
lcd_putsf(0, line++, "GPIOA: 0x%08lx GPIOB: 0x%08lx", GPIOA, GPIOB);
|
|
|
|
lcd_putsf(0, line++, "GPIOC: 0x%08lx GPIOD: 0x%08lx", GPIOC, GPIOD);
|
|
|
|
lcd_putsf(0, line++, "GPIOE: 0x%08lx", GPIOE);
|
2008-05-02 19:12:09 +00:00
|
|
|
|
|
|
|
for (i = 0; i<4; i++)
|
2010-08-28 23:12:11 +00:00
|
|
|
lcd_putsf(0, line++, "ADC%d: 0x%04x", i, adc_read(i));
|
2008-05-02 19:12:09 +00:00
|
|
|
|
|
|
|
lcd_update();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|