From 35c9c66c23fcae19b5e0631f4e73d5e9b38089f5 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Tue, 16 Mar 2010 22:03:38 -0400 Subject: [PATCH] use new gpio interface --- board/redbee-econotag.h | 6 +++--- lib/include/utils.h | 2 +- tests/blink-blue.c | 10 +++++----- tests/blink-green.c | 10 +++++----- tests/blink-red.c | 10 +++++----- tests/blink-white.c | 9 +++++---- tests/led.h | 8 ++++---- tests/rftest-rx.c | 19 ++++++++----------- tests/rftest-tx.c | 8 +------- tests/tests.h | 8 -------- tests/tmr-ints.c | 8 ++++---- tests/tmr.c | 6 +++--- 12 files changed, 44 insertions(+), 60 deletions(-) diff --git a/board/redbee-econotag.h b/board/redbee-econotag.h index 4975a898c..824eaade2 100644 --- a/board/redbee-econotag.h +++ b/board/redbee-econotag.h @@ -1,9 +1,9 @@ #ifndef BOARD_REDBEE_DEV_H #define BOARD_REDBEE_DEV_H -#define LED_RED 12 -#define LED_GREEN 21 -#define LED_BLUE 0 /* FIXME: Was 35 - in high GPIO bank so it doesn't work */ +#define LED_RED 44 +#define LED_GREEN 45 +#define LED_BLUE 44 /* don't have a blue LED so we reuse red */ /* XTAL TUNE parameters */ /* see http://devl.org/pipermail/mc1322x/2009-December/000162.html */ diff --git a/lib/include/utils.h b/lib/include/utils.h index 5c985feab..ca7787023 100644 --- a/lib/include/utils.h +++ b/lib/include/utils.h @@ -14,7 +14,7 @@ #define clear_bit(val, bit) (val = (val & ~(1 << bit))) #define set_bit(val, bit) (val = (val | (1 << bit))) -#define ones(num) ( (1<> field) //#define bitfield(name, length, shift) ( #define #name length #define #name##_MASK bit_mask(length, shift)) diff --git a/tests/blink-blue.c b/tests/blink-blue.c index 34f78e558..7bb490cf1 100644 --- a/tests/blink-blue.c +++ b/tests/blink-blue.c @@ -3,21 +3,21 @@ #define DELAY 400000 -#define LED LED_BLUE +#define LED (1ULL << LED_BLUE) void main(void) { volatile uint32_t i; - *GPIO_PAD_DIR0 = LED; + gpio_pad_dir(LED); while(1) { - *GPIO_DATA0 = LED; + gpio_data(LED); for(i=0; i #include + #include "led.h" #define DELAY 400000 @@ -9,16 +10,16 @@ void main(void) { volatile uint32_t i; - *GPIO_PAD_DIR0 = LED; + gpio_pad_dir(LED); while(1) { - *GPIO_DATA0 = LED; + gpio_data(LED); for(i=0; i> 15) == 0) { continue; } *TMR0_SCTRL = 0; /*clear bit 15, and all the others --- should be ok, but clearly not "the right thing to do" */ /* blink off */ - *GPIO_DATA0 = 0x00000000; + gpio_data_set(0); while((*TMR0_SCTRL >> 15) == 0) { continue; } *TMR0_SCTRL = 0; /*clear bit 15, and all the others --- should be ok, but clearly not "the right thing to do" */