diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-06-02 13:41:38 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-06-02 13:41:38 +0000 |
commit | 2a7941ee58016ce7641ab8010aff5fe711e0bedc (patch) | |
tree | 4ac467770e31cbf9245936b998d47e0809bf28b7 /demos/ARM7-LPC214x-G++/main.cpp | |
parent | 1aa2773ad03807e3d5c9822ea108bc2e280281db (diff) | |
download | ChibiOS-2a7941ee58016ce7641ab8010aff5fe711e0bedc.tar.gz ChibiOS-2a7941ee58016ce7641ab8010aff5fe711e0bedc.tar.bz2 ChibiOS-2a7941ee58016ce7641ab8010aff5fe711e0bedc.zip |
I/O port driver for LPC214x added.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1016 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARM7-LPC214x-G++/main.cpp')
-rw-r--r-- | demos/ARM7-LPC214x-G++/main.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/demos/ARM7-LPC214x-G++/main.cpp b/demos/ARM7-LPC214x-G++/main.cpp index 647dee8a3..1a50f5936 100644 --- a/demos/ARM7-LPC214x-G++/main.cpp +++ b/demos/ARM7-LPC214x-G++/main.cpp @@ -18,11 +18,12 @@ */
#include <ch.hpp>
+#include <ioports.h>
#include <evtimer.h>
#include <test.h>
-#include <lpc214x.h>
+#include <board.h>
#include <lpc214x_serial.h>
using namespace chibios_rt;
@@ -47,9 +48,9 @@ typedef struct { // Flashing sequence for LED1.
static const seqop_t LED1_sequence[] =
{
- {BITCLEAR, 0x00000400},
+ {BITCLEAR, PA_LED1},
{SLEEP, 200},
- {BITSET, 0x00000400},
+ {BITSET, PA_LED1},
{SLEEP, 1800},
{GOTO, 0}
};
@@ -58,9 +59,9 @@ static const seqop_t LED1_sequence[] = static const seqop_t LED2_sequence[] =
{
{SLEEP, 1000},
- {BITCLEAR, 0x00000800},
+ {BITCLEAR, PA_LED2},
{SLEEP, 200},
- {BITSET, 0x00000800},
+ {BITSET, PA_LED2},
{SLEEP, 1800},
{GOTO, 1}
};
@@ -68,9 +69,9 @@ static const seqop_t LED2_sequence[] = // Flashing sequence for LED3.
static const seqop_t LED3_sequence[] =
{
- {BITCLEAR, 0x80000000},
+ {BITCLEAR, PA_LEDUSB},
{SLEEP, 200},
- {BITSET, 0x80000000},
+ {BITSET, PA_LEDUSB},
{SLEEP, 300},
{GOTO, 0}
};
@@ -97,10 +98,10 @@ protected: case STOP:
return 0;
case BITCLEAR:
- IO0CLR = curr->value;
+ chPortClear(IOPORT_A, curr->value);
break;
case BITSET:
- IO0SET = curr->value;
+ chPortSet(IOPORT_A, curr->value);
break;
}
curr++;
@@ -135,7 +136,7 @@ public: */
static void TimerHandler(eventid_t id) {
- if (!(IO0PIN & 0x00018000)) { // Both buttons
+ if (!(chPortRead(IOPORT_A) & (PA_BUTTON1 | PA_BUTTON2))) { // Both buttons
TesterThread tester;
tester.Wait();
};
|