Fix ChibiOS FPU build logic (#9132)
This commit is contained in:
		
							parent
							
								
									3ad2be52a7
								
							
						
					
					
						commit
						b0c780ed32
					
				
					 2 changed files with 13 additions and 17 deletions
				
			
		| 
						 | 
				
			
			@ -220,6 +220,18 @@ COMPILEFLAGS += -fno-common
 | 
			
		|||
COMPILEFLAGS += -fshort-wchar
 | 
			
		||||
COMPILEFLAGS += $(THUMBFLAGS)
 | 
			
		||||
 | 
			
		||||
# FPU options default (Cortex-M4 and Cortex-M7 single precision).
 | 
			
		||||
USE_FPU_OPT ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
 | 
			
		||||
 | 
			
		||||
# FPU-related options
 | 
			
		||||
USE_FPU ?= no
 | 
			
		||||
ifneq ($(USE_FPU),no)
 | 
			
		||||
  COMPILEFLAGS += $(USE_FPU_OPT)
 | 
			
		||||
  OPT_DEFS += -DCORTEX_USE_FPU=TRUE
 | 
			
		||||
else
 | 
			
		||||
  OPT_DEFS += -DCORTEX_USE_FPU=FALSE
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
CFLAGS += $(COMPILEFLAGS)
 | 
			
		||||
 | 
			
		||||
ASFLAGS += $(THUMBFLAGS)
 | 
			
		||||
| 
						 | 
				
			
			@ -241,22 +253,6 @@ OPT_DEFS += -DPORT_IGNORE_GCC_VERSION_CHECK=1
 | 
			
		|||
 | 
			
		||||
MCUFLAGS = -mcpu=$(MCU)
 | 
			
		||||
 | 
			
		||||
# FPU options default (Cortex-M4 and Cortex-M7 single precision).
 | 
			
		||||
ifeq ($(USE_FPU_OPT),)
 | 
			
		||||
  USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 -fsingle-precision-constant
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
# FPU-related options
 | 
			
		||||
ifeq ($(USE_FPU),)
 | 
			
		||||
  USE_FPU = no
 | 
			
		||||
endif
 | 
			
		||||
ifneq ($(USE_FPU),no)
 | 
			
		||||
  OPT    += $(USE_FPU_OPT)
 | 
			
		||||
  OPT_DEFS  += -DCORTEX_USE_FPU=TRUE
 | 
			
		||||
else
 | 
			
		||||
  OPT_DEFS  += -DCORTEX_USE_FPU=FALSE
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
DEBUG = gdb
 | 
			
		||||
 | 
			
		||||
DFU_ARGS ?=
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -46,7 +46,7 @@ FORMAT = ihex
 | 
			
		|||
# Optimization level, can be [0, 1, 2, 3, s].
 | 
			
		||||
#     0 = turn off optimization. s = optimize for size.
 | 
			
		||||
#     (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
 | 
			
		||||
OPT = s
 | 
			
		||||
OPT ?= s
 | 
			
		||||
 | 
			
		||||
# Compiler flag to set the C Standard level.
 | 
			
		||||
#     c89   = "ANSI" C
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue