2010-09-22 15:10:42 +02:00
|
|
|
#include <board.h>
|
2010-12-01 16:26:48 +01:00
|
|
|
#include <cpu.h>
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2010-12-06 16:06:14 +01:00
|
|
|
void loop_delay(void) {
|
|
|
|
volatile uint16_t i, j;
|
|
|
|
for (i = 1; i < 30; i++) {
|
|
|
|
for (j = 1; j != 0; j++) {
|
|
|
|
asm volatile (" nop ");
|
|
|
|
}
|
|
|
|
}
|
2010-09-22 15:10:42 +02:00
|
|
|
}
|
|
|
|
|
2010-12-06 16:06:14 +01:00
|
|
|
void bl_blink(void) {
|
|
|
|
LED_RED_ON;
|
|
|
|
LED_GREEN_ON;
|
|
|
|
|
|
|
|
loop_delay();
|
2010-09-22 15:10:42 +02:00
|
|
|
|
2010-12-06 16:06:14 +01:00
|
|
|
LED_RED_OFF;
|
|
|
|
LED_GREEN_OFF;
|
2010-09-22 15:10:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void bl_init_ports(void)
|
|
|
|
{
|
|
|
|
SCS |= BIT0; // Set IO Ports to fast switching mode
|
|
|
|
|
|
|
|
/* UART0 */
|
|
|
|
PINSEL0 |= BIT4 + BIT6; // RxD0 and TxD0
|
|
|
|
PINSEL0 &= ~(BIT5 + BIT7);
|
|
|
|
|
|
|
|
/* LEDS */
|
|
|
|
FIO3DIR |= LED_RED_PIN;
|
|
|
|
FIO3DIR |= LED_GREEN_PIN;
|
|
|
|
LED_RED_OFF;
|
|
|
|
LED_GREEN_OFF;
|
|
|
|
|
2010-12-06 16:06:14 +01:00
|
|
|
/* short blinking of both of the LEDs on startup */
|
|
|
|
bl_blink();
|
2010-09-22 15:10:42 +02:00
|
|
|
}
|
2010-12-06 16:06:14 +01:00
|
|
|
|