diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/PPC-SPC560B-GCC/main.c | 52 | ||||
-rw-r--r-- | demos/PPC-SPC560P-GCC/main.c | 52 | ||||
-rw-r--r-- | demos/PPC-SPC563M-GCC/halconf.h | 2 | ||||
-rw-r--r-- | demos/PPC-SPC563M-GCC/main.c | 21 |
4 files changed, 61 insertions, 66 deletions
diff --git a/demos/PPC-SPC560B-GCC/main.c b/demos/PPC-SPC560B-GCC/main.c index db7f03f2b..d77e2ae07 100644 --- a/demos/PPC-SPC560B-GCC/main.c +++ b/demos/PPC-SPC560B-GCC/main.c @@ -103,59 +103,59 @@ static msg_t Thread1(void *arg) { unsigned i;
for (i = 0; i < 4; i++) {
- palClearPad(PE, PE_LED1);
+ palClearPad(PORT_E, PE_LED1);
chThdSleepMilliseconds(100);
- palClearPad(PE, PE_LED2);
+ palClearPad(PORT_E, PE_LED2);
chThdSleepMilliseconds(100);
- palClearPad(PE, PE_LED3);
+ palClearPad(PORT_E, PE_LED3);
chThdSleepMilliseconds(100);
- palClearPad(PE, PE_LED4);
+ palClearPad(PORT_E, PE_LED4);
chThdSleepMilliseconds(100);
- palSetPad(PE, PE_LED1);
+ palSetPad(PORT_E, PE_LED1);
chThdSleepMilliseconds(100);
- palSetPad(PE, PE_LED2);
+ palSetPad(PORT_E, PE_LED2);
chThdSleepMilliseconds(100);
- palSetPad(PE, PE_LED3);
+ palSetPad(PORT_E, PE_LED3);
chThdSleepMilliseconds(100);
- palSetPad(PE, PE_LED4);
+ palSetPad(PORT_E, PE_LED4);
chThdSleepMilliseconds(300);
}
for (i = 0; i < 4; i++) {
- palTogglePort(PE, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
- PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
+ palTogglePort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
+ PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
chThdSleepMilliseconds(500);
- palTogglePort(PE, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
- PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
+ palTogglePort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
+ PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
chThdSleepMilliseconds(500);
}
for (i = 0; i < 4; i++) {
- palTogglePad(PE, PE_LED1);
+ palTogglePad(PORT_E, PE_LED1);
chThdSleepMilliseconds(250);
- palTogglePad(PE, PE_LED1);
- palTogglePad(PE, PE_LED2);
+ palTogglePad(PORT_E, PE_LED1);
+ palTogglePad(PORT_E, PE_LED2);
chThdSleepMilliseconds(250);
- palTogglePad(PE, PE_LED2);
- palTogglePad(PE, PE_LED3);
+ palTogglePad(PORT_E, PE_LED2);
+ palTogglePad(PORT_E, PE_LED3);
chThdSleepMilliseconds(250);
- palTogglePad(PE, PE_LED3);
- palTogglePad(PE, PE_LED4);
+ palTogglePad(PORT_E, PE_LED3);
+ palTogglePad(PORT_E, PE_LED4);
chThdSleepMilliseconds(250);
- palTogglePad(PE, PE_LED4);
+ palTogglePad(PORT_E, PE_LED4);
}
for (i = 0; i < 4; i++) {
- palClearPort(PE, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED3));
- palSetPort(PE, PAL_PORT_BIT(PE_LED2) | PAL_PORT_BIT(PE_LED4));
+ palClearPort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED3));
+ palSetPort(PORT_E, PAL_PORT_BIT(PE_LED2) | PAL_PORT_BIT(PE_LED4));
chThdSleepMilliseconds(500);
- palClearPort(PE, PAL_PORT_BIT(PE_LED2) | PAL_PORT_BIT(PE_LED4));
- palSetPort(PE, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED3));
+ palClearPort(PORT_E, PAL_PORT_BIT(PE_LED2) | PAL_PORT_BIT(PE_LED4));
+ palSetPort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED3));
chThdSleepMilliseconds(500);
}
- palSetPort(PE, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
- PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
+ palSetPort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) |
+ PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_LED4));
}
return 0;
}
diff --git a/demos/PPC-SPC560P-GCC/main.c b/demos/PPC-SPC560P-GCC/main.c index e3c18471d..108f4c1fb 100644 --- a/demos/PPC-SPC560P-GCC/main.c +++ b/demos/PPC-SPC560P-GCC/main.c @@ -103,59 +103,59 @@ static msg_t Thread1(void *arg) { unsigned i;
for (i = 0; i < 4; i++) {
- palClearPad(PD, PD_LED1);
+ palClearPad(PORT_D, PD_LED1);
chThdSleepMilliseconds(100);
- palClearPad(PD, PD_LED2);
+ palClearPad(PORT_D, PD_LED2);
chThdSleepMilliseconds(100);
- palClearPad(PD, PD_LED3);
+ palClearPad(PORT_D, PD_LED3);
chThdSleepMilliseconds(100);
- palClearPad(PD, PD_LED4);
+ palClearPad(PORT_D, PD_LED4);
chThdSleepMilliseconds(100);
- palSetPad(PD, PD_LED1);
+ palSetPad(PORT_D, PD_LED1);
chThdSleepMilliseconds(100);
- palSetPad(PD, PD_LED2);
+ palSetPad(PORT_D, PD_LED2);
chThdSleepMilliseconds(100);
- palSetPad(PD, PD_LED3);
+ palSetPad(PORT_D, PD_LED3);
chThdSleepMilliseconds(100);
- palSetPad(PD, PD_LED4);
+ palSetPad(PORT_D, PD_LED4);
chThdSleepMilliseconds(300);
}
for (i = 0; i < 4; i++) {
- palTogglePort(PD, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED2) |
- PAL_PORT_BIT(PD_LED3) | PAL_PORT_BIT(PD_LED4));
+ palTogglePort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED2) |
+ PAL_PORT_BIT(PD_LED3) | PAL_PORT_BIT(PD_LED4));
chThdSleepMilliseconds(500);
- palTogglePort(PD, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED2) |
- PAL_PORT_BIT(PD_LED3) | PAL_PORT_BIT(PD_LED4));
+ palTogglePort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED2) |
+ PAL_PORT_BIT(PD_LED3) | PAL_PORT_BIT(PD_LED4));
chThdSleepMilliseconds(500);
}
for (i = 0; i < 4; i++) {
- palTogglePad(PD, PD_LED1);
+ palTogglePad(PORT_D, PD_LED1);
chThdSleepMilliseconds(250);
- palTogglePad(PD, PD_LED1);
- palTogglePad(PD, PD_LED2);
+ palTogglePad(PORT_D, PD_LED1);
+ palTogglePad(PORT_D, PD_LED2);
chThdSleepMilliseconds(250);
- palTogglePad(PD, PD_LED2);
- palTogglePad(PD, PD_LED3);
+ palTogglePad(PORT_D, PD_LED2);
+ palTogglePad(PORT_D, PD_LED3);
chThdSleepMilliseconds(250);
- palTogglePad(PD, PD_LED3);
- palTogglePad(PD, PD_LED4);
+ palTogglePad(PORT_D, PD_LED3);
+ palTogglePad(PORT_D, PD_LED4);
chThdSleepMilliseconds(250);
- palTogglePad(PD, PD_LED4);
+ palTogglePad(PORT_D, PD_LED4);
}
for (i = 0; i < 4; i++) {
- palClearPort(PD, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED3));
- palSetPort(PD, PAL_PORT_BIT(PD_LED2) | PAL_PORT_BIT(PD_LED4));
+ palClearPort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED3));
+ palSetPort(PORT_D, PAL_PORT_BIT(PD_LED2) | PAL_PORT_BIT(PD_LED4));
chThdSleepMilliseconds(500);
- palClearPort(PD, PAL_PORT_BIT(PD_LED2) | PAL_PORT_BIT(PD_LED4));
- palSetPort(PD, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED3));
+ palClearPort(PORT_D, PAL_PORT_BIT(PD_LED2) | PAL_PORT_BIT(PD_LED4));
+ palSetPort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED3));
chThdSleepMilliseconds(500);
}
- palSetPort(PD, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED2) |
- PAL_PORT_BIT(PD_LED3) | PAL_PORT_BIT(PD_LED4));
+ palSetPort(PORT_D, PAL_PORT_BIT(PD_LED1) | PAL_PORT_BIT(PD_LED2) |
+ PAL_PORT_BIT(PD_LED3) | PAL_PORT_BIT(PD_LED4));
}
return 0;
}
diff --git a/demos/PPC-SPC563M-GCC/halconf.h b/demos/PPC-SPC563M-GCC/halconf.h index bab04ab7b..c9b3ad25a 100644 --- a/demos/PPC-SPC563M-GCC/halconf.h +++ b/demos/PPC-SPC563M-GCC/halconf.h @@ -45,7 +45,7 @@ * @brief Enables the PAL subsystem.
*/
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
-#define HAL_USE_PAL FALSE
+#define HAL_USE_PAL TRUE
#endif
/**
diff --git a/demos/PPC-SPC563M-GCC/main.c b/demos/PPC-SPC563M-GCC/main.c index aab1b4d44..fdce9de21 100644 --- a/demos/PPC-SPC563M-GCC/main.c +++ b/demos/PPC-SPC563M-GCC/main.c @@ -101,27 +101,22 @@ static msg_t Thread1(void *arg) { (void)arg;
chRegSetThreadName("blinker");
- SIU.GPDO[GPIO_LED1].R = 1;
- SIU.GPDO[GPIO_LED2].R = 1;
- SIU.GPDO[GPIO_LED3].R = 1;
- SIU.GPDO[GPIO_LED4].R = 1;
-
while (TRUE) {
- SIU.GPDO[GPIO_LED1].R = 0;
+ palClearPad(PORT11, P11_LED1);
chThdSleepMilliseconds(100);
- SIU.GPDO[GPIO_LED2].R = 0;
+ palClearPad(PORT11, P11_LED2);
chThdSleepMilliseconds(100);
- SIU.GPDO[GPIO_LED3].R = 0;
+ palClearPad(PORT11, P11_LED3);
chThdSleepMilliseconds(100);
- SIU.GPDO[GPIO_LED4].R = 0;
+ palClearPad(PORT11, P11_LED4);
chThdSleepMilliseconds(100);
- SIU.GPDO[GPIO_LED1].R = 1;
+ palSetPad(PORT11, P11_LED1);
chThdSleepMilliseconds(100);
- SIU.GPDO[GPIO_LED2].R = 1;
+ palSetPad(PORT11, P11_LED2);
chThdSleepMilliseconds(100);
- SIU.GPDO[GPIO_LED3].R = 1;
+ palSetPad(PORT11, P11_LED3);
chThdSleepMilliseconds(100);
- SIU.GPDO[GPIO_LED4].R = 1;
+ palSetPad(PORT11, P11_LED4);
chThdSleepMilliseconds(300);
}
return 0;
|