From 5995950eb617d50beb043576eccf6f112bce188e Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 5 Feb 2017 15:08:12 +0000 Subject: MISRA-related fixes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10085 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/hal_qspi.h | 73 ++++---- os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.h | 8 +- os/hal/src/hal_buffers.c | 2 +- os/hal/src/hal_serial_usb.c | 2 +- os/hal/templates/hal_i2s_lld.c | 4 +- os/hal/templates/hal_qspi_lld.c | 4 +- os/hal/templates/hal_qspi_lld.h | 8 +- os/hal/templates/hal_rtc_lld.c | 6 +- os/hal/templates/hal_wdg_lld.c | 4 +- test/hal/testbuild/Makefile | 2 +- test/hal/testbuild/pclint/gcc-include-path.lnt | 12 +- test/nil/testbuild/Makefile | 224 ++++++++++++++++++++++++ test/nil/testbuild/Makefile_posix | 224 ------------------------ test/nil/testbuild/Makefile_win32 | 224 ------------------------ 14 files changed, 289 insertions(+), 508 deletions(-) create mode 100755 test/nil/testbuild/Makefile delete mode 100755 test/nil/testbuild/Makefile_posix delete mode 100755 test/nil/testbuild/Makefile_win32 diff --git a/os/hal/include/hal_qspi.h b/os/hal/include/hal_qspi.h index 0b67923b3..c5f0f1c22 100644 --- a/os/hal/include/hal_qspi.h +++ b/os/hal/include/hal_qspi.h @@ -35,42 +35,43 @@ * @name Transfer options * @{ */ -#define QSPI_CFG_CMD_MASK (0xFFU << 0U) -#define QSPI_CFG_CMD(n) ((n) << 0U) -#define QSPI_CFG_CMD_MODE_MASK (3U << 8U) -#define QSPI_CFG_CMD_MODE_NONE (0U << 8U) -#define QSPI_CFG_CMD_MODE_ONE_LINE (1U << 8U) -#define QSPI_CFG_CMD_MODE_TWO_LINES (2U << 8U) -#define QSPI_CFG_CMD_MODE_FOUR_LINES (3U << 8U) -#define QSPI_CFG_ADDR_MODE_MASK (3U << 10U) -#define QSPI_CFG_ADDR_MODE_NONE (0U << 10U) -#define QSPI_CFG_ADDR_MODE_ONE_LINE (1U << 10U) -#define QSPI_CFG_ADDR_MODE_TWO_LINES (2U << 10U) -#define QSPI_CFG_ADDR_MODE_FOUR_LINES (3U << 10U) -#define QSPI_CFG_ADDR_SIZE_MASK (3U << 12U) -#define QSPI_CFG_ADDR_SIZE_8 (0U << 12U) -#define QSPI_CFG_ADDR_SIZE_16 (1U << 12U) -#define QSPI_CFG_ADDR_SIZE_24 (2U << 12U) -#define QSPI_CFG_ADDR_SIZE_32 (3U << 12U) -#define QSPI_CFG_ALT_MODE_MASK (3U << 14U) -#define QSPI_CFG_ALT_MODE_NONE (0U << 14U) -#define QSPI_CFG_ALT_MODE_ONE_LINE (1U << 14U) -#define QSPI_CFG_ALT_MODE_TWO_LINES (2U << 14U) -#define QSPI_CFG_ALT_MODE_FOUR_LINES (3U << 14U) -#define QSPI_CFG_ALT_SIZE_MASK (3U << 16U) -#define QSPI_CFG_ALT_SIZE_8 (0U << 16U) -#define QSPI_CFG_ALT_SIZE_16 (1U << 16U) -#define QSPI_CFG_ALT_SIZE_24 (2U << 16U) -#define QSPI_CFG_ALT_SIZE_32 (3U << 16U) -#define QSPI_CFG_DUMMY_CYCLES_MASK (0x1FU << 18U) -#define QSPI_CFG_DUMMY_CYCLES(n) ((n) << 18U) -#define QSPI_CFG_DATA_MODE_MASK (3U << 24U) -#define QSPI_CFG_DATA_MODE_NONE (0U << 24U) -#define QSPI_CFG_DATA_MODE_ONE_LINE (1U << 24U) -#define QSPI_CFG_DATA_MODE_TWO_LINES (2U << 24U) -#define QSPI_CFG_DATA_MODE_FOUR_LINES (3U << 24U) -#define QSPI_CFG_SIOO (1U << 28U) -#define QSPI_CFG_DDRM (1U << 31U) +#define QSPI_CFG_CMD_MASK (0xFFLU << 0LU) +#define QSPI_CFG_CMD(n) ((n) << 0LU) +#define QSPI_CFG_CMD_MODE_MASK (3LU << 8LU) +#define QSPI_CFG_CMD_MODE_NONE (0LU << 8LU) +#define QSPI_CFG_CMD_MODE_ONE_LINE (1LU << 8LU) +#define QSPI_CFG_CMD_MODE_TWO_LINES (2LU << 8LU) +#define QSPI_CFG_CMD_MODE_FOUR_LINES (3LU << 8LU) +#define QSPI_CFG_ADDR_MODE_MASK (3LU << 10LU) +#define QSPI_CFG_ADDR_MODE_NONE (0LU << 10LU) +#define QSPI_CFG_ADDR_MODE_ONE_LINE (1LU << 10LU) +#define QSPI_CFG_ADDR_MODE_TWO_LINES (2LU << 10LU) +#define QSPI_CFG_ADDR_MODE_FOUR_LINES (3LU << 10LU) +#define QSPI_CFG_ADDR_SIZE_MASK (3LU << 12LU) +#define QSPI_CFG_ADDR_SIZE_8 (0LU << 12LU) +#define QSPI_CFG_ADDR_SIZE_16 (1LU << 12LU) +#define QSPI_CFG_ADDR_SIZE_24 (2LU << 12LU) +#define QSPI_CFG_ADDR_SIZE_32 (3LU << 12LU) +#define QSPI_CFG_ALT_MODE_MASK (3LU << 14LU) +#define QSPI_CFG_ALT_MODE_NONE (0LU << 14LU) +#define QSPI_CFG_ALT_MODE_ONE_LINE (1LU << 14LU) +#define QSPI_CFG_ALT_MODE_TWO_LINES (2LU << 14LU) +#define QSPI_CFG_ALT_MODE_FOUR_LINES (3LU << 14LU) +#define QSPI_CFG_ALT_SIZE_MASK (3LU << 16LU) +#define QSPI_CFG_ALT_SIZE_8 (0LU << 16LU) + +#define QSPI_CFG_ALT_SIZE_16 (1LU << 16LU) +#define QSPI_CFG_ALT_SIZE_24 (2LU << 16LU) +#define QSPI_CFG_ALT_SIZE_32 (3LU << 16LU) +#define QSPI_CFG_DUMMY_CYCLES_MASK (0x1FLU << 18LU) +#define QSPI_CFG_DUMMY_CYCLES(n) ((n) << 18LU) +#define QSPI_CFG_DATA_MODE_MASK (3LU << 24LU) +#define QSPI_CFG_DATA_MODE_NONE (0LU << 24LU) +#define QSPI_CFG_DATA_MODE_ONE_LINE (1LU << 24LU) +#define QSPI_CFG_DATA_MODE_TWO_LINES (2LU << 24LU) +#define QSPI_CFG_DATA_MODE_FOUR_LINES (3LU << 24LU) +#define QSPI_CFG_SIOO (1LU << 28LU) +#define QSPI_CFG_DDRM (1LU << 31LU) /** @} */ /*===========================================================================*/ diff --git a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.h b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.h index 0aacca1ba..fe7b31a61 100644 --- a/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.h +++ b/os/hal/ports/STM32/LLD/QUADSPIv1/hal_qspi_lld.h @@ -25,7 +25,7 @@ #ifndef HAL_QSPI_LLD_H #define HAL_QSPI_LLD_H -#if HAL_USE_QSPI || defined(__DOXYGEN__) +#if (HAL_USE_QSPI == TRUE) || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -211,13 +211,13 @@ struct QSPIDriver { * @brief Current configuration data. */ const QSPIConfig *config; -#if QSPI_USE_WAIT || defined(__DOXYGEN__) +#if (QSPI_USE_WAIT == TRUE) || defined(__DOXYGEN__) /** * @brief Waiting thread. */ thread_reference_t thread; #endif /* QSPI_USE_WAIT */ -#if QSPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) +#if (QSPI_USE_MUTUAL_EXCLUSION == TRUE) || defined(__DOXYGEN__) /** * @brief Mutex protecting the peripheral. */ @@ -249,7 +249,7 @@ struct QSPIDriver { /* External declarations. */ /*===========================================================================*/ -#if STM32_QSPI_USE_QUADSPI1 && !defined(__DOXYGEN__) +#if (STM32_QSPI_USE_QUADSPI1 == TRUE) && !defined(__DOXYGEN__) extern QSPIDriver QSPID1; #endif diff --git a/os/hal/src/hal_buffers.c b/os/hal/src/hal_buffers.c index b56f79b60..871fd0a42 100644 --- a/os/hal/src/hal_buffers.c +++ b/os/hal/src/hal_buffers.c @@ -873,7 +873,7 @@ void obqFlush(output_buffers_queue_t *obqp) { /* If there is a buffer partially filled and not being written.*/ if (obqp->ptr != NULL) { - size_t size = (size_t)obqp->ptr - (size_t)obqp->bwrptr - sizeof (size_t); + size_t size = ((size_t)obqp->ptr - (size_t)obqp->bwrptr) - sizeof (size_t); if (size > 0U) { obqPostFullBufferS(obqp, size); diff --git a/os/hal/src/hal_serial_usb.c b/os/hal/src/hal_serial_usb.c index 4936a92ae..f3c606942 100644 --- a/os/hal/src/hal_serial_usb.c +++ b/os/hal/src/hal_serial_usb.c @@ -471,7 +471,7 @@ void sduDataReceived(USBDriver *usbp, usbep_t ep) { /* The endpoint cannot be busy, we are in the context of the callback, so a packet is in the buffer for sure. Trying to get a free buffer for the next transaction.*/ - sdu_start_receive(sdup); + (void) sdu_start_receive(sdup); osalSysUnlockFromISR(); } diff --git a/os/hal/templates/hal_i2s_lld.c b/os/hal/templates/hal_i2s_lld.c index 7424a663a..0321d6464 100644 --- a/os/hal/templates/hal_i2s_lld.c +++ b/os/hal/templates/hal_i2s_lld.c @@ -24,7 +24,7 @@ #include "hal.h" -#if HAL_USE_I2S || defined(__DOXYGEN__) +#if (HAL_USE_I2S == TRUE) || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver local definitions. */ @@ -35,7 +35,7 @@ /*===========================================================================*/ /** @brief I2S2 driver identifier.*/ -#if PLATFORM_I2S_USE_I2S1 || defined(__DOXYGEN__) +#if (PLATFORM_I2S_USE_I2S1 == TRUE) || defined(__DOXYGEN__) I2SDriver I2SD1; #endif diff --git a/os/hal/templates/hal_qspi_lld.c b/os/hal/templates/hal_qspi_lld.c index d380b6c20..6ba358168 100644 --- a/os/hal/templates/hal_qspi_lld.c +++ b/os/hal/templates/hal_qspi_lld.c @@ -24,7 +24,7 @@ #include "hal.h" -#if HAL_USE_QSPI || defined(__DOXYGEN__) +#if (HAL_USE_QSPI == TRUE) || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver local definitions. */ @@ -35,7 +35,7 @@ /*===========================================================================*/ /** @brief QSPID1 driver identifier.*/ -#if PLATFORM_QSPI_USE_QSPI1 || defined(__DOXYGEN__) +#if (PLATFORM_QSPI_USE_QSPI1 == TRUE) || defined(__DOXYGEN__) QSPIDriver QSPID1; #endif diff --git a/os/hal/templates/hal_qspi_lld.h b/os/hal/templates/hal_qspi_lld.h index 18e07f9e6..b36b228c1 100644 --- a/os/hal/templates/hal_qspi_lld.h +++ b/os/hal/templates/hal_qspi_lld.h @@ -25,7 +25,7 @@ #ifndef HAL_QSPI_LLD_H #define HAL_QSPI_LLD_H -#if HAL_USE_QSPI || defined(__DOXYGEN__) +#if (HAL_USE_QSPI == TRUE) || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ @@ -100,13 +100,13 @@ struct QSPIDriver { * @brief Current configuration data. */ const QSPIConfig *config; -#if QSPI_USE_WAIT || defined(__DOXYGEN__) +#if (QSPI_USE_WAIT == TRUE) || defined(__DOXYGEN__) /** * @brief Waiting thread. */ thread_reference_t thread; #endif /* QSPI_USE_WAIT */ -#if QSPI_USE_MUTUAL_EXCLUSION || defined(__DOXYGEN__) +#if (QSPI_USE_MUTUAL_EXCLUSION == TRUE) || defined(__DOXYGEN__) /** * @brief Mutex protecting the peripheral. */ @@ -126,7 +126,7 @@ struct QSPIDriver { /* External declarations. */ /*===========================================================================*/ -#if PLATFORM_QSPI_USE_QSPI1 && !defined(__DOXYGEN__) +#if (PLATFORM_QSPI_USE_QSPI1 == TRUE) && !defined(__DOXYGEN__) extern QSPIDriver QSPID1; #endif diff --git a/os/hal/templates/hal_rtc_lld.c b/os/hal/templates/hal_rtc_lld.c index d32ac5df4..007172df6 100644 --- a/os/hal/templates/hal_rtc_lld.c +++ b/os/hal/templates/hal_rtc_lld.c @@ -28,7 +28,7 @@ #include "hal.h" -#if HAL_USE_RTC || defined(__DOXYGEN__) +#if (HAL_USE_RTC == TRUE) || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver local definitions. */ @@ -41,7 +41,9 @@ /** * @brief RTC driver identifier. */ +#if (PLATFORM_RTC_USE_RTC1 == TRUE) && !defined(__DOXYGEN__) RTCDriver RTCD1; +#endif /*===========================================================================*/ /* Driver local variables and types. */ @@ -67,7 +69,9 @@ RTCDriver RTCD1; void rtc_lld_init(void) { /* RTC object initialization.*/ +#if PLATFORM_RTC_USE_RTC1 == TRUE rtcObjectInit(&RTCD1); +#endif } /** diff --git a/os/hal/templates/hal_wdg_lld.c b/os/hal/templates/hal_wdg_lld.c index b446a30d5..b24213381 100644 --- a/os/hal/templates/hal_wdg_lld.c +++ b/os/hal/templates/hal_wdg_lld.c @@ -24,7 +24,7 @@ #include "hal.h" -#if HAL_USE_WDG || defined(__DOXYGEN__) +#if (HAL_USE_WDG == TRUE) || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver local definitions. */ @@ -34,7 +34,7 @@ /* Driver exported variables. */ /*===========================================================================*/ -#if PLATFORM_WDG_USE_WDG1 || defined(__DOXYGEN__) +#if (PLATFORM_WDG_USE_WDG1 == TRUE) || defined(__DOXYGEN__) WDGDriver WDGD1; #endif diff --git a/test/hal/testbuild/Makefile b/test/hal/testbuild/Makefile index 0e6aca07a..4703aea8a 100644 --- a/test/hal/testbuild/Makefile +++ b/test/hal/testbuild/Makefile @@ -218,4 +218,4 @@ RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC include $(RULESPATH)/rules.mk misra: - lint-nt -w3 $(DEFS) pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(HALSRC) $(OSALSRC) $(PLATFORMSRC) > misra.txt + @wine lint-nt -w3 $(DEFS) pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(HALSRC) $(OSALSRC) $(PLATFORMSRC) > misra.txt diff --git a/test/hal/testbuild/pclint/gcc-include-path.lnt b/test/hal/testbuild/pclint/gcc-include-path.lnt index 4d7cd42fd..0e8fd311a 100644 --- a/test/hal/testbuild/pclint/gcc-include-path.lnt +++ b/test/hal/testbuild/pclint/gcc-include-path.lnt @@ -1,6 +1,6 @@ ---i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q1/arm-none-eabi/include" ---i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q1/arm-none-eabi/include/c++/4.9.3" ---i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q1/arm-none-eabi/include/c++/4.9.3/arm-none-eabi" ---i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q1/arm-none-eabi/include/c++/4.9.3/backward" ---i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q1/lib/gcc/arm-none-eabi/4.9.3/include" ---i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q1/lib/gcc/arm-none-eabi/4.9.3/include-fixed" +--i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q3/arm-none-eabi/include" +--i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q3/arm-none-eabi/include/c++/4.9.3" +--i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q3/arm-none-eabi/include/c++/4.9.3/arm-none-eabi" +--i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q3/arm-none-eabi/include/c++/4.9.3/backward" +--i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q3/lib/gcc/arm-none-eabi/4.9.3/include" +--i"C:/ChibiStudio/tools/GNU Tools ARM Embedded/4.9 2015q3/lib/gcc/arm-none-eabi/4.9.3/include-fixed" diff --git a/test/nil/testbuild/Makefile b/test/nil/testbuild/Makefile new file mode 100755 index 000000000..b5910c4f7 --- /dev/null +++ b/test/nil/testbuild/Makefile @@ -0,0 +1,224 @@ +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C specific options here (added to USE_OPT). +ifeq ($(USE_COPT),) + USE_COPT = +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# Linker extra options here. +ifeq ($(USE_LDOPT),) + USE_LDOPT = +endif + +# Enable this if you want link time optimizations (LTO) +ifeq ($(USE_LTO),) + USE_LTO = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable this if you want to see the full log while compiling. +ifeq ($(USE_VERBOSE_COMPILE),) + USE_VERBOSE_COMPILE = no +endif + +# If enabled, this option makes the build process faster by not compiling +# modules not used in the current configuration. +ifeq ($(USE_SMART_BUILD),) + USE_SMART_BUILD = yes +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Stack size to be allocated to the Cortex-M process stack. This stack is +# the stack used by the main() thread. +ifeq ($(USE_PROCESS_STACKSIZE),) + USE_PROCESS_STACKSIZE = 0x100 +endif + +# Stack size to the allocated to the Cortex-M main/exceptions stack. This +# stack is used for processing interrupts and exceptions. +ifeq ($(USE_EXCEPTIONS_STACKSIZE),) + USE_EXCEPTIONS_STACKSIZE = 0x400 +endif + +# Enables the use of FPU (no, softfp, hard). +ifeq ($(USE_FPU),) + USE_FPU = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Imported source files and paths +CHIBIOS = ../../.. +# Startup files. +include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk +# HAL-OSAL files (optional). +#include $(CHIBIOS)/os/hal/hal.mk +#include $(CHIBIOS)/os/hal/ports/STM32/STM32F3xx/platform.mk +#include $(CHIBIOS)/os/hal/boards/ST_STM32F3_DISCOVERY/board.mk +#include $(CHIBIOS)/os/hal/osal/nil/osal.mk +# RTOS files (optional). +include $(CHIBIOS)/os/nil/nil.mk +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk +# Other files (optional). +#include $(CHIBIOS)/test/nil/test.mk + +# Define linker script file here +LDSCRIPT= $(STARTUPLD)/STM32F303xC.ld + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(STARTUPSRC) \ + $(KERNSRC) \ + $(PORTSRC) \ + $(OSALSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(TESTSRC) \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = +ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) + +INCDIR = $(CHIBIOS)/os/license \ + $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ + $(CHIBIOS)/os/various + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m4 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +AR = $(TRGT)ar +OD = $(TRGT)objdump +SZ = $(TRGT)size +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra -Wundef + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = -DSTM32F303xC + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = + +# +# End of user defines +############################################################################## + +RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC +include $(RULESPATH)/rules.mk + +############################################################################## +# MISRA check rule, requires PCLint and the setup files, not provided. +# +misra: + @wine lint-nt -w3 $(DEFS) pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(CSRC) > misra.txt diff --git a/test/nil/testbuild/Makefile_posix b/test/nil/testbuild/Makefile_posix deleted file mode 100755 index b5910c4f7..000000000 --- a/test/nil/testbuild/Makefile_posix +++ /dev/null @@ -1,224 +0,0 @@ -############################################################################## -# Build global options -# NOTE: Can be overridden externally. -# - -# Compiler options here. -ifeq ($(USE_OPT),) - USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -endif - -# C specific options here (added to USE_OPT). -ifeq ($(USE_COPT),) - USE_COPT = -endif - -# C++ specific options here (added to USE_OPT). -ifeq ($(USE_CPPOPT),) - USE_CPPOPT = -fno-rtti -endif - -# Enable this if you want the linker to remove unused code and data -ifeq ($(USE_LINK_GC),) - USE_LINK_GC = yes -endif - -# Linker extra options here. -ifeq ($(USE_LDOPT),) - USE_LDOPT = -endif - -# Enable this if you want link time optimizations (LTO) -ifeq ($(USE_LTO),) - USE_LTO = yes -endif - -# If enabled, this option allows to compile the application in THUMB mode. -ifeq ($(USE_THUMB),) - USE_THUMB = yes -endif - -# Enable this if you want to see the full log while compiling. -ifeq ($(USE_VERBOSE_COMPILE),) - USE_VERBOSE_COMPILE = no -endif - -# If enabled, this option makes the build process faster by not compiling -# modules not used in the current configuration. -ifeq ($(USE_SMART_BUILD),) - USE_SMART_BUILD = yes -endif - -# -# Build global options -############################################################################## - -############################################################################## -# Architecture or project specific options -# - -# Stack size to be allocated to the Cortex-M process stack. This stack is -# the stack used by the main() thread. -ifeq ($(USE_PROCESS_STACKSIZE),) - USE_PROCESS_STACKSIZE = 0x100 -endif - -# Stack size to the allocated to the Cortex-M main/exceptions stack. This -# stack is used for processing interrupts and exceptions. -ifeq ($(USE_EXCEPTIONS_STACKSIZE),) - USE_EXCEPTIONS_STACKSIZE = 0x400 -endif - -# Enables the use of FPU (no, softfp, hard). -ifeq ($(USE_FPU),) - USE_FPU = no -endif - -# -# Architecture or project specific options -############################################################################## - -############################################################################## -# Project, sources and paths -# - -# Define project name here -PROJECT = ch - -# Imported source files and paths -CHIBIOS = ../../.. -# Startup files. -include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk -# HAL-OSAL files (optional). -#include $(CHIBIOS)/os/hal/hal.mk -#include $(CHIBIOS)/os/hal/ports/STM32/STM32F3xx/platform.mk -#include $(CHIBIOS)/os/hal/boards/ST_STM32F3_DISCOVERY/board.mk -#include $(CHIBIOS)/os/hal/osal/nil/osal.mk -# RTOS files (optional). -include $(CHIBIOS)/os/nil/nil.mk -include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk -# Other files (optional). -#include $(CHIBIOS)/test/nil/test.mk - -# Define linker script file here -LDSCRIPT= $(STARTUPLD)/STM32F303xC.ld - -# C sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CSRC = $(STARTUPSRC) \ - $(KERNSRC) \ - $(PORTSRC) \ - $(OSALSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ - $(TESTSRC) \ - main.c - -# C++ sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CPPSRC = - -# C sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACSRC = - -# C++ sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACPPSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCPPSRC = - -# List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) - -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various - -# -# Project, sources and paths -############################################################################## - -############################################################################## -# Compiler settings -# - -MCU = cortex-m4 - -#TRGT = arm-elf- -TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ -# Enable loading with g++ only if you need C++ runtime support. -# NOTE: You can use C++ even without C++ support if you are careful. C++ -# runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ -CP = $(TRGT)objcopy -AS = $(TRGT)gcc -x assembler-with-cpp -AR = $(TRGT)ar -OD = $(TRGT)objdump -SZ = $(TRGT)size -HEX = $(CP) -O ihex -BIN = $(CP) -O binary - -# ARM-specific options here -AOPT = - -# THUMB-specific options here -TOPT = -mthumb -DTHUMB - -# Define C warning options here -CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes - -# Define C++ warning options here -CPPWARN = -Wall -Wextra -Wundef - -# -# Compiler settings -############################################################################## - -############################################################################## -# Start of user section -# - -# List all user C define here, like -D_DEBUG=1 -UDEFS = -DSTM32F303xC - -# Define ASM defines here -UADEFS = - -# List all user directories here -UINCDIR = - -# List the user directory to look for the libraries here -ULIBDIR = - -# List all user libraries here -ULIBS = - -# -# End of user defines -############################################################################## - -RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC -include $(RULESPATH)/rules.mk - -############################################################################## -# MISRA check rule, requires PCLint and the setup files, not provided. -# -misra: - @wine lint-nt -w3 $(DEFS) pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(CSRC) > misra.txt diff --git a/test/nil/testbuild/Makefile_win32 b/test/nil/testbuild/Makefile_win32 deleted file mode 100755 index 48cbe975e..000000000 --- a/test/nil/testbuild/Makefile_win32 +++ /dev/null @@ -1,224 +0,0 @@ -############################################################################## -# Build global options -# NOTE: Can be overridden externally. -# - -# Compiler options here. -ifeq ($(USE_OPT),) - USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -endif - -# C specific options here (added to USE_OPT). -ifeq ($(USE_COPT),) - USE_COPT = -endif - -# C++ specific options here (added to USE_OPT). -ifeq ($(USE_CPPOPT),) - USE_CPPOPT = -fno-rtti -endif - -# Enable this if you want the linker to remove unused code and data -ifeq ($(USE_LINK_GC),) - USE_LINK_GC = yes -endif - -# Linker extra options here. -ifeq ($(USE_LDOPT),) - USE_LDOPT = -endif - -# Enable this if you want link time optimizations (LTO) -ifeq ($(USE_LTO),) - USE_LTO = yes -endif - -# If enabled, this option allows to compile the application in THUMB mode. -ifeq ($(USE_THUMB),) - USE_THUMB = yes -endif - -# Enable this if you want to see the full log while compiling. -ifeq ($(USE_VERBOSE_COMPILE),) - USE_VERBOSE_COMPILE = no -endif - -# If enabled, this option makes the build process faster by not compiling -# modules not used in the current configuration. -ifeq ($(USE_SMART_BUILD),) - USE_SMART_BUILD = yes -endif - -# -# Build global options -############################################################################## - -############################################################################## -# Architecture or project specific options -# - -# Stack size to be allocated to the Cortex-M process stack. This stack is -# the stack used by the main() thread. -ifeq ($(USE_PROCESS_STACKSIZE),) - USE_PROCESS_STACKSIZE = 0x100 -endif - -# Stack size to the allocated to the Cortex-M main/exceptions stack. This -# stack is used for processing interrupts and exceptions. -ifeq ($(USE_EXCEPTIONS_STACKSIZE),) - USE_EXCEPTIONS_STACKSIZE = 0x400 -endif - -# Enables the use of FPU (no, softfp, hard). -ifeq ($(USE_FPU),) - USE_FPU = no -endif - -# -# Architecture or project specific options -############################################################################## - -############################################################################## -# Project, sources and paths -# - -# Define project name here -PROJECT = ch - -# Imported source files and paths -CHIBIOS = ../../.. -# Startup files. -include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk -# HAL-OSAL files (optional). -#include $(CHIBIOS)/os/hal/hal.mk -#include $(CHIBIOS)/os/hal/ports/STM32/STM32F3xx/platform.mk -#include $(CHIBIOS)/os/hal/boards/ST_STM32F3_DISCOVERY/board.mk -#include $(CHIBIOS)/os/hal/osal/nil/osal.mk -# RTOS files (optional). -include $(CHIBIOS)/os/nil/nil.mk -include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk -# Other files (optional). -#include $(CHIBIOS)/test/nil/test.mk - -# Define linker script file here -LDSCRIPT= $(STARTUPLD)/STM32F303xC.ld - -# C sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CSRC = $(STARTUPSRC) \ - $(KERNSRC) \ - $(PORTSRC) \ - $(OSALSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ - $(TESTSRC) \ - main.c - -# C++ sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CPPSRC = - -# C sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACSRC = - -# C++ sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACPPSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCPPSRC = - -# List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) - -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various - -# -# Project, sources and paths -############################################################################## - -############################################################################## -# Compiler settings -# - -MCU = cortex-m4 - -#TRGT = arm-elf- -TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ -# Enable loading with g++ only if you need C++ runtime support. -# NOTE: You can use C++ even without C++ support if you are careful. C++ -# runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ -CP = $(TRGT)objcopy -AS = $(TRGT)gcc -x assembler-with-cpp -AR = $(TRGT)ar -OD = $(TRGT)objdump -SZ = $(TRGT)size -HEX = $(CP) -O ihex -BIN = $(CP) -O binary - -# ARM-specific options here -AOPT = - -# THUMB-specific options here -TOPT = -mthumb -DTHUMB - -# Define C warning options here -CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes - -# Define C++ warning options here -CPPWARN = -Wall -Wextra -Wundef - -# -# Compiler settings -############################################################################## - -############################################################################## -# Start of user section -# - -# List all user C define here, like -D_DEBUG=1 -UDEFS = -DSTM32F303xC - -# Define ASM defines here -UADEFS = - -# List all user directories here -UINCDIR = - -# List the user directory to look for the libraries here -ULIBDIR = - -# List all user libraries here -ULIBS = - -# -# End of user defines -############################################################################## - -RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC -include $(RULESPATH)/rules.mk - -############################################################################## -# MISRA check rule, requires PCLint and the setup files, not provided. -# -misra: - @lint-nt -w3 $(DEFS) pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(CSRC) > misra.txt -- cgit v1.2.3