git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8917 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
Giovanni Di Sirio 2016-02-20 21:50:58 +00:00
parent 41585364a7
commit 951efe320c
7 changed files with 24 additions and 22 deletions

View File

@ -99,6 +99,8 @@ include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
# Other files (optional). # Other files (optional).
#include $(CHIBIOS)/test/rt/test.mk #include $(CHIBIOS)/test/rt/test.mk
include $(CHIBIOS)/os/hal/lib/streams/streams.mk
include $(CHIBIOS)/os/various/shell/shell.mk
# Define linker script file here # Define linker script file here
LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld
@ -113,11 +115,10 @@ CSRC = $(STARTUPSRC) \
$(PLATFORMSRC) \ $(PLATFORMSRC) \
$(BOARDSRC) \ $(BOARDSRC) \
$(TESTSRC) \ $(TESTSRC) \
$(STREAMSSRC) \
$(SHELLSRC) \
$(CHIBIOS)/os/various/evtimer.c \ $(CHIBIOS)/os/various/evtimer.c \
$(CHIBIOS)/os/various/syscalls.c \ $(CHIBIOS)/os/various/syscalls.c \
$(CHIBIOS)/os/various/shell.c \
$(CHIBIOS)/os/hal/lib/streams/memstreams.c \
$(CHIBIOS)/os/hal/lib/streams/chprintf.c \
main.c main.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global # C++ sources that can be compiled in ARM or THUMB mode depending on the global
@ -149,7 +150,8 @@ ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
$(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various $(STREAMSINC) $(SHELLINC) \
$(CHIBIOS)/os/various
# #
# Project, sources and paths # Project, sources and paths
@ -199,7 +201,7 @@ CPPWARN = -Wall -Wextra -Wundef
# #
# List all user C define here, like -D_DEBUG=1 # List all user C define here, like -D_DEBUG=1
UDEFS = UDEFS = -DSHELL_CMD_TEST_ENABLED=0
# Define ASM defines here # Define ASM defines here
UADEFS = UADEFS =

View File

@ -278,7 +278,8 @@ int main(void){
/* Shell initialization.*/ /* Shell initialization.*/
sdStart(&SD6, &ser_cfg); sdStart(&SD6, &ser_cfg);
shellInit(); shellInit();
shellCreateStatic(&shell_cfg1, waShell, sizeof(waShell), NORMALPRIO); chThdCreateStatic(waShell, sizeof(waShell), NORMALPRIO,
shellThread, (void *)&shell_cfg1);
/* wait until user do not want to test wakeup */ /* wait until user do not want to test wakeup */
while (true){ while (true){

View File

@ -99,6 +99,8 @@ include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
# Other files (optional). # Other files (optional).
#include $(CHIBIOS)/test/rt/test.mk #include $(CHIBIOS)/test/rt/test.mk
include $(CHIBIOS)/os/hal/lib/streams/streams.mk
include $(CHIBIOS)/os/various/shell/shell.mk
# Define linker script file here # Define linker script file here
LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld
@ -113,9 +115,8 @@ CSRC = $(STARTUPSRC) \
$(PLATFORMSRC) \ $(PLATFORMSRC) \
$(BOARDSRC) \ $(BOARDSRC) \
$(TESTSRC) \ $(TESTSRC) \
$(CHIBIOS)/os/hal/lib/streams/memstreams.c \ $(STREAMSSRC) \
$(CHIBIOS)/os/hal/lib/streams/chprintf.c \ $(SHELLSRC) \
$(CHIBIOS)/os/various/shell.c \
main.c main.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global # C++ sources that can be compiled in ARM or THUMB mode depending on the global
@ -147,7 +148,7 @@ ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
$(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various $(STREAMSINC) $(SHELLINC)
# #
# Project, sources and paths # Project, sources and paths
@ -197,7 +198,7 @@ CPPWARN = -Wall -Wextra -Wundef
# #
# List all user C define here, like -D_DEBUG=1 # List all user C define here, like -D_DEBUG=1
UDEFS = UDEFS = -DSHELL_CMD_TEST_ENABLED=0
# Define ASM defines here # Define ASM defines here
UADEFS = UADEFS =

View File

@ -292,7 +292,6 @@ static const ShellConfig shell_cfg1 = {
* Application entry point. * Application entry point.
*/ */
int main(void) { int main(void) {
thread_t *shelltp = NULL;
/* /*
* System initializations. * System initializations.
@ -325,15 +324,14 @@ int main(void) {
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
/* /*
* Normal main() thread activity, in this demo it does nothing. * Normal main() thread activity, spawning shells.
*/ */
while (true) { while (true) {
if (!shelltp) thread_t *shelltp = chThdCreateFromHeap(NULL, SHELL_WA_SIZE,
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO); NORMALPRIO + 1, shellThread,
else if (chThdTerminatedX(shelltp)) { (void *)&shell_cfg1);
chThdRelease(shelltp); /* Recovers memory of the previous shell. */ chThdWait(shelltp); /* Waiting termination. */
shelltp = NULL; /* Triggers spawning of a new shell. */ chThdFreeToHeap(shelltp); /* Returning memory to heap. */
}
chThdSleepMilliseconds(1000); chThdSleepMilliseconds(1000);
} }
} }

View File

@ -140,7 +140,7 @@
* *
* @note The default is @p TRUE. * @note The default is @p TRUE.
*/ */
#define CH_CFG_USE_TM TRUE #define CH_CFG_USE_TM FALSE
/** /**
* @brief Threads registry APIs. * @brief Threads registry APIs.

View File

@ -140,7 +140,7 @@
* *
* @note The default is @p TRUE. * @note The default is @p TRUE.
*/ */
#define CH_CFG_USE_TM TRUE #define CH_CFG_USE_TM FALSE
/** /**
* @brief Threads registry APIs. * @brief Threads registry APIs.

View File

@ -140,7 +140,7 @@
* *
* @note The default is @p TRUE. * @note The default is @p TRUE.
*/ */
#define CH_CFG_USE_TM TRUE #define CH_CFG_USE_TM FALSE
/** /**
* @brief Threads registry APIs. * @brief Threads registry APIs.