From c7670cd5c5841b5150397aeefb8597a32f7c6f30 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 13 Feb 2013 08:00:47 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5173 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/GENERIC_SPC56EL/board.c | 2 +- demos/PPC-SPC56EL-GCC/Makefile | 8 ++-- demos/PPC-SPC56EL-GCC/main.c | 78 +++++++++++++++++----------------- 3 files changed, 43 insertions(+), 45 deletions(-) diff --git a/boards/GENERIC_SPC56EL/board.c b/boards/GENERIC_SPC56EL/board.c index d3595528f..8de20d048 100644 --- a/boards/GENERIC_SPC56EL/board.c +++ b/boards/GENERIC_SPC56EL/board.c @@ -35,7 +35,7 @@ static const spc_siu_init_t spc_siu_init[] = { static const uint8_t spc_padsels_init[SPC5_SIUL_NUM_PADSELS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /** diff --git a/demos/PPC-SPC56EL-GCC/Makefile b/demos/PPC-SPC56EL-GCC/Makefile index c35491bda..03c2c8ade 100644 --- a/demos/PPC-SPC56EL-GCC/Makefile +++ b/demos/PPC-SPC56EL-GCC/Makefile @@ -51,7 +51,7 @@ include $(CHIBIOS)/os/hal/platforms/SPC56ELxx/platform.mk include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/ports/GCC/PPC/SPC56ELxx/port.mk include $(CHIBIOS)/os/kernel/kernel.mk -#include $(CHIBIOS)/test/test.mk +include $(CHIBIOS)/test/test.mk # Define linker script file here LDSCRIPT= $(PORTLD)/SPC56EL60_LSM.ld @@ -63,10 +63,10 @@ CSRC = $(PORTSRC) \ $(HALSRC) \ $(PLATFORMSRC) \ $(BOARDSRC) \ + $(CHIBIOS)/os/various/evtimer.c \ + $(CHIBIOS)/os/various/shell.c \ + $(CHIBIOS)/os/various/chprintf.c \ main.c -# $(CHIBIOS)/os/various/evtimer.c \ -# $(CHIBIOS)/os/various/shell.c \ -# $(CHIBIOS)/os/various/chprintf.c \ # C++ sources here. CPPSRC = diff --git a/demos/PPC-SPC56EL-GCC/main.c b/demos/PPC-SPC56EL-GCC/main.c index 890bdd9a3..22aac2438 100644 --- a/demos/PPC-SPC56EL-GCC/main.c +++ b/demos/PPC-SPC56EL-GCC/main.c @@ -20,11 +20,10 @@ #include "ch.h" #include "hal.h" -//#include "test.h" -//#include "shell.h" -//#include "chprintf.h" +#include "test.h" +#include "shell.h" +#include "chprintf.h" -#if 0 #define SHELL_WA_SIZE THD_WA_SIZE(1024) #define TEST_WA_SIZE THD_WA_SIZE(256) @@ -104,69 +103,68 @@ static msg_t Thread1(void *arg) { unsigned i; for (i = 0; i < 4; i++) { - palClearPad(PORT_E, PE_LED1); + palClearPad(PORT_D, PD_LED1); chThdSleepMilliseconds(100); - palClearPad(PORT_E, PE_LED2); + palClearPad(PORT_D, PD_LED2); chThdSleepMilliseconds(100); - palClearPad(PORT_E, PE_LED3); + palClearPad(PORT_D, PD_LED3); chThdSleepMilliseconds(100); - palClearPad(PORT_E, PE_LED4); + palClearPad(PORT_D, PD_LED4); chThdSleepMilliseconds(100); - palSetPad(PORT_E, PE_LED1); + palSetPad(PORT_D, PD_LED1); chThdSleepMilliseconds(100); - palSetPad(PORT_E, PE_LED2); + palSetPad(PORT_D, PD_LED2); chThdSleepMilliseconds(100); - palSetPad(PORT_E, PE_LED3); + palSetPad(PORT_D, PD_LED3); chThdSleepMilliseconds(100); - palSetPad(PORT_E, PE_LED4); + palSetPad(PORT_D, PD_LED4); chThdSleepMilliseconds(300); } for (i = 0; i < 4; i++) { - palTogglePort(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) | - PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_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(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) | - PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_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(PORT_E, PE_LED1); + palTogglePad(PORT_D, PD_LED1); chThdSleepMilliseconds(250); - palTogglePad(PORT_E, PE_LED1); - palTogglePad(PORT_E, PE_LED2); + palTogglePad(PORT_D, PD_LED1); + palTogglePad(PORT_D, PD_LED2); chThdSleepMilliseconds(250); - palTogglePad(PORT_E, PE_LED2); - palTogglePad(PORT_E, PE_LED3); + palTogglePad(PORT_D, PD_LED2); + palTogglePad(PORT_D, PD_LED3); chThdSleepMilliseconds(250); - palTogglePad(PORT_E, PE_LED3); - palTogglePad(PORT_E, PE_LED4); + palTogglePad(PORT_D, PD_LED3); + palTogglePad(PORT_D, PD_LED4); chThdSleepMilliseconds(250); - palTogglePad(PORT_E, PE_LED4); + palTogglePad(PORT_D, PD_LED4); } for (i = 0; i < 4; i++) { - 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)); + 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(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)); + 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(PORT_E, PAL_PORT_BIT(PE_LED1) | PAL_PORT_BIT(PE_LED2) | - PAL_PORT_BIT(PE_LED3) | PAL_PORT_BIT(PE_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; } -#endif /* 0 */ /* * Application entry point. */ int main(void) { -// Thread *shelltp = NULL; + Thread *shelltp = NULL; /* * System initializations. @@ -181,23 +179,23 @@ int main(void) { /* * Activates the serial driver 1 using the driver default configuration. */ -// sdStart(&SD1, NULL); + sdStart(&SD1, NULL); /* * Creates the blinker thread. */ -// chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); + chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); /* * Normal main() thread activity. */ while (TRUE) { -// if (!shelltp) -// shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO); -// else if (chThdTerminated(shelltp)) { -// chThdRelease(shelltp); /* Recovers memory of the previous shell. */ -// shelltp = NULL; /* Triggers spawning of a new shell. */ -// } + if (!shelltp) + shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO); + else if (chThdTerminated(shelltp)) { + chThdRelease(shelltp); /* Recovers memory of the previous shell. */ + shelltp = NULL; /* Triggers spawning of a new shell. */ + } chThdSleepMilliseconds(1000); } return 0;