aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-08-27 16:42:07 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-08-27 16:42:07 +0000
commit8b55cb9767ce881b7a22c5af34605ed3a261582d (patch)
tree2b1e4239c2909496d83058a0a16da65525c9e70c /demos
parentb8e618f59a5bc34aa76e2aacd6484ad217c54e33 (diff)
downloadChibiOS-8b55cb9767ce881b7a22c5af34605ed3a261582d.tar.gz
ChibiOS-8b55cb9767ce881b7a22c5af34605ed3a261582d.tar.bz2
ChibiOS-8b55cb9767ce881b7a22c5af34605ed3a261582d.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1109 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/ARM7-AT91SAM7X-GCC/board.c14
-rw-r--r--demos/ARM7-AT91SAM7X-GCC/main.c16
-rw-r--r--demos/ARM7-AT91SAM7X-WEB-GCC/board.c14
-rw-r--r--demos/ARM7-AT91SAM7X-WEB-GCC/main.c16
-rw-r--r--demos/ARM7-LPC214x-G++/main.cpp12
-rw-r--r--demos/ARM7-LPC214x-GCC-minimal/main.c12
-rw-r--r--demos/ARM7-LPC214x-GCC/main.c28
-rw-r--r--demos/ARM7-LPC214x-GCC/mmcsd.c4
-rw-r--r--demos/ARMCM3-STM32F103-GCC/main.c12
-rw-r--r--demos/MSP430-MSP430x1611-GCC/main.c12
10 files changed, 70 insertions, 70 deletions
diff --git a/demos/ARM7-AT91SAM7X-GCC/board.c b/demos/ARM7-AT91SAM7X-GCC/board.c
index fb52c8f3b..31e362845 100644
--- a/demos/ARM7-AT91SAM7X-GCC/board.c
+++ b/demos/ARM7-AT91SAM7X-GCC/board.c
@@ -133,25 +133,25 @@ void hwinit1(void) {
/*
* LCD pins setup.
*/
- palClearPad(IOPORT_B, PIOB_LCD_BL);
- palSetPadMode(IOPORT_B, PIOB_LCD_BL, PAL_MODE_OUTPUT_PUSHPULL);
+ palClearPad(IOPORT2, PIOB_LCD_BL);
+ palSetPadMode(IOPORT2, PIOB_LCD_BL, PAL_MODE_OUTPUT_PUSHPULL);
- palSetPad(IOPORT_A, PIOA_LCD_RESET);
- palSetPadMode(IOPORT_A, PIOA_LCD_RESET, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPad(IOPORT1, PIOA_LCD_RESET);
+ palSetPadMode(IOPORT1, PIOA_LCD_RESET, PAL_MODE_OUTPUT_PUSHPULL);
/*
* Joystick and buttons setup.
*/
- palSetGroupMode(IOPORT_A,
+ palSetGroupMode(IOPORT1,
PIOA_B1_MASK | PIOA_B2_MASK | PIOA_B3_MASK |
PIOA_B4_MASK | PIOA_B5_MASK,
PAL_MODE_INPUT);
- palSetGroupMode(IOPORT_B, PIOB_SW1_MASK | PIOB_SW2_MASK, PAL_MODE_INPUT);
+ palSetGroupMode(IOPORT2, PIOB_SW1_MASK | PIOB_SW2_MASK, PAL_MODE_INPUT);
/*
* MMC/SD slot setup.
*/
- palSetGroupMode(IOPORT_B,
+ palSetGroupMode(IOPORT2,
PIOB_MMC_WP_MASK | PIOB_MMC_CP_MASK,
PAL_MODE_INPUT);
diff --git a/demos/ARM7-AT91SAM7X-GCC/main.c b/demos/ARM7-AT91SAM7X-GCC/main.c
index d1ca61cc7..f6c297a41 100644
--- a/demos/ARM7-AT91SAM7X-GCC/main.c
+++ b/demos/ARM7-AT91SAM7X-GCC/main.c
@@ -28,9 +28,9 @@ static WORKING_AREA(waThread1, 64);
static msg_t Thread1(void *arg) {
while (TRUE) {
- palSetPad(IOPORT_B, PIOB_LCD_BL);
+ palSetPad(IOPORT2, PIOB_LCD_BL);
chThdSleepMilliseconds(100);
- palClearPad(IOPORT_B, PIOB_LCD_BL);
+ palClearPad(IOPORT2, PIOB_LCD_BL);
chThdSleepMilliseconds(900);
}
return 0;
@@ -43,9 +43,9 @@ static msg_t Thread1(void *arg) {
int main(int argc, char **argv) {
/*
- * Activates the communication port 1 using the driver default configuration.
+ * Activates the serial driver 1 using the driver default configuration.
*/
- sdStart(&COM1, NULL);
+ sdStart(&SD1, NULL);
/*
* Creates the blinker thread.
@@ -57,10 +57,10 @@ int main(int argc, char **argv) {
*/
while (TRUE) {
chThdSleepMilliseconds(500);
- if (!palReadPad(IOPORT_B, PIOB_SW1))
- sdWrite(&COM1, (uint8_t *)"Hello World!\r\n", 14);
- if (!palReadPad(IOPORT_B, PIOB_SW2))
- TestThread(&COM1);
+ if (!palReadPad(IOPORT2, PIOB_SW1))
+ sdWrite(&SD1, (uint8_t *)"Hello World!\r\n", 14);
+ if (!palReadPad(IOPORT2, PIOB_SW2))
+ TestThread(&SD1);
}
return 0;
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/board.c b/demos/ARM7-AT91SAM7X-WEB-GCC/board.c
index 51efb3c6d..e57f8bcdc 100644
--- a/demos/ARM7-AT91SAM7X-WEB-GCC/board.c
+++ b/demos/ARM7-AT91SAM7X-WEB-GCC/board.c
@@ -135,25 +135,25 @@ void hwinit1(void) {
/*
* LCD pins setup.
*/
- palClearPad(IOPORT_B, PIOB_LCD_BL);
- palSetPadMode(IOPORT_B, PIOB_LCD_BL, PAL_MODE_OUTPUT_PUSHPULL);
+ palClearPad(IOPORT2, PIOB_LCD_BL);
+ palSetPadMode(IOPORT2, PIOB_LCD_BL, PAL_MODE_OUTPUT_PUSHPULL);
- palSetPad(IOPORT_A, PIOA_LCD_RESET);
- palSetPadMode(IOPORT_A, PIOA_LCD_RESET, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPad(IOPORT1, PIOA_LCD_RESET);
+ palSetPadMode(IOPORT1, PIOA_LCD_RESET, PAL_MODE_OUTPUT_PUSHPULL);
/*
* Joystick and buttons setup.
*/
- palSetGroupMode(IOPORT_A,
+ palSetGroupMode(IOPORT1,
PIOA_B1_MASK | PIOA_B2_MASK | PIOA_B3_MASK |
PIOA_B4_MASK | PIOA_B5_MASK,
PAL_MODE_INPUT);
- palSetGroupMode(IOPORT_B, PIOB_SW1_MASK | PIOB_SW2_MASK, PAL_MODE_INPUT);
+ palSetGroupMode(IOPORT2, PIOB_SW1_MASK | PIOB_SW2_MASK, PAL_MODE_INPUT);
/*
* MMC/SD slot setup.
*/
- palSetGroupMode(IOPORT_B,
+ palSetGroupMode(IOPORT2,
PIOB_MMC_WP_MASK | PIOB_MMC_CP_MASK,
PAL_MODE_INPUT);
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/main.c b/demos/ARM7-AT91SAM7X-WEB-GCC/main.c
index e18d83d71..adfba225f 100644
--- a/demos/ARM7-AT91SAM7X-WEB-GCC/main.c
+++ b/demos/ARM7-AT91SAM7X-WEB-GCC/main.c
@@ -33,9 +33,9 @@ static WORKING_AREA(waThread1, 64);
static msg_t Thread1(void *arg) {
while (TRUE) {
- palSetPad(IOPORT_B, PIOB_LCD_BL);
+ palSetPad(IOPORT2, PIOB_LCD_BL);
chThdSleepMilliseconds(100);
- palClearPad(IOPORT_B, PIOB_LCD_BL);
+ palClearPad(IOPORT2, PIOB_LCD_BL);
chThdSleepMilliseconds(900);
}
return 0;
@@ -48,9 +48,9 @@ static msg_t Thread1(void *arg) {
int main(int argc, char **argv) {
/*
- * Activates the communication port 1 using the driver default configuration.
+ * Activates the serial driver 2 using the driver default configuration.
*/
- sdStart(&COM1, NULL);
+ sdStart(&SD1, NULL);
/*
* Creates the blinker and web server threads.
@@ -63,10 +63,10 @@ int main(int argc, char **argv) {
*/
while (TRUE) {
chThdSleepMilliseconds(500);
- if (!palReadPad(IOPORT_B, PIOB_SW1))
- sdWrite(&COM1, (uint8_t *)"Hello World!\r\n", 14);
- if (!palReadPad(IOPORT_B, PIOB_SW2))
- TestThread(&COM1);
+ if (!palReadPad(IOPORT2, PIOB_SW1))
+ sdWrite(&SD1, (uint8_t *)"Hello World!\r\n", 14);
+ if (!palReadPad(IOPORT2, PIOB_SW2))
+ TestThread(&SD1);
}
return 0;
diff --git a/demos/ARM7-LPC214x-G++/main.cpp b/demos/ARM7-LPC214x-G++/main.cpp
index b217e86a2..b46ccd86e 100644
--- a/demos/ARM7-LPC214x-G++/main.cpp
+++ b/demos/ARM7-LPC214x-G++/main.cpp
@@ -99,10 +99,10 @@ protected:
case STOP:
return 0;
case BITCLEAR:
- palClearPort(IOPORT_A, curr->value);
+ palClearPort(IOPORT1, curr->value);
break;
case BITSET:
- palSetPort(IOPORT_A, curr->value);
+ palSetPort(IOPORT1, curr->value);
break;
}
curr++;
@@ -124,7 +124,7 @@ class TesterThread : public EnhancedThread<128> {
protected:
virtual msg_t Main(void) {
- return TestThread(&COM1);
+ return TestThread(&SD1);
}
public:
@@ -137,7 +137,7 @@ public:
*/
static void TimerHandler(eventid_t id) {
- if (!(palReadPort(IOPORT_A) & BOTH_BUTTONS)) { // Both buttons
+ if (!(palReadPort(IOPORT1) & BOTH_BUTTONS)) { // Both buttons
TesterThread tester;
tester.Wait();
};
@@ -155,9 +155,9 @@ int main(int argc, char **argv) {
struct EventListener el0;
/*
- * Activates the communication port 1 using the driver default configuration.
+ * Activates the serial driver 2 using the driver default configuration.
*/
- sdStart(&COM1, NULL);
+ sdStart(&SD1, NULL);
evtInit(&evt, 500); // Initializes an event timer.
evtStart(&evt); // Starts the event timer.
diff --git a/demos/ARM7-LPC214x-GCC-minimal/main.c b/demos/ARM7-LPC214x-GCC-minimal/main.c
index 83d192b91..d303237c4 100644
--- a/demos/ARM7-LPC214x-GCC-minimal/main.c
+++ b/demos/ARM7-LPC214x-GCC-minimal/main.c
@@ -29,13 +29,13 @@ static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) {
while (TRUE) {
- palClearPort(IOPORT_A, PAL_PORT_BIT(PA_LED2));
+ palClearPort(IOPORT1, PAL_PORT_BIT(PA_LED2));
chThdSleepMilliseconds(200);
- palSetPort(IOPORT_A, PAL_PORT_BIT(PA_LED1) | PAL_PORT_BIT(PA_LED2));
+ palSetPort(IOPORT1, PAL_PORT_BIT(PA_LED1) | PAL_PORT_BIT(PA_LED2));
chThdSleepMilliseconds(800);
- palClearPort(IOPORT_A, PAL_PORT_BIT(PA_LED1));
+ palClearPort(IOPORT1, PAL_PORT_BIT(PA_LED1));
chThdSleepMilliseconds(200);
- palSetPort(IOPORT_A, PAL_PORT_BIT(PA_LED1) | PAL_PORT_BIT(PA_LED2));
+ palSetPort(IOPORT1, PAL_PORT_BIT(PA_LED1) | PAL_PORT_BIT(PA_LED2));
chThdSleepMilliseconds(800);
}
return 0;
@@ -48,9 +48,9 @@ static WORKING_AREA(waThread2, 128);
static msg_t Thread2(void *arg) {
while (TRUE) {
- palClearPad(IOPORT_A, PA_LEDUSB);
+ palClearPad(IOPORT1, PA_LEDUSB);
chThdSleepMilliseconds(200);
- palSetPad(IOPORT_A, PA_LEDUSB);
+ palSetPad(IOPORT1, PA_LEDUSB);
chThdSleepMilliseconds(300);
}
return 0;
diff --git a/demos/ARM7-LPC214x-GCC/main.c b/demos/ARM7-LPC214x-GCC/main.c
index 33197c2cb..a8db1b667 100644
--- a/demos/ARM7-LPC214x-GCC/main.c
+++ b/demos/ARM7-LPC214x-GCC/main.c
@@ -36,13 +36,13 @@ static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) {
while (TRUE) {
- palClearPort(IOPORT_A, PAL_PORT_BIT(PA_LED2));
+ palClearPort(IOPORT1, PAL_PORT_BIT(PA_LED2));
chThdSleepMilliseconds(200);
- palSetPort(IOPORT_A, PAL_PORT_BIT(PA_LED1) | PAL_PORT_BIT(PA_LED2));
+ palSetPort(IOPORT1, PAL_PORT_BIT(PA_LED1) | PAL_PORT_BIT(PA_LED2));
chThdSleepMilliseconds(800);
- palClearPort(IOPORT_A, PAL_PORT_BIT(PA_LED1));
+ palClearPort(IOPORT1, PAL_PORT_BIT(PA_LED1));
chThdSleepMilliseconds(200);
- palSetPort(IOPORT_A, PAL_PORT_BIT(PA_LED1) | PAL_PORT_BIT(PA_LED2));
+ palSetPort(IOPORT1, PAL_PORT_BIT(PA_LED1) | PAL_PORT_BIT(PA_LED2));
chThdSleepMilliseconds(800);
}
return 0;
@@ -55,9 +55,9 @@ static WORKING_AREA(waThread2, 128);
static msg_t Thread2(void *arg) {
while (TRUE) {
- palClearPad(IOPORT_A, PA_LEDUSB);
+ palClearPad(IOPORT1, PA_LEDUSB);
chThdSleepMilliseconds(200);
- palSetPad(IOPORT_A, PA_LEDUSB);
+ palSetPad(IOPORT1, PA_LEDUSB);
chThdSleepMilliseconds(300);
}
return 0;
@@ -70,17 +70,17 @@ static WORKING_AREA(waTestThread, 128);
*/
static void TimerHandler(eventid_t id) {
- if (!(palReadPort(IOPORT_A) & BOTH_BUTTONS)) {
+ if (!(palReadPort(IOPORT1) & BOTH_BUTTONS)) {
Thread *tp = chThdCreateStatic(waTestThread, sizeof(waTestThread),
- NORMALPRIO, TestThread, &COM1);
+ NORMALPRIO, TestThread, &SD1);
chThdWait(tp);
PlaySound(500, MS2ST(100));
}
else {
- if (!palReadPad(IOPORT_A, PA_BUTTON1))
+ if (!palReadPad(IOPORT1, PA_BUTTON1))
PlaySound(1000, MS2ST(100));
- if (!palReadPad(IOPORT_A, PA_BUTTON2)) {
- sdWrite(&COM1, (uint8_t *)"Hello World!\r\n", 14);
+ if (!palReadPad(IOPORT1, PA_BUTTON2)) {
+ sdWrite(&SD1, (uint8_t *)"Hello World!\r\n", 14);
PlaySound(2000, MS2ST(100));
}
}
@@ -129,15 +129,15 @@ int main(int argc, char **argv) {
struct EventListener el0, el1, el2;
/*
- * Activates the communication port 1 using the driver default configuration.
+ * Activates the serial driver 2 using the driver default configuration.
*/
- sdStart(&COM1, NULL);
+ sdStart(&SD1, NULL);
/*
* If a button is pressed during the reset then the blinking leds threads
* are not started in order to make accurate benchmarks.
*/
- if ((palReadPort(IOPORT_A) & BOTH_BUTTONS) == BOTH_BUTTONS) {
+ if ((palReadPort(IOPORT1) & BOTH_BUTTONS) == BOTH_BUTTONS) {
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, NULL);
}
diff --git a/demos/ARM7-LPC214x-GCC/mmcsd.c b/demos/ARM7-LPC214x-GCC/mmcsd.c
index 98ff2a23b..aba532544 100644
--- a/demos/ARM7-LPC214x-GCC/mmcsd.c
+++ b/demos/ARM7-LPC214x-GCC/mmcsd.c
@@ -43,7 +43,7 @@ void InitMMC(void) {
void tmrfunc(void *par) {
if (cnt) {
- if (!palReadPad(IOPORT_B, PB_CP1)) {
+ if (!palReadPad(IOPORT2, PB_CP1)) {
if (!--cnt)
chEvtBroadcastI(&MMCInsertEventSource);
}
@@ -51,7 +51,7 @@ void tmrfunc(void *par) {
cnt = POLLING_INTERVAL;
}
else {
- if (palReadPad(IOPORT_B, PB_CP1)) {
+ if (palReadPad(IOPORT2, PB_CP1)) {
cnt = POLLING_INTERVAL;
chEvtBroadcastI(&MMCRemoveEventSource);
}
diff --git a/demos/ARMCM3-STM32F103-GCC/main.c b/demos/ARMCM3-STM32F103-GCC/main.c
index d1f78f7e8..ca2fa842b 100644
--- a/demos/ARMCM3-STM32F103-GCC/main.c
+++ b/demos/ARMCM3-STM32F103-GCC/main.c
@@ -31,9 +31,9 @@ static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) {
while (TRUE) {
- palClearPad(IOPORT_C, GPIOC_LED);
+ palClearPad(IOPORT3, GPIOC_LED);
chThdSleepMilliseconds(500);
- palSetPad(IOPORT_C, GPIOC_LED);
+ palSetPad(IOPORT3, GPIOC_LED);
chThdSleepMilliseconds(500);
}
return 0;
@@ -46,9 +46,9 @@ static msg_t Thread1(void *arg) {
int main(int argc, char **argv) {
/*
- * Activates the communication port 2 using the driver default configuration.
+ * Activates the serial driver 2 using the driver default configuration.
*/
- sdStart(&COM2, NULL);
+ sdStart(&SD2, NULL);
/*
* Creates the blinker thread.
@@ -60,8 +60,8 @@ int main(int argc, char **argv) {
* sleeping in a loop and check the button state.
*/
while (TRUE) {
- if (palReadPad(IOPORT_A, GPIOA_BUTTON))
- TestThread(&COM2);
+ if (palReadPad(IOPORT1, GPIOA_BUTTON))
+ TestThread(&SD2);
chThdSleepMilliseconds(500);
}
return 0;
diff --git a/demos/MSP430-MSP430x1611-GCC/main.c b/demos/MSP430-MSP430x1611-GCC/main.c
index d52f2bb07..02622e817 100644
--- a/demos/MSP430-MSP430x1611-GCC/main.c
+++ b/demos/MSP430-MSP430x1611-GCC/main.c
@@ -31,9 +31,9 @@ static WORKING_AREA(waThread1, 64);
static msg_t Thread1(void *arg) {
while (TRUE) {
- palSetPad(IOPORT_F, P6_O_LED);
+ palSetPad(IOPORT6, P6_O_LED);
chThdSleepMilliseconds(500);
- palClearPad(IOPORT_F, P6_O_LED);
+ palClearPad(IOPORT6, P6_O_LED);
chThdSleepMilliseconds(500);
}
return 0;
@@ -50,9 +50,9 @@ int main(int argc, char **argv) {
hwinit();
/*
- * Activates the communication port 1 using the driver default configuration.
+ * Activates the serial driver 2 using the driver default configuration.
*/
- sdStart(&COM1, NULL);
+ sdStart(&SD1, NULL);
/*
* The main() function becomes a thread here then the interrupts are
@@ -70,8 +70,8 @@ int main(int argc, char **argv) {
* sleeping in a loop.
*/
while (TRUE) {
- if (!palReadPad(IOPORT_F, P6_I_BUTTON))
- TestThread(&COM1);
+ if (!palReadPad(IOPORT6, P6_I_BUTTON))
+ TestThread(&SD1);
chThdSleepMilliseconds(500);
}
return 0;