From d3f5e53d03b3288568f1d591ee16f662a630f127 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 7 Mar 2015 13:43:27 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7730 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/various/RT-Win32-Simulator/Makefile | 12 ++++++------ os/rt/src/chdynamic.c | 3 ++- os/rt/src/chthreads.c | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/demos/various/RT-Win32-Simulator/Makefile b/demos/various/RT-Win32-Simulator/Makefile index 8c6e0105b..ca25fd0d9 100644 --- a/demos/various/RT-Win32-Simulator/Makefile +++ b/demos/various/RT-Win32-Simulator/Makefile @@ -21,7 +21,7 @@ CC = $(TRGT)gcc AS = $(TRGT)gcc -x assembler-with-cpp # List all default C defines here, like -D_DEBUG=1 -DDEFS = -DSIMULATOR -DSHELL_USE_IPRINTF=FALSE +DDEFS = -DSIMULATOR # List all default ASM defines here, like -D_DEBUG=1 DADEFS = @@ -93,7 +93,7 @@ ULIBDIR = ULIBS = # Define optimisation level here -OPT = -ggdb -O2 -fomit-frame-pointer +OPT = -ggdb -O2 # # End of user defines @@ -108,7 +108,7 @@ LIBS = $(DLIBS) $(ULIBS) LDFLAGS = -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR) ASFLAGS = -Wa,-amhls=$(<:.s=.lst) $(ADEFS) -CPFLAGS = $(OPT) -Wall -Wextra -Wstrict-prototypes -fverbose-asm -Wa,-alms=$(<:.c=.lst) $(DEFS) +CPFLAGS = -Wall -Wextra -Wstrict-prototypes -fverbose-asm -Wa,-alms=$(<:.c=.lst) $(DEFS) # Generate dependency information CPFLAGS += -MD -MP -MF .dep/$(@F).d @@ -120,13 +120,13 @@ CPFLAGS += -MD -MP -MF .dep/$(@F).d all: $(OBJS) $(PROJECT).exe %.o : %.c - $(CC) -c $(CPFLAGS) -I . $(INCDIR) $< -o $@ + $(CC) -c $(OPT) $(CPFLAGS) -I . $(INCDIR) $< -o $@ %.o : %.s - $(AS) -c $(ASFLAGS) $< -o $@ + $(AS) -c $(OPT) $(ASFLAGS) $< -o $@ %exe: $(OBJS) - $(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@ + $(CC) $(OPT) $(OBJS) $(LDFLAGS) $(LIBS) -o $@ gcov: -mkdir gcov diff --git a/os/rt/src/chdynamic.c b/os/rt/src/chdynamic.c index 61044146e..05cb3a265 100644 --- a/os/rt/src/chdynamic.c +++ b/os/rt/src/chdynamic.c @@ -119,7 +119,8 @@ void chThdRelease(thread_t *tp) { break; #endif default: - chDbgAssert(false, "unexpected case"); + /* Nothing to do for static threads, those are removed from the + registry on exit.*/ break; } } diff --git a/os/rt/src/chthreads.c b/os/rt/src/chthreads.c index b20779fcd..69013017e 100644 --- a/os/rt/src/chthreads.c +++ b/os/rt/src/chthreads.c @@ -494,6 +494,7 @@ msg_t chThdWait(thread_t *tp) { chSysUnlock(); #if CH_CFG_USE_DYNAMIC == TRUE + /* Releasing a lock if it is a dynamic thread.*/ chThdRelease(tp); #endif