From 1522b72b1ea24797dcdb4a15f69950a3156a3cc0 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Tue, 23 Feb 2010 15:16:12 -0500 Subject: [PATCH] clean up gpio and leds --- board/redbee-dev.h | 4 ++++ board/redbee-r1.h | 8 ++++++++ libmc1322x/include/mc1322x.h | 1 + tests/blink-red.c | 7 +------ 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 board/redbee-r1.h diff --git a/board/redbee-dev.h b/board/redbee-dev.h index af7c38ffa..0548d0c96 100644 --- a/board/redbee-dev.h +++ b/board/redbee-dev.h @@ -1,4 +1,8 @@ #ifndef BOARD_REDBEE_DEV_H #define BOARD_REDBEE_DEV_H +#define LED_RED (1 << 23) +#define LED_GREEN (1 << 24) +#define LED_BLUE (1 << 25) + #endif diff --git a/board/redbee-r1.h b/board/redbee-r1.h new file mode 100644 index 000000000..e4a77f438 --- /dev/null +++ b/board/redbee-r1.h @@ -0,0 +1,8 @@ +#ifndef BOARD_REDBEE_R1_H +#define BOARD_REDBEE_R1_H + +#define LED_RED (1 << 8) +#define LED_GREEN (1 << 9) +#define LED_BLUE (1 << 10) + +#endif diff --git a/libmc1322x/include/mc1322x.h b/libmc1322x/include/mc1322x.h index beca8e97f..fe7653e73 100644 --- a/libmc1322x/include/mc1322x.h +++ b/libmc1322x/include/mc1322x.h @@ -3,5 +3,6 @@ #include "types.h" #include "isr.h" +#include "gpio.h" #endif diff --git a/tests/blink-red.c b/tests/blink-red.c index 16a2189ee..9f938168d 100644 --- a/tests/blink-red.c +++ b/tests/blink-red.c @@ -1,12 +1,8 @@ #include -#define MBAR_GPIO 0x80000000 -#define GPIO_PAD_DIR0 ((volatile uint32_t *) 0x80000000) -#define GPIO_DATA0 ((volatile uint32_t *) 0x80000008) -#define UART1_DATA ((volatile uint32_t *) 0x80005008) #define DELAY 400000 -//#define LED_BITS LED_RED +#define LED_BITS LED_RED __attribute__ ((section ("startup"))) void main(void) { @@ -14,7 +10,6 @@ void main(void) { // *GPIO_PAD_DIR0 = LED_BITS; - while(1) { // *GPIO_DATA0 = LED_BITS;