mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
Redo some parts of my previous commit, thanks Jens and Dave
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19869 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
067ef10c56
commit
78e0e85ffb
6 changed files with 12 additions and 96 deletions
|
|
@ -322,6 +322,8 @@ interface */
|
||||||
#define GPIOA_IC (*(volatile unsigned char*)(GPIOA_BASE+0x41C))
|
#define GPIOA_IC (*(volatile unsigned char*)(GPIOA_BASE+0x41C))
|
||||||
#define GPIOA_AFSEL (*(volatile unsigned char*)(GPIOA_BASE+0x420))
|
#define GPIOA_AFSEL (*(volatile unsigned char*)(GPIOA_BASE+0x420))
|
||||||
#define GPIOA_PIN(a) (*(volatile unsigned char*)(GPIOA_BASE+(1<<((a)+2))))
|
#define GPIOA_PIN(a) (*(volatile unsigned char*)(GPIOA_BASE+(1<<((a)+2))))
|
||||||
|
#define GPIOA_DATA (*(volatile unsigned char*)(GPIOA_BASE+(0xff<<2)))
|
||||||
|
|
||||||
|
|
||||||
#define GPIOB_DIR (*(volatile unsigned char*)(GPIOB_BASE+0x400))
|
#define GPIOB_DIR (*(volatile unsigned char*)(GPIOB_BASE+0x400))
|
||||||
#define GPIOB_IS (*(volatile unsigned char*)(GPIOB_BASE+0x404))
|
#define GPIOB_IS (*(volatile unsigned char*)(GPIOB_BASE+0x404))
|
||||||
|
|
@ -333,6 +335,7 @@ interface */
|
||||||
#define GPIOB_IC (*(volatile unsigned char*)(GPIOB_BASE+0x41C))
|
#define GPIOB_IC (*(volatile unsigned char*)(GPIOB_BASE+0x41C))
|
||||||
#define GPIOB_AFSEL (*(volatile unsigned char*)(GPIOB_BASE+0x420))
|
#define GPIOB_AFSEL (*(volatile unsigned char*)(GPIOB_BASE+0x420))
|
||||||
#define GPIOB_PIN(a) (*(volatile unsigned char*)(GPIOB_BASE+(1<<((a)+2))))
|
#define GPIOB_PIN(a) (*(volatile unsigned char*)(GPIOB_BASE+(1<<((a)+2))))
|
||||||
|
#define GPIOB_DATA (*(volatile unsigned char*)(GPIOB_BASE+(0xff<<2)))
|
||||||
|
|
||||||
#define GPIOC_DIR (*(volatile unsigned char*)(GPIOC_BASE+0x400))
|
#define GPIOC_DIR (*(volatile unsigned char*)(GPIOC_BASE+0x400))
|
||||||
#define GPIOC_IS (*(volatile unsigned char*)(GPIOC_BASE+0x404))
|
#define GPIOC_IS (*(volatile unsigned char*)(GPIOC_BASE+0x404))
|
||||||
|
|
@ -344,6 +347,7 @@ interface */
|
||||||
#define GPIOC_IC (*(volatile unsigned char*)(GPIOC_BASE+0x41C))
|
#define GPIOC_IC (*(volatile unsigned char*)(GPIOC_BASE+0x41C))
|
||||||
#define GPIOC_AFSEL (*(volatile unsigned char*)(GPIOC_BASE+0x420))
|
#define GPIOC_AFSEL (*(volatile unsigned char*)(GPIOC_BASE+0x420))
|
||||||
#define GPIOC_PIN(a) (*(volatile unsigned char*)(GPIOC_BASE+(1<<((a)+2))))
|
#define GPIOC_PIN(a) (*(volatile unsigned char*)(GPIOC_BASE+(1<<((a)+2))))
|
||||||
|
#define GPIOC_DATA (*(volatile unsigned char*)(GPIOC_BASE+(0xff<<2)))
|
||||||
|
|
||||||
#define GPIOD_DIR (*(volatile unsigned char*)(GPIOD_BASE+0x400))
|
#define GPIOD_DIR (*(volatile unsigned char*)(GPIOD_BASE+0x400))
|
||||||
#define GPIOD_IS (*(volatile unsigned char*)(GPIOD_BASE+0x404))
|
#define GPIOD_IS (*(volatile unsigned char*)(GPIOD_BASE+0x404))
|
||||||
|
|
@ -355,6 +359,7 @@ interface */
|
||||||
#define GPIOD_IC (*(volatile unsigned char*)(GPIOD_BASE+0x41C))
|
#define GPIOD_IC (*(volatile unsigned char*)(GPIOD_BASE+0x41C))
|
||||||
#define GPIOD_AFSEL (*(volatile unsigned char*)(GPIOD_BASE+0x420))
|
#define GPIOD_AFSEL (*(volatile unsigned char*)(GPIOD_BASE+0x420))
|
||||||
#define GPIOD_PIN(a) (*(volatile unsigned char*)(GPIOD_BASE+(1<<((a)+2))))
|
#define GPIOD_PIN(a) (*(volatile unsigned char*)(GPIOD_BASE+(1<<((a)+2))))
|
||||||
|
#define GPIOD_DATA (*(volatile unsigned char*)(GPIOD_BASE+(0xff<<2)))
|
||||||
|
|
||||||
/* ARM PL172 Memory Controller registers */
|
/* ARM PL172 Memory Controller registers */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "sprintf.h"
|
#include "sprintf.h"
|
||||||
#include "string.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
#define _DEBUG_PRINTF(a,varargs...) \
|
#define _DEBUG_PRINTF(a,varargs...) \
|
||||||
snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf)
|
snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf)
|
||||||
|
|
@ -41,35 +41,24 @@ bool __dbg_hw_info(void)
|
||||||
bool __dbg_ports(void)
|
bool __dbg_ports(void)
|
||||||
{
|
{
|
||||||
char buf[50];
|
char buf[50];
|
||||||
int line, i;
|
int line;
|
||||||
|
|
||||||
lcd_clear_display();
|
lcd_clear_display();
|
||||||
lcd_setfont(FONT_SYSFIXED);
|
lcd_setfont(FONT_SYSFIXED);
|
||||||
char gpio_data[4] = {0,0,0,0};
|
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
line = 0;
|
line = 0;
|
||||||
for (i = 0; i < 8; i++)
|
|
||||||
{
|
|
||||||
gpio_data[0] |= GPIOA_PIN(i) & (1<<i);
|
|
||||||
gpio_data[1] |= GPIOB_PIN(i) & (1<<i);
|
|
||||||
gpio_data[2] |= GPIOC_PIN(i) & (1<<i);
|
|
||||||
gpio_data[3] |= GPIOD_PIN(i) & (1<<i);
|
|
||||||
}
|
|
||||||
|
|
||||||
line++;
|
|
||||||
_DEBUG_PRINTF("[GPIO Values and Directions]");
|
_DEBUG_PRINTF("[GPIO Values and Directions]");
|
||||||
_DEBUG_PRINTF("GPIOA: %2x DIR: %2x", gpio_data[0], GPIOA_DIR);
|
_DEBUG_PRINTF("GPIOA: %2x DIR: %2x", GPIOA_DATA, GPIOA_DIR);
|
||||||
_DEBUG_PRINTF("GPIOB: %2x DIR: %2x", gpio_data[1], GPIOB_DIR);
|
_DEBUG_PRINTF("GPIOB: %2x DIR: %2x", GPIOB_DATA, GPIOB_DIR);
|
||||||
_DEBUG_PRINTF("GPIOC: %2x DIR: %2x", gpio_data[2], GPIOC_DIR);
|
_DEBUG_PRINTF("GPIOC: %2x DIR: %2x", GPIOC_DATA, GPIOC_DIR);
|
||||||
_DEBUG_PRINTF("GPIOD: %2x DIR: %2x", gpio_data[3], GPIOD_DIR);
|
_DEBUG_PRINTF("GPIOD: %2x DIR: %2x", GPIOD_DATA, GPIOD_DIR);
|
||||||
line++;
|
|
||||||
#ifdef TRACK_DBOP_DIN
|
#ifdef TRACK_DBOP_DIN
|
||||||
|
line++;
|
||||||
_DEBUG_PRINTF("[DBOP_DIN]");
|
_DEBUG_PRINTF("[DBOP_DIN]");
|
||||||
_DEBUG_PRINTF("DBOP_DIN: %4x", _dbop_din);
|
_DEBUG_PRINTF("DBOP_DIN: %4x", _dbop_din);
|
||||||
#endif
|
#endif
|
||||||
memset(gpio_data, 0, sizeof(gpio_data));
|
|
||||||
lcd_update();
|
lcd_update();
|
||||||
if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
|
if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
* __________ __ ___.
|
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
||||||
* \/ \/ \/ \/ \/
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Copyright (C) 2007 by Karl Kurbjun
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
||||||
* KIND, either express or implied.
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#define DEBUG_CANCEL BUTTON_LEFT
|
|
||||||
bool __dbg_hw_info(void);
|
|
||||||
bool __dbg_ports(void);
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
* __________ __ ___.
|
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
||||||
* \/ \/ \/ \/ \/
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Copyright (C) 2007 by Karl Kurbjun
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
||||||
* KIND, either express or implied.
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#define DEBUG_CANCEL BUTTON_LEFT
|
|
||||||
bool __dbg_hw_info(void);
|
|
||||||
bool __dbg_ports(void);
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
/***************************************************************************
|
|
||||||
* __________ __ ___.
|
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
||||||
* \/ \/ \/ \/ \/
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
* Copyright (C) 2007 by Karl Kurbjun
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
||||||
* KIND, either express or implied.
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#define DEBUG_CANCEL BUTTON_LEFT
|
|
||||||
bool __dbg_hw_info(void);
|
|
||||||
bool __dbg_ports(void);
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue