From bf89d69ed9b5ee62704543b207febea74395ced9 Mon Sep 17 00:00:00 2001 From: arighi Date: Thu, 13 May 2010 15:08:53 +0000 Subject: [PATCH] LPC-P2378: implement status LED on/off macros. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3682 38d2e660-2303-0410-9eaa-f027e97ec537 --- examples/lpc2378/hw/hw_led.h | 49 ++++++++++++++++++++++++++++++++++++ examples/lpc2378/main.c | 7 ++---- 2 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 examples/lpc2378/hw/hw_led.h diff --git a/examples/lpc2378/hw/hw_led.h b/examples/lpc2378/hw/hw_led.h new file mode 100644 index 00000000..e8c055b3 --- /dev/null +++ b/examples/lpc2378/hw/hw_led.h @@ -0,0 +1,49 @@ +/** + * \file + * + * + * \brief LED on/off macros for LPC-P2378. + * + * \author Andrea Righi + */ + +#ifndef HW_LED_H +#define HW_LED_H + +#include + +#define STATUS_LED (1 << 19) + +#define LED_ON() do { IOCLR1 = STATUS_LED; } while (0) +#define LED_OFF() do { IOSET1 = STATUS_LED; } while (0) + +#define LED_INIT() do { IODIR1 |= STATUS_LED; } while (0) + +#endif /* HW_LED_H */ diff --git a/examples/lpc2378/main.c b/examples/lpc2378/main.c index 81be7c5b..ef67627e 100644 --- a/examples/lpc2378/main.c +++ b/examples/lpc2378/main.c @@ -4,14 +4,11 @@ #include #include #include +#include "hw/hw_led.h" #define PRIO_HIGH 1 #define PRIO_LOW 0 -#define STATUS_LED (1<<19) -#define LED_ON() do { IOCLR1 = STATUS_LED; } while (0) -#define LED_OFF() do { IOSET1 = STATUS_LED; } while (0) - static Serial ser_port; static void init(void) @@ -28,7 +25,7 @@ static void init(void) IODIR0 = (1<<21); IOCLR0 = (1<<21); /* Init status led */ - IODIR1 |= STATUS_LED; + LED_INIT(); LED_OFF(); } -- 2.25.1