Let's have an LED driving module so that we can output different patterns for
status indications etc.
This commit is contained in:
11
main.c
11
main.c
@@ -7,6 +7,7 @@
|
||||
#include "interrupt.h"
|
||||
#include "event.h"
|
||||
#include "stick.h"
|
||||
#include "led.h"
|
||||
|
||||
#define PINSEL0 (*((volatile unsigned int *) 0xE002C000))
|
||||
#define PINSEL1 (*((volatile unsigned int *) 0xE002C004))
|
||||
@@ -196,11 +197,11 @@ int main(void) {
|
||||
|
||||
putstr("prompt> ");
|
||||
|
||||
FP0XVAL &= ~0x04000000;
|
||||
led_set(FALSE);
|
||||
timer_delay_ms(1000);
|
||||
FP0XVAL |= 0x04000000;
|
||||
led_set(TRUE);
|
||||
timer_delay_ms(1000);
|
||||
FP0XVAL &= ~0x04000000;
|
||||
led_set(FALSE);
|
||||
if (!wmp_init())
|
||||
putstr("WMP initialisation failed\r\n");
|
||||
|
||||
@@ -208,11 +209,11 @@ int main(void) {
|
||||
timer_set_period(5*TIMER_MS);
|
||||
wmp_start_zero();
|
||||
|
||||
FP0XVAL |= 0x04000000;
|
||||
led_set_pattern(led_pattern_active);
|
||||
|
||||
/* Good luck! */
|
||||
while (1) {
|
||||
FP0XVAL ^= 0x04000000;
|
||||
led_update();
|
||||
event_dispatch();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user