From 14c1b4cbfc7ffc0a7f12558f9e2331b3aa88934e Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 20 Aug 2010 17:50:12 -0300 Subject: [PATCH] xxx_MODE were used as if they were port bits, not registers. - fw/atspi/atspi.c (init_io): comment had the wrong initial value for SCLK - fw/atspi/atspi.c (init_io): xxx_MODE are registers, not bits ... - fw/common/io.h (IRQ_RF), fw/atspi/atspi.c (init_io): indicate pending moving of IRQ_RF --- fw/atspi/atspi.c | 14 +++++++------- fw/common/io.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fw/atspi/atspi.c b/fw/atspi/atspi.c index 0af6335..c2283bb 100644 --- a/fw/atspi/atspi.c +++ b/fw/atspi/atspi.c @@ -25,7 +25,7 @@ static void init_io(void) * * MOSI push-pull 0 * MISO open drain 1 (input) - * SCLK push-pull 1 + * SCLK push-pull 0 * nSS push-pull 1 * nRST_RF push-pull 1 * IRQ_RF open drain 1 (input) @@ -37,22 +37,22 @@ static void init_io(void) */ MOSI = 0; - MOSI_MODE = 1; + MOSI_MODE |= 1 << MOSI_BIT; SCLK = 0; - SCLK_MODE = 1; + SCLK_MODE |= 1 << SCLK_BIT; - nSS_MODE = 1; + nSS_MODE |= 1 << nSS_BIT; - nRST_RF_MODE = 1; + nRST_RF_MODE |= 1 << nRST_RF_BIT; SLP_TR = 0; - SLP_TR_MODE = 1; + SLP_TR_MODE |= 1 << SLP_TR_BIT; P0 &= ~((1 << 0) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7)); + /* change 1 << 0 to 1 << 2 once 100813 boards are reworked */ P3 = 0; - } diff --git a/fw/common/io.h b/fw/common/io.h index 53604ce..692d374 100644 --- a/fw/common/io.h +++ b/fw/common/io.h @@ -28,7 +28,7 @@ /* Miscellaneous RF signals */ #define nRST_RF P2_0 -#define IRQ_RF P0_2 +#define IRQ_RF P0_2 /* change to P0_0 when 100813 board are reworked */ #define SLP_TR P2_1 #endif /* !IO_H */