updated to use the leds on the RedBee hardware and made it a little more general.

Signed-off-by: Mariano Alvira <mar@devl.org>
This commit is contained in:
Mariano Alvira 2009-06-22 12:35:39 -04:00
parent c419d7403b
commit e1059a9b15
9 changed files with 51 additions and 17 deletions

View file

@ -65,7 +65,10 @@ void dump_regs(uint32_t base, uint32_t len) {
volatile uint8_t led;
#define led_on() do { led = 1; reg(GPIO_DATA0) = 0x00000200; } while(0);
#include "led.h"
#define LED LED_GREEN
#define led_on() do { led = 1; reg(GPIO_DATA0) = LED; } while(0);
#define led_off() do { led = 0; reg(GPIO_DATA0) = 0x00000000; } while(0);
void toggle_led(void) {
@ -85,7 +88,7 @@ void main(void) {
uint32_t tmp;
uint16_t status;
*(volatile uint32_t *)GPIO_PAD_DIR0 = 0x00000200;
*(volatile uint32_t *)GPIO_PAD_DIR0 = LED;
led_on();
/* Restore UART regs. to default */
@ -112,7 +115,7 @@ void main(void) {
init_phy();
set_power(0x0f); /* 0dbm */
set_channel(0); /* channel 11 */
set_channel(1); /* channel 11 */
reg(MACA_CONTROL) = SMAC_MACA_CNTL_INIT_STATE;
for(i=0; i<DELAY; i++) { continue; }