diff --git a/cpu/mc1322x/board/freescale-ncb.h b/cpu/mc1322x/board/freescale-ncb.h index d1b7b2f8d..5de8c8ef1 100644 --- a/cpu/mc1322x/board/freescale-ncb.h +++ b/cpu/mc1322x/board/freescale-ncb.h @@ -36,6 +36,10 @@ #ifndef BOARD_FREESCALE_NCB_H #define BOARD_FREESCALE_NCB_H +#define GPIO_LED_RED GPIO_23 +#define GPIO_LED_GREEN GPIO_24 +#define GPIO_LED_BLUE GPIO_25 + #define LED_RED 23 #define LED_GREEN 24 #define LED_BLUE 25 diff --git a/cpu/mc1322x/board/quahogcon.h b/cpu/mc1322x/board/quahogcon.h index 6de1ec76d..182e22c06 100644 --- a/cpu/mc1322x/board/quahogcon.h +++ b/cpu/mc1322x/board/quahogcon.h @@ -55,6 +55,10 @@ #define BUTTON2_OUT (0x1ULL << 22) #define BUTTON2_IN (0x1ULL << 26) +#define GPIO_LED_RED GPIO_12 +#define GPIO_LED_GREEN GPIO_21 +#define GPIO_LED_BLUE GPIO_35 + #define LED_RED 12 #define LED_GREEN 21 #define LED_BLUE 35 diff --git a/cpu/mc1322x/board/redbee-dev.h b/cpu/mc1322x/board/redbee-dev.h index c54488a14..d961ac081 100644 --- a/cpu/mc1322x/board/redbee-dev.h +++ b/cpu/mc1322x/board/redbee-dev.h @@ -36,6 +36,10 @@ #ifndef BOARD_REDBEE_DEV_H #define BOARD_REDBEE_DEV_H +#define GPIO_LED_RED GPIO_23 +#define GPIO_LED_GREEN GPIO_24 +#define GPIO_LED_BLUE GPIO_25 + #define LED_RED 23 #define LED_GREEN 24 #define LED_BLUE 25 diff --git a/cpu/mc1322x/board/redbee-r1.h b/cpu/mc1322x/board/redbee-r1.h index f63e3ea54..0bc6ef0c9 100644 --- a/cpu/mc1322x/board/redbee-r1.h +++ b/cpu/mc1322x/board/redbee-r1.h @@ -36,6 +36,10 @@ #ifndef BOARD_REDBEE_R1_H #define BOARD_REDBEE_R1_H +#define GPIO_LED_RED GPIO_08 +#define GPIO_LED_GREEN GPIO_09 +#define GPIO_LED_BLUE GPIO_10 + #define LED_RED 8 #define LED_GREEN 9 #define LED_BLUE 10 diff --git a/cpu/mc1322x/board/redbee-usb.h b/cpu/mc1322x/board/redbee-usb.h index 6ddb372b8..88ee4e8cf 100644 --- a/cpu/mc1322x/board/redbee-usb.h +++ b/cpu/mc1322x/board/redbee-usb.h @@ -36,6 +36,10 @@ #ifndef BOARD_REDBEE_USB_H #define BOARD_REDBEE_USB_H +#define GPIO_LED_RED GPIO_23 +#define GPIO_LED_GREEN GPIO_24 +#define GPIO_LED_BLUE GPIO_25 + #define LED_RED 23 #define LED_GREEN 24 #define LED_BLUE 25 diff --git a/cpu/mc1322x/lib/maca.c b/cpu/mc1322x/lib/maca.c index 1a3601d2e..00735bc6a 100644 --- a/cpu/mc1322x/lib/maca.c +++ b/cpu/mc1322x/lib/maca.c @@ -650,7 +650,7 @@ void maca_isr(void) { dma_rx->rx_time = *MACA_TIMESTAMP; /* check if received packet needs an ack */ - if(dma_rx->data[1] & 0x20) { + if(prm_mode == AUTOACK && (dma_rx->data[1] & 0x20)) { /* this wait is necessary to auto-ack */ volatile uint32_t wait_clk; wait_clk = *MACA_CLK + 200; diff --git a/cpu/mc1322x/src/default_lowlevel.c b/cpu/mc1322x/src/default_lowlevel.c index 27b35a889..8412663cb 100644 --- a/cpu/mc1322x/src/default_lowlevel.c +++ b/cpu/mc1322x/src/default_lowlevel.c @@ -78,11 +78,14 @@ void uart1_init(uint16_t inc, uint16_t mod, uint8_t samp) { if(samp == UCON_SAMP_16X) set_bit(*UART1_UCON,UCON_SAMP); - *GPIO_FUNC_SEL0 = ( (0x01 << (14*2)) | (0x01 << (15*2)) ); /* set GPIO15-14 to UART (UART1 TX and RX)*/ + + /* set GPIO15-14 to UART (UART1 TX and RX)*/ + GPIO->FUNC_SEL.GPIO_14 = 1; + GPIO->FUNC_SEL.GPIO_15 = 1; /* interrupt when there are this number or more bytes free in the TX buffer*/ *UART1_UTXCON = 16; - u1_tx_head = 0; u1_tx_tail = 0; + u1_tx_head = 0; u1_tx_tail = 0; /* enable UART1 interrupts in the interrupt controller */ enable_irq(UART1); diff --git a/cpu/mc1322x/tools/mc1322x-load.pl b/cpu/mc1322x/tools/mc1322x-load.pl index 40a171b9a..bfc1d1ffc 100755 --- a/cpu/mc1322x/tools/mc1322x-load.pl +++ b/cpu/mc1322x/tools/mc1322x-load.pl @@ -127,8 +127,8 @@ while(1) { my $i = 1; while(read(FILE, $c, 1)) { $i++; - usleep($first_delay) if ( $s == 0 ); - usleep($second_delay) if ( $s == 1 ); + usleep($first_delay) if ( $s == 0 ) && ($first_delay != 0); + usleep($second_delay) if ( $s == 1 ) && ($second_delay != 0); $ob->write($c); } }