diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-05-14 14:56:31 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-05-14 14:56:31 +0000 |
commit | b228e17215a83cf2af2c51b142badc7c1011c75d (patch) | |
tree | c88aab1ccfe56fc558ea7ae31a6af10e95574ec0 /demos/various/RT-ARMCM4-GENERIC | |
parent | 8ae45a5b9616c3214c4fc043b90750ca662b0372 (diff) | |
download | ChibiOS-b228e17215a83cf2af2c51b142badc7c1011c75d.tar.gz ChibiOS-b228e17215a83cf2af2c51b142badc7c1011c75d.tar.bz2 ChibiOS-b228e17215a83cf2af2c51b142badc7c1011c75d.zip |
Fixed to be made also to other demos without HAL and backported.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12034 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'demos/various/RT-ARMCM4-GENERIC')
-rw-r--r-- | demos/various/RT-ARMCM4-GENERIC/Makefile | 84 | ||||
-rw-r--r-- | demos/various/RT-ARMCM4-GENERIC/cfg/chconf.h (renamed from demos/various/RT-ARMCM4-GENERIC/chconf.h) | 0 | ||||
-rw-r--r-- | demos/various/RT-ARMCM4-GENERIC/main.c | 3 |
3 files changed, 47 insertions, 40 deletions
diff --git a/demos/various/RT-ARMCM4-GENERIC/Makefile b/demos/various/RT-ARMCM4-GENERIC/Makefile index 8dd3ceb09..f0ad7f579 100644 --- a/demos/various/RT-ARMCM4-GENERIC/Makefile +++ b/demos/various/RT-ARMCM4-GENERIC/Makefile @@ -18,7 +18,7 @@ ifeq ($(USE_CPPOPT),) USE_CPPOPT = -fno-rtti
endif
-# Enable this if you want the linker to remove unused code and data
+# Enable this if you want the linker to remove unused code and data.
ifeq ($(USE_LINK_GC),)
USE_LINK_GC = yes
endif
@@ -28,7 +28,7 @@ ifeq ($(USE_LDOPT),) USE_LDOPT =
endif
-# Enable this if you want link time optimizations (LTO)
+# Enable this if you want link time optimizations (LTO).
ifeq ($(USE_LTO),)
USE_LTO = yes
endif
@@ -74,6 +74,11 @@ ifeq ($(USE_FPU),) USE_FPU = no
endif
+# FPU-related options.
+ifeq ($(USE_FPU_OPT),)
+ USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 -fsingle-precision-constant
+endif
+
#
# Architecture or project specific options
##############################################################################
@@ -87,6 +92,12 @@ PROJECT = ch # Imported source files and paths
CHIBIOS = ../../..
+CONFDIR := ./cfg
+BUILDDIR := ./build
+DEPDIR := ./.dep
+
+# Licensing files.
+include $(CHIBIOS)/os/license/license.mk
# Startup files.
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk
# HAL-OSAL files (optional).
@@ -97,6 +108,8 @@ include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.m # RTOS files (optional).
include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
+# Auto-build files in ./source recursively.
+include $(CHIBIOS)/tools/mk/autobuild.mk
# Other files (optional).
#include $(CHIBIOS)/test/lib/test.mk
#include $(CHIBIOS)/test/rt/rt_test.mk
@@ -107,19 +120,13 @@ LDSCRIPT= $(STARTUPLD)/STM32F407xG.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
@@ -141,20 +148,40 @@ TCSRC = # option that results in lower performance and larger code size.
TCPPSRC =
-# List ASM source files here
-ASMSRC =
-ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
+# List ASM source files here.
+ASMSRC = $(ALLASMSRC)
+ASMXSRC = $(ALLXASMSRC)
-INCDIR = $(CHIBIOS)/os/license \
- $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
- $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
- $(CHIBIOS)/os/various
+INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC)
#
# Project, sources and paths
##############################################################################
##############################################################################
+# Start of user section
+#
+
+# List all user C define here, like -D_DEBUG=1
+UDEFS = -DSTM32F407xx
+
+# Define ASM defines here
+UADEFS = -DSTM32F407xx
+
+# 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 section
+##############################################################################
+
+##############################################################################
# Compiler settings
#
@@ -193,29 +220,6 @@ CPPWARN = -Wall -Wextra -Wundef # Compiler settings
##############################################################################
-##############################################################################
-# Start of user section
-#
-
-# List all user C define here, like -D_DEBUG=1
-UDEFS = -DSTM32F407xx
-
-# 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
diff --git a/demos/various/RT-ARMCM4-GENERIC/chconf.h b/demos/various/RT-ARMCM4-GENERIC/cfg/chconf.h index ecb293dc3..ecb293dc3 100644 --- a/demos/various/RT-ARMCM4-GENERIC/chconf.h +++ b/demos/various/RT-ARMCM4-GENERIC/cfg/chconf.h diff --git a/demos/various/RT-ARMCM4-GENERIC/main.c b/demos/various/RT-ARMCM4-GENERIC/main.c index ded79da4d..976da585c 100644 --- a/demos/various/RT-ARMCM4-GENERIC/main.c +++ b/demos/various/RT-ARMCM4-GENERIC/main.c @@ -67,6 +67,9 @@ int main(void) { SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk |
SysTick_CTRL_TICKINT_Msk;
+ /* IRQ enabled.*/
+ NVIC_SetPriority(SysTick_IRQn, 8);
+
/*
* System initializations.
* - Kernel initialization, the main() function becomes a thread and the
|