aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARM7-AT91SAM7X-GCC
diff options
context:
space:
mode:
Diffstat (limited to 'demos/ARM7-AT91SAM7X-GCC')
-rw-r--r--demos/ARM7-AT91SAM7X-GCC/board.c3
-rw-r--r--demos/ARM7-AT91SAM7X-GCC/main.c9
2 files changed, 5 insertions, 7 deletions
diff --git a/demos/ARM7-AT91SAM7X-GCC/board.c b/demos/ARM7-AT91SAM7X-GCC/board.c
index 2b53c87b7..02ac5046d 100644
--- a/demos/ARM7-AT91SAM7X-GCC/board.c
+++ b/demos/ARM7-AT91SAM7X-GCC/board.c
@@ -101,9 +101,6 @@ void hwinit0(void) {
* PIO initialization.
*/
palInit();
-/* AT91C_BASE_PMC->PMC_PCER = (1 << AT91C_ID_PIOA) | (1 << AT91C_ID_PIOB);
- AT91C_BASE_PIOA->PIO_PER = 0xFFFFFFFF;
- AT91C_BASE_PIOB->PIO_PER = 0xFFFFFFFF;*/
}
/*
diff --git a/demos/ARM7-AT91SAM7X-GCC/main.c b/demos/ARM7-AT91SAM7X-GCC/main.c
index c51c911c9..614b649cd 100644
--- a/demos/ARM7-AT91SAM7X-GCC/main.c
+++ b/demos/ARM7-AT91SAM7X-GCC/main.c
@@ -18,6 +18,7 @@
*/
#include <ch.h>
+#include <pal.h>
#include <test.h>
#include "board.h"
@@ -27,9 +28,9 @@ static WORKING_AREA(waThread1, 64);
static msg_t Thread1(void *arg) {
while (TRUE) {
- AT91C_BASE_PIOB->PIO_SODR = PIOB_LCD_BL; // LCD on.
+ palSetPad(IOPORT_B, PIOB_LCD_BL);
chThdSleepMilliseconds(100);
- AT91C_BASE_PIOB->PIO_CODR = PIOB_LCD_BL; // LCD off.
+ palClearPad(IOPORT_B, PIOB_LCD_BL);
chThdSleepMilliseconds(900);
}
return 0;
@@ -51,9 +52,9 @@ int main(int argc, char **argv) {
*/
while (TRUE) {
chThdSleepMilliseconds(500);
- if (!(AT91C_BASE_PIOB->PIO_PDSR & PIOB_SW1))
+ if (!palReadPad(IOPORT_B, PIOB_SW1))
chFDDWrite(&COM1, (uint8_t *)"Hello World!\r\n", 14);
- if (!(AT91C_BASE_PIOB->PIO_PDSR & PIOB_SW2))
+ if (!palReadPad(IOPORT_B, PIOB_SW2))
TestThread(&COM1);
}