diff --git a/.cproject b/.cproject index afd347e..4c9acd0 100755 --- a/.cproject +++ b/.cproject @@ -224,6 +224,21 @@ + + + + + + + + + + + + + + + @@ -252,7 +267,6 @@ make - all true true @@ -260,7 +274,6 @@ make - clean true true @@ -268,7 +281,6 @@ make - all true true @@ -276,7 +288,6 @@ make - all true true @@ -284,7 +295,6 @@ make - clean true true @@ -292,7 +302,6 @@ make - distclean true false @@ -338,8 +347,17 @@ false true + + make + APP=test BOARD=stm32f4-discovery DEBUG=y + check + true + false + true + make + distclean true false @@ -387,19 +405,4 @@ - - - - - - - - - - - - - - - diff --git a/source/Makefile b/source/Makefile index e436109..97259aa 100755 --- a/source/Makefile +++ b/source/Makefile @@ -12,6 +12,7 @@ SIZEFILE = $(SIZE_DIR)/$(APP)$(SIZE_EXT) INCLUDES += $(SRC_DIR) SUB_FOLDER := +CHECK_FOLDER := SOURCES := $(wildcard $(SRC_DIR)/*.c) ASM_SOURCES := $(wildcard $(SRC_DIR)/*.s) @@ -24,10 +25,15 @@ include application/application.mk include firmware/firmware.mk SOURCES += $(foreach folder, $(SUB_FOLDER), $(wildcard $(SRC_DIR)/$(folder)/*.c)) +CHECKSOURCES += $(foreach folder, $(CHECK_FOLDER), $(wildcard $(SRC_DIR)/$(folder)/*.c)) ASMSOURCES += $(foreach folder, $(SUB_FOLDER), $(wildcard $(SRC_DIR)/$(folder)/*.s)) all: $(MAINFILE) +check: + $(CPPCHECK) $(CPPCHECK_FLAGS) $(CHECKSOURCES) + + $(MAINFILE): $(OBJECTS) $(ASM_OBJECTS) @$(MKDIR) $(EXE_DIR) @$(MKDIR) $(MAP_DIR) @@ -45,7 +51,6 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c @$(MKDIR) $(OBJ_DIR) @$(foreach folder, $(SUB_FOLDER), $(shell mkdir -p $(OBJ_DIR)/$(folder))) $(call makedep,$<,$@,$(subst .o,.d,$@)) - $(CPPCHECK) $(CPPCHECK_FLAGS) $< $(CC) $(CFLAGS) -c $< -o $@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.s diff --git a/source/application/example_semaphore/example_semaphore.mk b/source/application/example_semaphore/example_semaphore.mk index da50f6c..5658595 100755 --- a/source/application/example_semaphore/example_semaphore.mk +++ b/source/application/example_semaphore/example_semaphore.mk @@ -1,3 +1,4 @@ +CHECK_FOLDER += application/example_semaphore +SUB_FOLDER += application/example_semaphore INCLUDES += application/example_semaphore DOC_SRC += application/example_semaphore -SUB_FOLDER += application/example_semaphore diff --git a/source/application/test/test.mk b/source/application/test/test.mk index 644eac5..ca3a7a2 100755 --- a/source/application/test/test.mk +++ b/source/application/test/test.mk @@ -1,3 +1,4 @@ +CHECK_FOLDER += application/test +SUB_FOLDER += application/test INCLUDES += application/test DOC_SRC += application/test -SUB_FOLDER += application/test \ No newline at end of file diff --git a/source/firmware/arch/stm32f4xx/board/stm32f4-discovery/stm32f4-discovery.mk b/source/firmware/arch/stm32f4xx/board/stm32f4-discovery/stm32f4-discovery.mk index bd155b4..49361a9 100755 --- a/source/firmware/arch/stm32f4xx/board/stm32f4-discovery/stm32f4-discovery.mk +++ b/source/firmware/arch/stm32f4xx/board/stm32f4-discovery/stm32f4-discovery.mk @@ -1,3 +1,4 @@ +CHECK_FOLDER += firmware/arch/stm32f4xx/board/stm32f4-discovery SUB_FOLDER += firmware/arch/stm32f4xx/board/stm32f4-discovery INCLUDES += firmware/arch/stm32f4xx/board/stm32f4-discovery DOC_SRC += firmware/arch/stm32f4xx/board/stm32f4-discovery \ No newline at end of file diff --git a/source/firmware/arch/stm32f4xx/driver/gpio/gpio.mk b/source/firmware/arch/stm32f4xx/driver/gpio/gpio.mk index 48e1e68..2134a26 100755 --- a/source/firmware/arch/stm32f4xx/driver/gpio/gpio.mk +++ b/source/firmware/arch/stm32f4xx/driver/gpio/gpio.mk @@ -1,3 +1,4 @@ +CHECK_FOLDER += firmware/arch/stm32f4xx/driver/gpio SUB_FOLDER += firmware/arch/stm32f4xx/driver/gpio INCLUDES += firmware/arch/stm32f4xx/driver/gpio DOC_SRC += firmware/arch/stm32f4xx/driver/gpio diff --git a/source/firmware/arch/stm32f4xx/driver/timer/timer.mk b/source/firmware/arch/stm32f4xx/driver/timer/timer.mk index 8d921e3..9a632d3 100755 --- a/source/firmware/arch/stm32f4xx/driver/timer/timer.mk +++ b/source/firmware/arch/stm32f4xx/driver/timer/timer.mk @@ -1,3 +1,4 @@ +CHECK_FOLDER += firmware/arch/stm32f4xx/driver/timer SUB_FOLDER += firmware/arch/stm32f4xx/driver/timer INCLUDES += firmware/arch/stm32f4xx/driver/timer DOC_SRC += firmware/arch/stm32f4xx/driver/timer \ No newline at end of file diff --git a/source/firmware/arch/stm32f4xx/driver/usb_vport/usb_vport.mk b/source/firmware/arch/stm32f4xx/driver/usb_vport/usb_vport.mk index 838114b..ff59669 100755 --- a/source/firmware/arch/stm32f4xx/driver/usb_vport/usb_vport.mk +++ b/source/firmware/arch/stm32f4xx/driver/usb_vport/usb_vport.mk @@ -1,3 +1,4 @@ +CHECK_FOLDER += firmware/arch/stm32f4xx/driver/usb_vport SUB_FOLDER += firmware/arch/stm32f4xx/driver/usb_vport INCLUDES += firmware/arch/stm32f4xx/driver/usb_vport DOC_SRC += firmware/arch/stm32f4xx/driver/usb_vport \ No newline at end of file diff --git a/source/firmware/arch/stm32f4xx/stm32f4xx.mk b/source/firmware/arch/stm32f4xx/stm32f4xx.mk index 74a059b..e2535d1 100755 --- a/source/firmware/arch/stm32f4xx/stm32f4xx.mk +++ b/source/firmware/arch/stm32f4xx/stm32f4xx.mk @@ -1,3 +1,4 @@ +CHECK_FOLDER += firmware/arch/stm32f4xx SUB_FOLDER += firmware/arch/stm32f4xx INCLUDES += firmware/arch/stm32f4xx DOC_SRC += firmware/arch/stm32f4xx diff --git a/source/firmware/arch/stm32f4xx/syscalls.c b/source/firmware/arch/stm32f4xx/syscalls.c index 6d17285..180bda2 100755 --- a/source/firmware/arch/stm32f4xx/syscalls.c +++ b/source/firmware/arch/stm32f4xx/syscalls.c @@ -19,9 +19,9 @@ #undef errno extern int errno; +/* cppcheck-suppress unusedFunction */ int _kill(int pid, int sig) { - pid = pid; sig = sig; /* avoid warnings */ errno = EINVAL; return -1; } diff --git a/source/firmware/kernel/driver/driver.mk b/source/firmware/kernel/driver/driver.mk index 16a5189..a96a3e3 100755 --- a/source/firmware/kernel/driver/driver.mk +++ b/source/firmware/kernel/driver/driver.mk @@ -1,3 +1,4 @@ +CHECK_FOLDER += firmware/kernel/driver SUB_FOLDER += firmware/kernel/driver INCLUDES += firmware/kernel/driver DOC_SRC += firmware/kernel/driver diff --git a/source/firmware/kernel/kernel.mk b/source/firmware/kernel/kernel.mk index 39d01a1..2f0ec1b 100755 --- a/source/firmware/kernel/kernel.mk +++ b/source/firmware/kernel/kernel.mk @@ -1,3 +1,4 @@ +CHECK_FOLDER += firmware/kernel SUB_FOLDER += firmware/kernel INCLUDES += firmware/kernel DOC_SRC += firmware/kernel