mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 03:20:00 +03:00
Obtain HSE_VALUE from config.h where provided. (#12632)
This commit is contained in:
parent
1498c0aa5e
commit
ba01a6a48d
2 changed files with 8 additions and 8 deletions
12
Makefile
12
Makefile
|
@ -93,9 +93,6 @@ include $(ROOT)/make/$(OSFAMILY).mk
|
|||
# include the tools makefile
|
||||
include $(ROOT)/make/tools.mk
|
||||
|
||||
# default xtal value for F4 targets
|
||||
HSE_VALUE ?= 8000000
|
||||
|
||||
# Search path for sources
|
||||
VPATH := $(SRC_DIR):$(SRC_DIR)/startup
|
||||
FATFS_DIR = $(ROOT)/lib/main/FatFS
|
||||
|
@ -115,7 +112,11 @@ ifeq ($(wildcard $(CONFIG_FILE)),)
|
|||
$(error Config file not found: $(CONFIG_FILE))
|
||||
endif
|
||||
|
||||
TARGET := $(shell grep " FC_TARGET_MCU" $(CONFIG_FILE) | awk '{print $$3}' )
|
||||
TARGET := $(shell grep " FC_TARGET_MCU" $(CONFIG_FILE) | awk '{print $$3}' )
|
||||
HSE_VALUE_MHZ := $(shell grep " SYSTEM_HSE_MHZ" $(CONFIG_FILE) | awk '{print $$3}' )
|
||||
ifneq ($(HSE_VALUE_MHZ),)
|
||||
HSE_VALUE := $(shell echo $$(( $(HSE_VALUE_MHZ) * 1000000 )) )
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),)
|
||||
$(error No TARGET identified. Is the config.h valid for $(CONFIG)?)
|
||||
|
@ -132,6 +133,9 @@ TARGET := $(DEFAULT_TARGET)
|
|||
endif
|
||||
endif #CONFIG
|
||||
|
||||
# default xtal value
|
||||
HSE_VALUE ?= 8000000
|
||||
|
||||
BASE_CONFIGS = $(sort $(notdir $(patsubst %/,%,$(dir $(wildcard $(ROOT)/src/config/*/config.h)))))
|
||||
BASE_TARGETS = $(sort $(notdir $(patsubst %/,%,$(dir $(wildcard $(ROOT)/src/main/target/*/target.mk)))))
|
||||
CI_TARGETS := $(BASE_TARGETS) CRAZYBEEF4SX1280 CRAZYBEEF4FR IFLIGHT_BLITZ_F722
|
||||
|
|
|
@ -32,10 +32,6 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#if defined(SYSTEM_HSE_MHZ) && !defined(HSE_VALUE)
|
||||
#define HSE_VALUE (SYSTEM_HSE_MHZ * 1000000)
|
||||
#endif
|
||||
|
||||
// MCU specific platform from drivers/XX
|
||||
#include "platform_mcu.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue