From 4aa00494c2716285e85246295fb2ed86aa99a4e4 Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Sat, 10 Mar 2018 14:58:45 +0100 Subject: Added shared variables to startup, board and platform makefiles --- os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk | 5 +++++ os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk | 5 +++++ os/hal/boards/TI_TM4C123G_LAUNCHPAD/board.mk | 4 ++++ os/hal/boards/TI_TM4C1294_LAUNCHPAD/board.mk | 4 ++++ os/hal/ports/TIVA/TM4C123x/platform.mk | 4 ++++ os/hal/ports/TIVA/TM4C129x/platform.mk | 4 ++++ 6 files changed, 26 insertions(+) diff --git a/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk b/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk index e87e60d..c1db8e2 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk +++ b/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk @@ -11,3 +11,8 @@ STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ $(CHIBIOS_CONTRIB)/os/common/ext/TivaWare STARTUPLD = $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/ld + +# Shared variables +ALLASM += $(STARTUPASM) +ALLCSRC += $(STARTUPSRC) +ALLINC += $(STARTUPINC) diff --git a/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk b/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk index c8c5f82..cbe2dab 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk +++ b/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk @@ -11,3 +11,8 @@ STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ $(CHIBIOS_CONTRIB)/os/common/ext/TivaWare STARTUPLD = $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/ld + +# Shared variables +ALLASM += $(STARTUPASM) +ALLCSRC += $(STARTUPSRC) +ALLINC += $(STARTUPINC) diff --git a/os/hal/boards/TI_TM4C123G_LAUNCHPAD/board.mk b/os/hal/boards/TI_TM4C123G_LAUNCHPAD/board.mk index 8232a30..22b5467 100644 --- a/os/hal/boards/TI_TM4C123G_LAUNCHPAD/board.mk +++ b/os/hal/boards/TI_TM4C123G_LAUNCHPAD/board.mk @@ -3,3 +3,7 @@ BOARDSRC = ${CHIBIOS_CONTRIB}/os/hal/boards/TI_TM4C123G_LAUNCHPAD/board.c # Required include directories BOARDINC = ${CHIBIOS_CONTRIB}/os/hal/boards/TI_TM4C123G_LAUNCHPAD + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/os/hal/boards/TI_TM4C1294_LAUNCHPAD/board.mk b/os/hal/boards/TI_TM4C1294_LAUNCHPAD/board.mk index 56298eb..e95de0b 100644 --- a/os/hal/boards/TI_TM4C1294_LAUNCHPAD/board.mk +++ b/os/hal/boards/TI_TM4C1294_LAUNCHPAD/board.mk @@ -3,3 +3,7 @@ BOARDSRC = ${CHIBIOS_CONTRIB}/os/hal/boards/TI_TM4C1294_LAUNCHPAD/board.c # Required include directories BOARDINC = ${CHIBIOS_CONTRIB}/os/hal/boards/TI_TM4C1294_LAUNCHPAD + +# Shared variables +ALLCSRC += $(BOARDSRC) +ALLINC += $(BOARDINC) diff --git a/os/hal/ports/TIVA/TM4C123x/platform.mk b/os/hal/ports/TIVA/TM4C123x/platform.mk index 8372c25..8e447ec 100644 --- a/os/hal/ports/TIVA/TM4C123x/platform.mk +++ b/os/hal/ports/TIVA/TM4C123x/platform.mk @@ -27,3 +27,7 @@ include $(CHIBIOS_CONTRIB)/os/hal/ports/TIVA/LLD/SSI/driver.mk include $(CHIBIOS_CONTRIB)/os/hal/ports/TIVA/LLD/UART/driver.mk include $(CHIBIOS_CONTRIB)/os/hal/ports/TIVA/LLD/uDMA/driver.mk include $(CHIBIOS_CONTRIB)/os/hal/ports/TIVA/LLD/WDT/driver.mk + +# Shared variables +ALLCSRC += $(PLATFORMSRC) +ALLINC += $(PLATFORMINC) diff --git a/os/hal/ports/TIVA/TM4C129x/platform.mk b/os/hal/ports/TIVA/TM4C129x/platform.mk index 934a6c2..9702796 100644 --- a/os/hal/ports/TIVA/TM4C129x/platform.mk +++ b/os/hal/ports/TIVA/TM4C129x/platform.mk @@ -28,3 +28,7 @@ include $(CHIBIOS_CONTRIB)/os/hal/ports/TIVA/LLD/SSI/driver.mk include $(CHIBIOS_CONTRIB)/os/hal/ports/TIVA/LLD/UART/driver.mk include $(CHIBIOS_CONTRIB)/os/hal/ports/TIVA/LLD/uDMA/driver.mk include $(CHIBIOS_CONTRIB)/os/hal/ports/TIVA/LLD/WDT/driver.mk + +# Shared variables +ALLCSRC += $(PLATFORMSRC) +ALLINC += $(PLATFORMINC) -- cgit v1.2.3 From 5e65e52f28287314eaad902d0eff6afe203c690b Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Sat, 10 Mar 2018 15:32:24 +0100 Subject: Fixed wrong variable name for ASM files --- os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk | 6 +++--- os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk b/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk index c1db8e2..835faca 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk +++ b/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk @@ -13,6 +13,6 @@ STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ STARTUPLD = $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/ld # Shared variables -ALLASM += $(STARTUPASM) -ALLCSRC += $(STARTUPSRC) -ALLINC += $(STARTUPINC) +ALLXASMSRC += $(STARTUPASM) +ALLCSRC += $(STARTUPSRC) +ALLINC += $(STARTUPINC) diff --git a/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk b/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk index cbe2dab..ac4f76e 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk +++ b/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk @@ -13,6 +13,6 @@ STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ STARTUPLD = $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/ld # Shared variables -ALLASM += $(STARTUPASM) -ALLCSRC += $(STARTUPSRC) -ALLINC += $(STARTUPINC) +ALLXASMSRC += $(STARTUPASM) +ALLCSRC += $(STARTUPSRC) +ALLINC += $(STARTUPINC) -- cgit v1.2.3 From 0b539b26b0221e70ac4db0541f92239a8cf3909d Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Sat, 10 Mar 2018 15:34:41 +0100 Subject: Simplified a makefile by using the new variables Also disabled FPU, added license makefile and added -Wundef to C and C++ warnings. --- demos/TIVA/RT-TM4C123G-LAUNCHPAD/Makefile | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/demos/TIVA/RT-TM4C123G-LAUNCHPAD/Makefile b/demos/TIVA/RT-TM4C123G-LAUNCHPAD/Makefile index 7c0ab70..104f62e 100644 --- a/demos/TIVA/RT-TM4C123G-LAUNCHPAD/Makefile +++ b/demos/TIVA/RT-TM4C123G-LAUNCHPAD/Makefile @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -88,6 +88,9 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk # HAL-OSAL files (optional). @@ -108,19 +111,13 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -143,13 +140,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -185,10 +179,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings -- cgit v1.2.3 From 32cdf41174686c78d7978d0a4232b1ac8bc0f2f6 Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Mon, 12 Mar 2018 19:04:54 +0100 Subject: Fixed warnings triggered by -Wundef compile option --- os/hal/ports/TIVA/LLD/GPIO/hal_pal_lld.h | 32 ++++++++++++++++---------------- os/hal/ports/TIVA/LLD/GPTM/hal_st_lld.c | 2 +- os/hal/ports/TIVA/TM4C123x/hal_lld.h | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/os/hal/ports/TIVA/LLD/GPIO/hal_pal_lld.h b/os/hal/ports/TIVA/LLD/GPIO/hal_pal_lld.h index 993d5c3..e884a92 100644 --- a/os/hal/ports/TIVA/LLD/GPIO/hal_pal_lld.h +++ b/os/hal/ports/TIVA/LLD/GPIO/hal_pal_lld.h @@ -665,82 +665,82 @@ typedef uint32_t iopadid_t; #error "Invalid IRQ priority assigned to GPION" #endif -#if TIVA_HAS_GPIOP0 && \ +#if TIVA_HAS_GPIOP && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOP0_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOP0" #endif -#if TIVA_HAS_GPIOP1 && \ +#if TIVA_HAS_GPIOP && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOP1_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOP1" #endif -#if TIVA_HAS_GPIOP2 && \ +#if TIVA_HAS_GPIOP && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOP2_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOP2" #endif -#if TIVA_HAS_GPIOP3 && \ +#if TIVA_HAS_GPIOP && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOP3_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOP3" #endif -#if TIVA_HAS_GPIOP4 && \ +#if TIVA_HAS_GPIOP && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOP4_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOP4" #endif -#if TIVA_HAS_GPIOP5 && \ +#if TIVA_HAS_GPIOP && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOP5_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOP5" #endif -#if TIVA_HAS_GPIOP6 && \ +#if TIVA_HAS_GPIOP && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOP6_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOP6" #endif -#if TIVA_HAS_GPIOP7 && \ +#if TIVA_HAS_GPIOP && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOP7_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOP7" #endif -#if TIVA_HAS_GPIOQ0 && \ +#if TIVA_HAS_GPIOQ && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOQ0_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOQ0" #endif -#if TIVA_HAS_GPIOQ1 && \ +#if TIVA_HAS_GPIOQ && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOQ1_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOQ1" #endif -#if TIVA_HAS_GPIOQ2 && \ +#if TIVA_HAS_GPIOQ && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOQ2_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOQ2" #endif -#if TIVA_HAS_GPIOQ3 && \ +#if TIVA_HAS_GPIOQ && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOQ3_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOQ3" #endif -#if TIVA_HAS_GPIOQ4 && \ +#if TIVA_HAS_GPIOQ && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOQ4_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOQ4" #endif -#if TIVA_HAS_GPIOQ5 && \ +#if TIVA_HAS_GPIOQ && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOQ5_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOQ5" #endif -#if TIVA_HAS_GPIOQ6 && \ +#if TIVA_HAS_GPIOQ && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOQ6_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOQ6" #endif -#if TIVA_HAS_GPIOQ7 && \ +#if TIVA_HAS_GPIOQ && \ !OSAL_IRQ_IS_VALID_PRIORITY(TIVA_PAL_GPIOQ7_IRQ_PRIORITY) #error "Invalid IRQ priority assigned to GPIOQ7" #endif diff --git a/os/hal/ports/TIVA/LLD/GPTM/hal_st_lld.c b/os/hal/ports/TIVA/LLD/GPTM/hal_st_lld.c index 7da95b8..0f9576a 100644 --- a/os/hal/ports/TIVA/LLD/GPTM/hal_st_lld.c +++ b/os/hal/ports/TIVA/LLD/GPTM/hal_st_lld.c @@ -74,7 +74,7 @@ #error "TIVA_ST_USE_TIMER specifies an unsupported timer" #endif -#if (ST_CLOCK_SRC / OSAL_ST_FREQUENCY) - 1 > 0xFFFF +#if (TIVA_SYSCLK / OSAL_ST_FREQUENCY) - 1 > 0xFFFF #error "the selected ST frequency is not obtainable because TIM timer prescaler limits" #endif diff --git a/os/hal/ports/TIVA/TM4C123x/hal_lld.h b/os/hal/ports/TIVA/TM4C123x/hal_lld.h index 5937b88..5d38a67 100644 --- a/os/hal/ports/TIVA/TM4C123x/hal_lld.h +++ b/os/hal/ports/TIVA/TM4C123x/hal_lld.h @@ -203,7 +203,7 @@ #error "Invalid value for TIVA_BYPASS_VALUE defined" #endif -#if (TIVA_OSCSRC == TIVA_RCC_OSCSRC_MOSC) && (TIVA_MOSC_ENABLE == FALSE) +#if (TIVA_OSCSRC == SYSCTL_RCC2_OSCSRC2_MO) && (TIVA_MOSC_ENABLE == FALSE) #error "Main Oscillator selected but not enabled" #endif -- cgit v1.2.3 From e38bf6044796eb56d79d887ccc7c1c1bedc6d4b7 Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Mon, 12 Mar 2018 19:18:39 +0100 Subject: Aligned Tiva Makefiles --- demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile | 28 ++++++++---------- demos/TIVA/RT-TM4C1294-LAUNCHPAD/Makefile | 29 ++++++++----------- testhal/TIVA/TM4C123x/ADC/Makefile | 33 +++++++++------------- testhal/TIVA/TM4C123x/GPT/Makefile | 28 ++++++++---------- testhal/TIVA/TM4C123x/I2C/Makefile | 31 ++++++++------------ testhal/TIVA/TM4C123x/PWM/Makefile | 28 ++++++++---------- testhal/TIVA/TM4C123x/SPI/Makefile | 28 ++++++++---------- testhal/TIVA/TM4C123x/UART/Makefile | 30 ++++++++------------ testhal/TIVA/TM4C123x/WDG/Makefile | 28 ++++++++---------- testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad | 31 ++++++++------------ testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad | 31 ++++++++------------ 11 files changed, 128 insertions(+), 197 deletions(-) diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile index add92f1..6598fd8 100644 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile +++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -88,6 +88,9 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk # HAL-OSAL files (optional). @@ -106,13 +109,7 @@ LDSCRIPT= $(STARTUPLD)/TM4C129xNC.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ $(LWSRC) \ $(CHIBIOS)/os/various/evtimer.c \ @@ -121,7 +118,7 @@ CSRC = $(STARTUPSRC) \ # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -144,13 +141,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various $(LWINC) +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -186,10 +180,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/Makefile b/demos/TIVA/RT-TM4C1294-LAUNCHPAD/Makefile index da83f36..11f28f6 100644 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD/Makefile +++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD/Makefile @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -88,6 +88,9 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk # HAL-OSAL files (optional). @@ -108,19 +111,13 @@ LDSCRIPT= $(STARTUPLD)/TM4C129xNC.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -143,13 +140,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -161,6 +155,7 @@ INCDIR = $(CHIBIOS)/os/license \ MCU = cortex-m4 +#TRGT = arm-elf- TRGT = arm-none-eabi- CC = $(TRGT)gcc CPPC = $(TRGT)g++ @@ -184,10 +179,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings diff --git a/testhal/TIVA/TM4C123x/ADC/Makefile b/testhal/TIVA/TM4C123x/ADC/Makefile index 15ea309..d90ef9a 100644 --- a/testhal/TIVA/TM4C123x/ADC/Makefile +++ b/testhal/TIVA/TM4C123x/ADC/Makefile @@ -5,7 +5,7 @@ # Compiler options here. ifeq ($(USE_OPT),) - USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16 + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 endif # C specific options here (added to USE_OPT). @@ -46,7 +46,7 @@ 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 = no + USE_SMART_BUILD = yes endif # @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -88,6 +88,9 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk # HAL-OSAL files (optional). @@ -106,20 +109,13 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ - $(STREAMSSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -142,13 +138,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(STREAMSINC) $(CHIBIOS)/os/various +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -184,10 +177,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings diff --git a/testhal/TIVA/TM4C123x/GPT/Makefile b/testhal/TIVA/TM4C123x/GPT/Makefile index f2833ec..557893f 100644 --- a/testhal/TIVA/TM4C123x/GPT/Makefile +++ b/testhal/TIVA/TM4C123x/GPT/Makefile @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -88,6 +88,9 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk # HAL-OSAL files (optional). @@ -105,19 +108,13 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -140,13 +137,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -182,10 +176,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings diff --git a/testhal/TIVA/TM4C123x/I2C/Makefile b/testhal/TIVA/TM4C123x/I2C/Makefile index d4d1334..d90ef9a 100644 --- a/testhal/TIVA/TM4C123x/I2C/Makefile +++ b/testhal/TIVA/TM4C123x/I2C/Makefile @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -88,6 +88,9 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk # HAL-OSAL files (optional). @@ -106,20 +109,13 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ - $(STREAMSSRC) \ - main.c + main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -142,13 +138,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(STREAMSINC) $(CHIBIOS)/os/various +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -184,10 +177,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings diff --git a/testhal/TIVA/TM4C123x/PWM/Makefile b/testhal/TIVA/TM4C123x/PWM/Makefile index f2833ec..557893f 100644 --- a/testhal/TIVA/TM4C123x/PWM/Makefile +++ b/testhal/TIVA/TM4C123x/PWM/Makefile @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -88,6 +88,9 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk # HAL-OSAL files (optional). @@ -105,19 +108,13 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -140,13 +137,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -182,10 +176,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings diff --git a/testhal/TIVA/TM4C123x/SPI/Makefile b/testhal/TIVA/TM4C123x/SPI/Makefile index f2833ec..557893f 100644 --- a/testhal/TIVA/TM4C123x/SPI/Makefile +++ b/testhal/TIVA/TM4C123x/SPI/Makefile @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -88,6 +88,9 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk # HAL-OSAL files (optional). @@ -105,19 +108,13 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -140,13 +137,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -182,10 +176,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings diff --git a/testhal/TIVA/TM4C123x/UART/Makefile b/testhal/TIVA/TM4C123x/UART/Makefile index b7360e4..557893f 100644 --- a/testhal/TIVA/TM4C123x/UART/Makefile +++ b/testhal/TIVA/TM4C123x/UART/Makefile @@ -5,7 +5,7 @@ # Compiler options here. ifeq ($(USE_OPT),) - USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16 + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 endif # C specific options here (added to USE_OPT). @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -88,6 +88,9 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk # HAL-OSAL files (optional). @@ -105,19 +108,13 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -140,13 +137,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -182,10 +176,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings diff --git a/testhal/TIVA/TM4C123x/WDG/Makefile b/testhal/TIVA/TM4C123x/WDG/Makefile index f2833ec..557893f 100644 --- a/testhal/TIVA/TM4C123x/WDG/Makefile +++ b/testhal/TIVA/TM4C123x/WDG/Makefile @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -88,6 +88,9 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk # HAL-OSAL files (optional). @@ -105,19 +108,13 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -140,13 +137,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -182,10 +176,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings diff --git a/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad b/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad index 0a70a25..48854ce 100644 --- a/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad +++ b/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad @@ -5,7 +5,7 @@ # Compiler options here. ifeq ($(USE_OPT),) - USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16 + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 endif # C specific options here (added to USE_OPT). @@ -30,7 +30,7 @@ endif # Enable this if you want link time optimizations (LTO) ifeq ($(USE_LTO),) - USE_LTO = no + USE_LTO = yes endif # If enabled, this option allows to compile the application in THUMB mode. @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -92,6 +92,8 @@ CONFDIR := ./cfg-tm4c123g_launchpad BUILDDIR := ./build-tm4c123g_launchpad DEPDIR := ./.dep-tm4c123g_launchpad +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c123x.mk # HAL-OSAL files (optional). @@ -112,20 +114,14 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ $(CONFDIR)/portab.c \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -148,13 +144,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various $(CONFDIR) +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -190,10 +183,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings diff --git a/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad b/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad index 39c6339..e5c3fc9 100644 --- a/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad +++ b/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad @@ -5,7 +5,7 @@ # Compiler options here. ifeq ($(USE_OPT),) - USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16 + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 endif # C specific options here (added to USE_OPT). @@ -30,7 +30,7 @@ endif # Enable this if you want link time optimizations (LTO) ifeq ($(USE_LTO),) - USE_LTO = no + USE_LTO = yes endif # If enabled, this option allows to compile the application in THUMB mode. @@ -71,7 +71,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -92,6 +92,8 @@ CONFDIR := ./cfg-tm4c1294_launchpad BUILDDIR := ./build-tm4c1294_launchpad DEPDIR := ./.dep-tm4c1294_launchpad +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_tm4c129x.mk # HAL-OSAL files (optional). @@ -112,20 +114,14 @@ LDSCRIPT= $(STARTUPLD)/TM4C129xNC.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) \ +CSRC = $(ALLCSRC) \ $(TESTSRC) \ $(CONFDIR)/portab.c \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CPPSRC = +CPPSRC = $(ALLCPPSRC) # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler @@ -148,13 +144,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) +ASMSRC = $(ALLASMSRC) +ASMXSRC = $(ALLXASMSRC) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/various $(CONFDIR) +INCDIR = $(ALLINC) $(TESTINC) # # Project, sources and paths @@ -190,10 +183,10 @@ AOPT = TOPT = -mthumb -DTHUMB # Define C warning options here -CWARN = -Wall -Wextra -Wstrict-prototypes +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes # Define C++ warning options here -CPPWARN = -Wall -Wextra +CPPWARN = -Wall -Wextra -Wundef # # Compiler settings -- cgit v1.2.3 From e75bb117dd187b9db3f024a60c383c91a016c29f Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Mon, 12 Mar 2018 19:25:44 +0100 Subject: Fixed CONFDIR missing in PAL makefiles --- testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad | 2 +- testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad b/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad index 48854ce..112666c 100644 --- a/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad +++ b/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad @@ -147,7 +147,7 @@ TCPPSRC = ASMSRC = $(ALLASMSRC) ASMXSRC = $(ALLXASMSRC) -INCDIR = $(ALLINC) $(TESTINC) +INCDIR = $(ALLINC) $(CONFDIR) # # Project, sources and paths diff --git a/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad b/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad index e5c3fc9..0fec94b 100644 --- a/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad +++ b/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad @@ -147,7 +147,7 @@ TCPPSRC = ASMSRC = $(ALLASMSRC) ASMXSRC = $(ALLXASMSRC) -INCDIR = $(ALLINC) $(TESTINC) +INCDIR = $(ALLINC) $(CONFDIR) # # Project, sources and paths -- cgit v1.2.3 From 73402af8bd37c370554ccbfb568b0d887d4f5b46 Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Tue, 13 Mar 2018 20:26:06 +0100 Subject: Fixed problem in LwIP demo makefile --- demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile index 6598fd8..6dd75df 100644 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile +++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile @@ -110,7 +110,6 @@ LDSCRIPT= $(STARTUPLD)/TM4C129xNC.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ - $(TESTSRC) \ $(LWSRC) \ $(CHIBIOS)/os/various/evtimer.c \ main.c \ @@ -144,7 +143,7 @@ TCPPSRC = ASMSRC = $(ALLASMSRC) ASMXSRC = $(ALLXASMSRC) -INCDIR = $(ALLINC) $(TESTINC) +INCDIR = $(ALLINC) $(LWINC) $(CHIBIOS)/os/various # # Project, sources and paths -- cgit v1.2.3 From d3565866ef823f9d80d7703ee66b9c896286e56a Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Tue, 13 Mar 2018 20:26:31 +0100 Subject: Try to enable building the LwIP demo on Travis-CI --- .travis.yml | 5 +++++ tools/travis/script.sh | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index db398b5..853438b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,3 +9,8 @@ before_install: script: - chmod +x tools/travis/script.sh - ./tools/travis/script.sh + +addons: + apt: + packages: + - p7zip-full diff --git a/tools/travis/script.sh b/tools/travis/script.sh index 103ccc1..b96427d 100644 --- a/tools/travis/script.sh +++ b/tools/travis/script.sh @@ -4,6 +4,10 @@ set -ex export PATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH +pushd ../ChibiOS-RT/ext +7z e lwip-2.0.3-patched.7z +popd + git checkout -- . git clean -xfd make -C demos/TIVA/RT-TM4C123G-LAUNCHPAD @@ -12,10 +16,9 @@ git checkout -- . git clean -xfd make -C demos/TIVA/RT-TM4C1294-LAUNCHPAD -# This demo needs LWIP, it is disabled for now. -# git checkout -- . -# git clean -xfd -# make -C demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP +git checkout -- . +git clean -xfd +make -C demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP git checkout -- . git clean -xfd -- cgit v1.2.3 From cb7a4d2a2c63a86a28a95a42497933a88e771f29 Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Wed, 14 Mar 2018 07:31:08 +0100 Subject: Fixed pushd popd --- tools/travis/script.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/travis/script.sh b/tools/travis/script.sh index b96427d..8b53ff7 100644 --- a/tools/travis/script.sh +++ b/tools/travis/script.sh @@ -4,9 +4,9 @@ set -ex export PATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH -pushd ../ChibiOS-RT/ext +cd ../ChibiOS-RT/ext 7z e lwip-2.0.3-patched.7z -popd +cd - git checkout -- . git clean -xfd -- cgit v1.2.3 From 43e00a4d57d3789e1e54d5204e17e8ea904dc41f Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Wed, 14 Mar 2018 07:42:17 +0100 Subject: Extract with full paths --- tools/travis/script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/travis/script.sh b/tools/travis/script.sh index 8b53ff7..e70b114 100644 --- a/tools/travis/script.sh +++ b/tools/travis/script.sh @@ -5,7 +5,7 @@ set -ex export PATH=/tmp/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH cd ../ChibiOS-RT/ext -7z e lwip-2.0.3-patched.7z +7z x lwip-2.0.3-patched.7z cd - git checkout -- . -- cgit v1.2.3 From 48ad58ccbf9fc7ecc55e994305b8dd73c7e0d2ac Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Wed, 14 Mar 2018 08:16:24 +0100 Subject: Removed LWSRC and LWINC from makefile and added httpd_opts.h file. --- demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile | 3 +- demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/httpd_opts.h | 323 +++++++++++++++++++++ 2 files changed, 324 insertions(+), 2 deletions(-) create mode 100644 demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/httpd_opts.h diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile index 6dd75df..0d30f91 100644 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile +++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile @@ -110,7 +110,6 @@ LDSCRIPT= $(STARTUPLD)/TM4C129xNC.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ - $(LWSRC) \ $(CHIBIOS)/os/various/evtimer.c \ main.c \ web/web.c \ @@ -143,7 +142,7 @@ TCPPSRC = ASMSRC = $(ALLASMSRC) ASMXSRC = $(ALLXASMSRC) -INCDIR = $(ALLINC) $(LWINC) $(CHIBIOS)/os/various +INCDIR = $(ALLINC) $(CHIBIOS)/os/various # # Project, sources and paths diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/httpd_opts.h b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/httpd_opts.h new file mode 100644 index 0000000..340db15 --- /dev/null +++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/httpd_opts.h @@ -0,0 +1,323 @@ +/** + * @file + * HTTP server options list + */ + +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + * This version of the file has been modified by Texas Instruments to offer + * simple server-side-include (SSI) and Common Gateway Interface (CGI) + * capability. + */ + +#ifndef LWIP_HDR_APPS_HTTPD_OPTS_H +#define LWIP_HDR_APPS_HTTPD_OPTS_H + +#include "lwip/opt.h" + +/** + * @defgroup httpd_opts Options + * @ingroup httpd + * @{ + */ + +/** Set this to 1 to support CGI (old style) */ +#if !defined LWIP_HTTPD_CGI || defined __DOXYGEN__ +#define LWIP_HTTPD_CGI 0 +#endif + +/** Set this to 1 to support CGI (new style) */ +#if !defined LWIP_HTTPD_CGI_SSI || defined __DOXYGEN__ +#define LWIP_HTTPD_CGI_SSI 0 +#endif + +/** Set this to 1 to support SSI (Server-Side-Includes) */ +#if !defined LWIP_HTTPD_SSI || defined __DOXYGEN__ +#define LWIP_HTTPD_SSI 0 +#endif + +/** Set this to 1 to implement an SSI tag handler callback that gets a const char* + * to the tag (instead of an index into a pre-registered array of known tags) */ +#if !defined LWIP_HTTPD_SSI_RAW || defined __DOXYGEN__ +#define LWIP_HTTPD_SSI_RAW 0 +#endif + +/** Set this to 1 to support HTTP POST */ +#if !defined LWIP_HTTPD_SUPPORT_POST || defined __DOXYGEN__ +#define LWIP_HTTPD_SUPPORT_POST 0 +#endif + +/* The maximum number of parameters that the CGI handler can be sent. */ +#if !defined LWIP_HTTPD_MAX_CGI_PARAMETERS || defined __DOXYGEN__ +#define LWIP_HTTPD_MAX_CGI_PARAMETERS 16 +#endif + +/** LWIP_HTTPD_SSI_MULTIPART==1: SSI handler function is called with 2 more + * arguments indicating a counter for insert string that are too long to be + * inserted at once: the SSI handler function must then set 'next_tag_part' + * which will be passed back to it in the next call. */ +#if !defined LWIP_HTTPD_SSI_MULTIPART || defined __DOXYGEN__ +#define LWIP_HTTPD_SSI_MULTIPART 0 +#endif + +/* The maximum length of the string comprising the tag name */ +#if !defined LWIP_HTTPD_MAX_TAG_NAME_LEN || defined __DOXYGEN__ +#define LWIP_HTTPD_MAX_TAG_NAME_LEN 8 +#endif + +/* The maximum length of string that can be returned to replace any given tag */ +#if !defined LWIP_HTTPD_MAX_TAG_INSERT_LEN || defined __DOXYGEN__ +#define LWIP_HTTPD_MAX_TAG_INSERT_LEN 192 +#endif + +#if !defined LWIP_HTTPD_POST_MANUAL_WND || defined __DOXYGEN__ +#define LWIP_HTTPD_POST_MANUAL_WND 0 +#endif + +/** This string is passed in the HTTP header as "Server: " */ +#if !defined HTTPD_SERVER_AGENT || defined __DOXYGEN__ +#define HTTPD_SERVER_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)" +#endif + +/** Set this to 1 if you want to include code that creates HTTP headers + * at runtime. Default is off: HTTP headers are then created statically + * by the makefsdata tool. Static headers mean smaller code size, but + * the (readonly) fsdata will grow a bit as every file includes the HTTP + * header. */ +#if !defined LWIP_HTTPD_DYNAMIC_HEADERS || defined __DOXYGEN__ +#define LWIP_HTTPD_DYNAMIC_HEADERS 0 +#endif + +#if !defined HTTPD_DEBUG || defined __DOXYGEN__ +#define HTTPD_DEBUG LWIP_DBG_OFF +#endif + +/** Set this to 1 to use a memp pool for allocating + * struct http_state instead of the heap. + */ +#if !defined HTTPD_USE_MEM_POOL || defined __DOXYGEN__ +#define HTTPD_USE_MEM_POOL 0 +#endif + +/** The server port for HTTPD to use */ +#if !defined HTTPD_SERVER_PORT || defined __DOXYGEN__ +#define HTTPD_SERVER_PORT 80 +#endif + +/** Maximum retries before the connection is aborted/closed. + * - number of times pcb->poll is called -> default is 4*500ms = 2s; + * - reset when pcb->sent is called + */ +#if !defined HTTPD_MAX_RETRIES || defined __DOXYGEN__ +#define HTTPD_MAX_RETRIES 4 +#endif + +/** The poll delay is X*500ms */ +#if !defined HTTPD_POLL_INTERVAL || defined __DOXYGEN__ +#define HTTPD_POLL_INTERVAL 4 +#endif + +/** Priority for tcp pcbs created by HTTPD (very low by default). + * Lower priorities get killed first when running out of memory. + */ +#if !defined HTTPD_TCP_PRIO || defined __DOXYGEN__ +#define HTTPD_TCP_PRIO TCP_PRIO_MIN +#endif + +/** Set this to 1 to enable timing each file sent */ +#if !defined LWIP_HTTPD_TIMING || defined __DOXYGEN__ +#define LWIP_HTTPD_TIMING 0 +#endif +/** Set this to 1 to enable timing each file sent */ +#if !defined HTTPD_DEBUG_TIMING || defined __DOXYGEN__ +#define HTTPD_DEBUG_TIMING LWIP_DBG_OFF +#endif + +/** Set this to one to show error pages when parsing a request fails instead + of simply closing the connection. */ +#if !defined LWIP_HTTPD_SUPPORT_EXTSTATUS || defined __DOXYGEN__ +#define LWIP_HTTPD_SUPPORT_EXTSTATUS 0 +#endif + +/** Set this to 0 to drop support for HTTP/0.9 clients (to save some bytes) */ +#if !defined LWIP_HTTPD_SUPPORT_V09 || defined __DOXYGEN__ +#define LWIP_HTTPD_SUPPORT_V09 1 +#endif + +/** Set this to 1 to enable HTTP/1.1 persistent connections. + * ATTENTION: If the generated file system includes HTTP headers, these must + * include the "Connection: keep-alive" header (pass argument "-11" to makefsdata). + */ +#if !defined LWIP_HTTPD_SUPPORT_11_KEEPALIVE || defined __DOXYGEN__ +#define LWIP_HTTPD_SUPPORT_11_KEEPALIVE 0 +#endif + +/** Set this to 1 to support HTTP request coming in in multiple packets/pbufs */ +#if !defined LWIP_HTTPD_SUPPORT_REQUESTLIST || defined __DOXYGEN__ +#define LWIP_HTTPD_SUPPORT_REQUESTLIST 1 +#endif + +#if LWIP_HTTPD_SUPPORT_REQUESTLIST +/** Number of rx pbufs to enqueue to parse an incoming request (up to the first + newline) */ +#if !defined LWIP_HTTPD_REQ_QUEUELEN || defined __DOXYGEN__ +#define LWIP_HTTPD_REQ_QUEUELEN 5 +#endif + +/** Number of (TCP payload-) bytes (in pbufs) to enqueue to parse and incoming + request (up to the first double-newline) */ +#if !defined LWIP_HTTPD_REQ_BUFSIZE || defined __DOXYGEN__ +#define LWIP_HTTPD_REQ_BUFSIZE LWIP_HTTPD_MAX_REQ_LENGTH +#endif + +/** Defines the maximum length of a HTTP request line (up to the first CRLF, + copied from pbuf into this a global buffer when pbuf- or packet-queues + are received - otherwise the input pbuf is used directly) */ +#if !defined LWIP_HTTPD_MAX_REQ_LENGTH || defined __DOXYGEN__ +#define LWIP_HTTPD_MAX_REQ_LENGTH LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE)) +#endif +#endif /* LWIP_HTTPD_SUPPORT_REQUESTLIST */ + +/** This is the size of a static buffer used when URIs end with '/'. + * In this buffer, the directory requested is concatenated with all the + * configured default file names. + * Set to 0 to disable checking default filenames on non-root directories. + */ +#if !defined LWIP_HTTPD_MAX_REQUEST_URI_LEN || defined __DOXYGEN__ +#define LWIP_HTTPD_MAX_REQUEST_URI_LEN 63 +#endif + +/** Maximum length of the filename to send as response to a POST request, + * filled in by the application when a POST is finished. + */ +#if !defined LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN || defined __DOXYGEN__ +#define LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN 63 +#endif + +/** Set this to 0 to not send the SSI tag (default is on, so the tag will + * be sent in the HTML page */ +#if !defined LWIP_HTTPD_SSI_INCLUDE_TAG || defined __DOXYGEN__ +#define LWIP_HTTPD_SSI_INCLUDE_TAG 1 +#endif + +/** Set this to 1 to call tcp_abort when tcp_close fails with memory error. + * This can be used to prevent consuming all memory in situations where the + * HTTP server has low priority compared to other communication. */ +#if !defined LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR || defined __DOXYGEN__ +#define LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR 0 +#endif + +/** Set this to 1 to kill the oldest connection when running out of + * memory for 'struct http_state' or 'struct http_ssi_state'. + * ATTENTION: This puts all connections on a linked list, so may be kind of slow. + */ +#if !defined LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED || defined __DOXYGEN__ +#define LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED 0 +#endif + +/** Set this to 1 to send URIs without extension without headers + * (who uses this at all??) */ +#if !defined LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI || defined __DOXYGEN__ +#define LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI 0 +#endif + +/** Default: Tags are sent from struct http_state and are therefore volatile */ +#if !defined HTTP_IS_TAG_VOLATILE || defined __DOXYGEN__ +#define HTTP_IS_TAG_VOLATILE(ptr) TCP_WRITE_FLAG_COPY +#endif + +/* By default, the httpd is limited to send 2*pcb->mss to keep resource usage low + when http is not an important protocol in the device. */ +#if !defined HTTPD_LIMIT_SENDING_TO_2MSS || defined __DOXYGEN__ +#define HTTPD_LIMIT_SENDING_TO_2MSS 1 +#endif + +/* Define this to a function that returns the maximum amount of data to enqueue. + The function have this signature: u16_t fn(struct tcp_pcb* pcb); */ +#if !defined HTTPD_MAX_WRITE_LEN || defined __DOXYGEN__ +#if HTTPD_LIMIT_SENDING_TO_2MSS +#define HTTPD_MAX_WRITE_LEN(pcb) (2 * tcp_mss(pcb)) +#endif +#endif + +/*------------------- FS OPTIONS -------------------*/ + +/** Set this to 1 and provide the functions: + * - "int fs_open_custom(struct fs_file *file, const char *name)" + * Called first for every opened file to allow opening files + * that are not included in fsdata(_custom).c + * - "void fs_close_custom(struct fs_file *file)" + * Called to free resources allocated by fs_open_custom(). + */ +#if !defined LWIP_HTTPD_CUSTOM_FILES || defined __DOXYGEN__ +#define LWIP_HTTPD_CUSTOM_FILES 0 +#endif + +/** Set this to 1 to support fs_read() to dynamically read file data. + * Without this (default=off), only one-block files are supported, + * and the contents must be ready after fs_open(). + */ +#if !defined LWIP_HTTPD_DYNAMIC_FILE_READ || defined __DOXYGEN__ +#define LWIP_HTTPD_DYNAMIC_FILE_READ 0 +#endif + +/** Set this to 1 to include an application state argument per file + * that is opened. This allows to keep a state per connection/file. + */ +#if !defined LWIP_HTTPD_FILE_STATE || defined __DOXYGEN__ +#define LWIP_HTTPD_FILE_STATE 0 +#endif + +/** HTTPD_PRECALCULATED_CHECKSUM==1: include precompiled checksums for + * predefined (MSS-sized) chunks of the files to prevent having to calculate + * the checksums at runtime. */ +#if !defined HTTPD_PRECALCULATED_CHECKSUM || defined __DOXYGEN__ +#define HTTPD_PRECALCULATED_CHECKSUM 0 +#endif + +/** LWIP_HTTPD_FS_ASYNC_READ==1: support asynchronous read operations + * (fs_read_async returns FS_READ_DELAYED and calls a callback when finished). + */ +#if !defined LWIP_HTTPD_FS_ASYNC_READ || defined __DOXYGEN__ +#define LWIP_HTTPD_FS_ASYNC_READ 0 +#endif + +/** Set this to 1 to include "fsdata_custom.c" instead of "fsdata.c" for the + * file system (to prevent changing the file included in CVS) */ +#if !defined HTTPD_USE_CUSTOM_FSDATA || defined __DOXYGEN__ +#define HTTPD_USE_CUSTOM_FSDATA 0 +#endif + +/** + * @} + */ + +#endif /* LWIP_HDR_APPS_HTTPD_OPTS_H */ -- cgit v1.2.3 From 2f799372b1b74a0b29039ee3dc853881ad05414e Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Thu, 15 Mar 2018 07:35:12 +0100 Subject: Removed TESTSRC and TESTINC from some makefiles which didnt use them --- testhal/TIVA/TM4C123x/ADC/Makefile | 3 +-- testhal/TIVA/TM4C123x/GPT/Makefile | 3 +-- testhal/TIVA/TM4C123x/I2C/Makefile | 3 +-- testhal/TIVA/TM4C123x/PWM/Makefile | 3 +-- testhal/TIVA/TM4C123x/SPI/Makefile | 3 +-- testhal/TIVA/TM4C123x/UART/Makefile | 3 +-- testhal/TIVA/TM4C123x/WDG/Makefile | 3 +-- testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad | 4 ---- testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad | 4 ---- 9 files changed, 7 insertions(+), 22 deletions(-) diff --git a/testhal/TIVA/TM4C123x/ADC/Makefile b/testhal/TIVA/TM4C123x/ADC/Makefile index d90ef9a..f098dc2 100644 --- a/testhal/TIVA/TM4C123x/ADC/Makefile +++ b/testhal/TIVA/TM4C123x/ADC/Makefile @@ -110,7 +110,6 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ - $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -141,7 +140,7 @@ TCPPSRC = ASMSRC = $(ALLASMSRC) ASMXSRC = $(ALLXASMSRC) -INCDIR = $(ALLINC) $(TESTINC) +INCDIR = $(ALLINC) # # Project, sources and paths diff --git a/testhal/TIVA/TM4C123x/GPT/Makefile b/testhal/TIVA/TM4C123x/GPT/Makefile index 557893f..00661de 100644 --- a/testhal/TIVA/TM4C123x/GPT/Makefile +++ b/testhal/TIVA/TM4C123x/GPT/Makefile @@ -109,7 +109,6 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ - $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -140,7 +139,7 @@ TCPPSRC = ASMSRC = $(ALLASMSRC) ASMXSRC = $(ALLXASMSRC) -INCDIR = $(ALLINC) $(TESTINC) +INCDIR = $(ALLINC) # # Project, sources and paths diff --git a/testhal/TIVA/TM4C123x/I2C/Makefile b/testhal/TIVA/TM4C123x/I2C/Makefile index d90ef9a..f098dc2 100644 --- a/testhal/TIVA/TM4C123x/I2C/Makefile +++ b/testhal/TIVA/TM4C123x/I2C/Makefile @@ -110,7 +110,6 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ - $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -141,7 +140,7 @@ TCPPSRC = ASMSRC = $(ALLASMSRC) ASMXSRC = $(ALLXASMSRC) -INCDIR = $(ALLINC) $(TESTINC) +INCDIR = $(ALLINC) # # Project, sources and paths diff --git a/testhal/TIVA/TM4C123x/PWM/Makefile b/testhal/TIVA/TM4C123x/PWM/Makefile index 557893f..00661de 100644 --- a/testhal/TIVA/TM4C123x/PWM/Makefile +++ b/testhal/TIVA/TM4C123x/PWM/Makefile @@ -109,7 +109,6 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ - $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -140,7 +139,7 @@ TCPPSRC = ASMSRC = $(ALLASMSRC) ASMXSRC = $(ALLXASMSRC) -INCDIR = $(ALLINC) $(TESTINC) +INCDIR = $(ALLINC) # # Project, sources and paths diff --git a/testhal/TIVA/TM4C123x/SPI/Makefile b/testhal/TIVA/TM4C123x/SPI/Makefile index 557893f..00661de 100644 --- a/testhal/TIVA/TM4C123x/SPI/Makefile +++ b/testhal/TIVA/TM4C123x/SPI/Makefile @@ -109,7 +109,6 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ - $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -140,7 +139,7 @@ TCPPSRC = ASMSRC = $(ALLASMSRC) ASMXSRC = $(ALLXASMSRC) -INCDIR = $(ALLINC) $(TESTINC) +INCDIR = $(ALLINC) # # Project, sources and paths diff --git a/testhal/TIVA/TM4C123x/UART/Makefile b/testhal/TIVA/TM4C123x/UART/Makefile index 557893f..00661de 100644 --- a/testhal/TIVA/TM4C123x/UART/Makefile +++ b/testhal/TIVA/TM4C123x/UART/Makefile @@ -109,7 +109,6 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ - $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -140,7 +139,7 @@ TCPPSRC = ASMSRC = $(ALLASMSRC) ASMXSRC = $(ALLXASMSRC) -INCDIR = $(ALLINC) $(TESTINC) +INCDIR = $(ALLINC) # # Project, sources and paths diff --git a/testhal/TIVA/TM4C123x/WDG/Makefile b/testhal/TIVA/TM4C123x/WDG/Makefile index 557893f..00661de 100644 --- a/testhal/TIVA/TM4C123x/WDG/Makefile +++ b/testhal/TIVA/TM4C123x/WDG/Makefile @@ -109,7 +109,6 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ - $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -140,7 +139,7 @@ TCPPSRC = ASMSRC = $(ALLASMSRC) ASMXSRC = $(ALLXASMSRC) -INCDIR = $(ALLINC) $(TESTINC) +INCDIR = $(ALLINC) # # Project, sources and paths diff --git a/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad b/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad index 112666c..9df1d01 100644 --- a/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad +++ b/testhal/TIVA/multi/PAL/Makefile-tm4c123g_launchpad @@ -105,9 +105,6 @@ include $(CHIBIOS)/os/hal/osal/rt/osal.mk include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk # Other files (optional). -#include $(CHIBIOS)/test/lib/test.mk -#include $(CHIBIOS)/test/rt/rt_test.mk -#include $(CHIBIOS)/test/oslib/oslib_test.mk # Define linker script file here LDSCRIPT= $(STARTUPLD)/TM4C123xH6.ld @@ -115,7 +112,6 @@ LDSCRIPT= $(STARTUPLD)/TM4C123xH6.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ - $(TESTSRC) \ $(CONFDIR)/portab.c \ main.c diff --git a/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad b/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad index 0fec94b..caec0ac 100644 --- a/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad +++ b/testhal/TIVA/multi/PAL/Makefile-tm4c1294_launchpad @@ -105,9 +105,6 @@ include $(CHIBIOS)/os/hal/osal/rt/osal.mk include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk # Other files (optional). -#include $(CHIBIOS)/test/lib/test.mk -#include $(CHIBIOS)/test/rt/rt_test.mk -#include $(CHIBIOS)/test/oslib/oslib_test.mk # Define linker script file here LDSCRIPT= $(STARTUPLD)/TM4C129xNC.ld @@ -115,7 +112,6 @@ LDSCRIPT= $(STARTUPLD)/TM4C129xNC.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(ALLCSRC) \ - $(TESTSRC) \ $(CONFDIR)/portab.c \ main.c -- cgit v1.2.3 From 7a9ddb8ada6195cf7f869502b9cc197766027ad2 Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Thu, 15 Mar 2018 08:02:32 +0100 Subject: Removed custom web server and use LwIP httpd in demo --- demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile | 3 +- demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/main.c | 7 +- demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/web/web.c | 120 ------------------------ demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/web/web.h | 51 ---------- 4 files changed, 4 insertions(+), 177 deletions(-) delete mode 100644 demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/web/web.c delete mode 100644 demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/web/web.h diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile index 0d30f91..4584bdf 100644 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile +++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile @@ -111,8 +111,7 @@ LDSCRIPT= $(STARTUPLD)/TM4C129xNC.ld # setting. CSRC = $(ALLCSRC) \ $(CHIBIOS)/os/various/evtimer.c \ - main.c \ - web/web.c \ + main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/main.c b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/main.c index ac9c3f4..0f88419 100644 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/main.c +++ b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/main.c @@ -17,7 +17,7 @@ #include "ch.h" #include "hal.h" #include "lwipthread.h" -#include "web/web.h" +#include "lwip/apps/httpd.h" /* * Application entry point. @@ -43,10 +43,9 @@ int main(void) sdStart(&SD1, NULL); /* - * Creates the HTTP thread (it changes priority internally). + * Creates the LwIP HTTP server. */ - chThdCreateStatic(wa_http_server, sizeof(wa_http_server), NORMALPRIO + 1, - http_server, NULL); + httpd_init(); while (1) { osalThreadSleepMilliseconds(500); diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/web/web.c b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/web/web.c deleted file mode 100644 index 8d0d281..0000000 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/web/web.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - * This file is a modified version of the lwIP web server demo. The original - * author is unknown because the file didn't contain any license information. - */ - -/** - * @file web.c - * @brief HTTP server wrapper thread code. - * @addtogroup WEB_THREAD - * @{ - */ - -#include "ch.h" - -#include "lwip/opt.h" -#include "lwip/arch.h" -#include "lwip/api.h" - -#include "web.h" - -#if LWIP_NETCONN - -static const char http_html_hdr[] = "HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n"; -static const char http_index_html[] = "Congrats!

Welcome to our lwIP HTTP server!

This is a small test page."; - -static void http_server_serve(struct netconn *conn) { - struct netbuf *inbuf; - char *buf; - u16_t buflen; - err_t err; - - /* Read the data from the port, blocking if nothing yet there. - We assume the request (the part we care about) is in one netbuf */ - err = netconn_recv(conn, &inbuf); - - if (err == ERR_OK) { - netbuf_data(inbuf, (void **)&buf, &buflen); - - /* Is this an HTTP GET command? (only check the first 5 chars, since - there are other formats for GET, and we're keeping it very simple )*/ - if (buflen>=5 && - buf[0]=='G' && - buf[1]=='E' && - buf[2]=='T' && - buf[3]==' ' && - buf[4]=='/' ) { - - /* Send the HTML header - * subtract 1 from the size, since we dont send the \0 in the string - * NETCONN_NOCOPY: our data is const static, so no need to copy it - */ - netconn_write(conn, http_html_hdr, sizeof(http_html_hdr)-1, NETCONN_NOCOPY); - - /* Send our HTML page */ - netconn_write(conn, http_index_html, sizeof(http_index_html)-1, NETCONN_NOCOPY); - } - } - /* Close the connection (server closes in HTTP) */ - netconn_close(conn); - - /* Delete the buffer (netconn_recv gives us ownership, - so we have to make sure to deallocate the buffer) */ - netbuf_delete(inbuf); -} - -/** - * Stack area for the http thread. - */ -THD_WORKING_AREA(wa_http_server, WEB_THREAD_STACK_SIZE); - -/** - * HTTP server thread. - */ -THD_FUNCTION(http_server, p) { - struct netconn *conn, *newconn; - err_t err; - - (void)p; - - /* Create a new TCP connection handle */ - conn = netconn_new(NETCONN_TCP); - LWIP_ERROR("http_server: invalid conn", (conn != NULL), return;); - - /* Bind to port 80 (HTTP) with default IP address */ - netconn_bind(conn, NULL, WEB_THREAD_PORT); - - /* Put the connection into LISTEN state */ - netconn_listen(conn); - - /* Goes to the final priority after initialization.*/ - chThdSetPriority(WEB_THREAD_PRIORITY); - - while(1) { - err = netconn_accept(conn, &newconn); - if (err != ERR_OK) - continue; - http_server_serve(newconn); - netconn_delete(newconn); - } -} - -#endif /* LWIP_NETCONN */ - -/** @} */ diff --git a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/web/web.h b/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/web/web.h deleted file mode 100644 index 106dc26..0000000 --- a/demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/web/web.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file web.h - * @brief HTTP server wrapper thread macros and structures. - * @addtogroup WEB_THREAD - * @{ - */ - -#ifndef _WEB_H_ -#define _WEB_H_ - -#ifndef WEB_THREAD_STACK_SIZE -#define WEB_THREAD_STACK_SIZE 1024 -#endif - -#ifndef WEB_THREAD_PORT -#define WEB_THREAD_PORT 80 -#endif - -#ifndef WEB_THREAD_PRIORITY -#define WEB_THREAD_PRIORITY (LOWPRIO + 2) -#endif - -extern THD_WORKING_AREA(wa_http_server, WEB_THREAD_STACK_SIZE); - -#ifdef __cplusplus -extern "C" { -#endif - THD_FUNCTION(http_server, p); -#ifdef __cplusplus -} -#endif - -#endif /* _WEB_H_ */ - -/** @} */ -- cgit v1.2.3