From 94d184f816cb19c414fe6bd95600e6be079ac2f9 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> Date: Sun, 23 Jul 2006 12:47:50 +0000 Subject: further cleanup (remove separate rc632_debug.{c,h} git-svn-id: https://svn.openpcd.org:2342/trunk@16 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpcd/firmware/src/dbgu.c | 1 - openpcd/firmware/src/pcd_enumerate.h | 2 +- openpcd/firmware/src/rc632.h | 5 +++ openpcd/firmware/src/rc632_debug.c | 59 ------------------------------------ openpcd/firmware/src/rc632_debug.h | 6 ---- 5 files changed, 6 insertions(+), 67 deletions(-) delete mode 100644 openpcd/firmware/src/rc632_debug.c delete mode 100644 openpcd/firmware/src/rc632_debug.h diff --git a/openpcd/firmware/src/dbgu.c b/openpcd/firmware/src/dbgu.c index fe56760..81d83b6 100644 --- a/openpcd/firmware/src/dbgu.c +++ b/openpcd/firmware/src/dbgu.c @@ -19,7 +19,6 @@ // Include Standard files #include "Board.h" #include "dbgu.h" -#include "rc632_debug.h" #include "rc632.h" #include "openpcd.h" #define USART_SYS_LEVEL 4 diff --git a/openpcd/firmware/src/pcd_enumerate.h b/openpcd/firmware/src/pcd_enumerate.h index af0d00c..f365fb4 100644 --- a/openpcd/firmware/src/pcd_enumerate.h +++ b/openpcd/firmware/src/pcd_enumerate.h @@ -15,7 +15,7 @@ #ifndef PCD_ENUMERATE_H #define PCD_ENUMERATE_H -#include +#include #include #define AT91C_EP_OUT 1 diff --git a/openpcd/firmware/src/rc632.h b/openpcd/firmware/src/rc632.h index a05dbf7..824cca9 100644 --- a/openpcd/firmware/src/rc632.h +++ b/openpcd/firmware/src/rc632.h @@ -11,4 +11,9 @@ extern u_int8_t rc632_read_fifo(u_int8_t max_len, u_int8_t *data); extern void rc632_init(void); extern void rc632_exit(void); +#ifdef DEBUG +extern int rc632_test(void); +extern int rc632_dump(void); +#endif + #endif diff --git a/openpcd/firmware/src/rc632_debug.c b/openpcd/firmware/src/rc632_debug.c deleted file mode 100644 index ef68835..0000000 --- a/openpcd/firmware/src/rc632_debug.c +++ /dev/null @@ -1,59 +0,0 @@ - -#include "rc632.h" -#include "dbgu.h" -#include - -#ifdef DEBUG -static int rc632_reg_write_verify(u_int8_t reg, u_int8_t val) -{ - u_int8_t tmp; - - rc632_reg_write(reg, val); - tmp = rc632_reg_read(reg); - - DEBUGP("reg=0x%02x, write=0x%02x, read=0x%02x ", reg, val, tmp); - - return (val == tmp); -} - -static u_int8_t tx_buf[0x40+1]; -static u_int8_t rx_buf[0x40+1]; - - -int rc632_dump(void) -{ - u_int8_t i; - u_int16_t rx_len = sizeof(rx_buf); - - for (i = 0; i <= 0x3f; i++) { - tx_buf[i] = i << 1; - rx_buf[i] = 0x00; - } - - /* MSB of first byte of read spi transfer is high */ - tx_buf[0] |= 0x80; - - /* last byte of read spi transfer is 0x00 */ - tx_buf[0x40] = 0x00; - rx_buf[0x40] = 0x00; - - spi_transceive(tx_buf, 0x41, rx_buf, &rx_len); - - for (i = 0; i < 0x3f; i++) - DEBUGP("REG 0x%02x = 0x%02x\r\n", i, rx_buf[i+1]); -} - -int rc632_test(void) -{ - if (rc632_reg_write_verify(RC632_REG_RX_WAIT, 0x55) != 1) - return -1; - - if (rc632_reg_write_verify(RC632_REG_RX_WAIT, 0xAA) != 1) - return -1; - - return 0; -} -#else -int rc632_test(void) -{} -#endif diff --git a/openpcd/firmware/src/rc632_debug.h b/openpcd/firmware/src/rc632_debug.h deleted file mode 100644 index 26f341a..0000000 --- a/openpcd/firmware/src/rc632_debug.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _RC632_DEBUG_H -#define _RC632_DEBUG_H - -extern int rc632_test(void); - -#endif -- cgit v1.2.3