aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARM7-LPC214x-G++/main.cpp
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-07 17:53:23 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-06-07 17:53:23 +0000
commitbe1e6b03d4a49b6fa16c3368435089f8706fb566 (patch)
treeea4aca882019de105a00451e379ca55955c38dfb /demos/ARM7-LPC214x-G++/main.cpp
parentb2e6f6a6a5ee0af322472c151565be6cba0e1fa0 (diff)
downloadChibiOS-be1e6b03d4a49b6fa16c3368435089f8706fb566.tar.gz
ChibiOS-be1e6b03d4a49b6fa16c3368435089f8706fb566.tar.bz2
ChibiOS-be1e6b03d4a49b6fa16c3368435089f8706fb566.zip
Adjusted PAL support for LPC214x.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1026 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARM7-LPC214x-G++/main.cpp')
-rw-r--r--demos/ARM7-LPC214x-G++/main.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/demos/ARM7-LPC214x-G++/main.cpp b/demos/ARM7-LPC214x-G++/main.cpp
index 1a50f5936..683c2675d 100644
--- a/demos/ARM7-LPC214x-G++/main.cpp
+++ b/demos/ARM7-LPC214x-G++/main.cpp
@@ -18,7 +18,7 @@
*/
#include <ch.hpp>
-#include <ioports.h>
+#include <pal.h>
#include <evtimer.h>
#include <test.h>
@@ -26,6 +26,8 @@
#include <board.h>
#include <lpc214x_serial.h>
+#define BOTH_BUTTONS (PAL_PORT_BIT(PA_BUTTON1) | PAL_PORT_BIT(PA_BUTTON2))
+
using namespace chibios_rt;
/*
@@ -48,9 +50,9 @@ typedef struct {
// Flashing sequence for LED1.
static const seqop_t LED1_sequence[] =
{
- {BITCLEAR, PA_LED1},
+ {BITCLEAR, PAL_PORT_BIT(PA_LED1)},
{SLEEP, 200},
- {BITSET, PA_LED1},
+ {BITSET, PAL_PORT_BIT(PA_LED1)},
{SLEEP, 1800},
{GOTO, 0}
};
@@ -59,9 +61,9 @@ static const seqop_t LED1_sequence[] =
static const seqop_t LED2_sequence[] =
{
{SLEEP, 1000},
- {BITCLEAR, PA_LED2},
+ {BITCLEAR, PAL_PORT_BIT(PA_LED2)},
{SLEEP, 200},
- {BITSET, PA_LED2},
+ {BITSET, PAL_PORT_BIT(PA_LED2)},
{SLEEP, 1800},
{GOTO, 1}
};
@@ -69,9 +71,9 @@ static const seqop_t LED2_sequence[] =
// Flashing sequence for LED3.
static const seqop_t LED3_sequence[] =
{
- {BITCLEAR, PA_LEDUSB},
+ {BITCLEAR, PAL_PORT_BIT(PA_LEDUSB)},
{SLEEP, 200},
- {BITSET, PA_LEDUSB},
+ {BITSET, PAL_PORT_BIT(PA_LEDUSB)},
{SLEEP, 300},
{GOTO, 0}
};
@@ -98,10 +100,10 @@ protected:
case STOP:
return 0;
case BITCLEAR:
- chPortClear(IOPORT_A, curr->value);
+ palClearPort(IOPORT_A, curr->value);
break;
case BITSET:
- chPortSet(IOPORT_A, curr->value);
+ palSetPort(IOPORT_A, curr->value);
break;
}
curr++;
@@ -136,7 +138,7 @@ public:
*/
static void TimerHandler(eventid_t id) {
- if (!(chPortRead(IOPORT_A) & (PA_BUTTON1 | PA_BUTTON2))) { // Both buttons
+ if (!(palReadPort(IOPORT_A) & BOTH_BUTTONS)) { // Both buttons
TesterThread tester;
tester.Wait();
};