mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 11:29:58 +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
10
Makefile
10
Makefile
|
@ -93,9 +93,6 @@ include $(ROOT)/make/$(OSFAMILY).mk
|
||||||
# include the tools makefile
|
# include the tools makefile
|
||||||
include $(ROOT)/make/tools.mk
|
include $(ROOT)/make/tools.mk
|
||||||
|
|
||||||
# default xtal value for F4 targets
|
|
||||||
HSE_VALUE ?= 8000000
|
|
||||||
|
|
||||||
# Search path for sources
|
# Search path for sources
|
||||||
VPATH := $(SRC_DIR):$(SRC_DIR)/startup
|
VPATH := $(SRC_DIR):$(SRC_DIR)/startup
|
||||||
FATFS_DIR = $(ROOT)/lib/main/FatFS
|
FATFS_DIR = $(ROOT)/lib/main/FatFS
|
||||||
|
@ -116,6 +113,10 @@ $(error Config file not found: $(CONFIG_FILE))
|
||||||
endif
|
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),)
|
ifeq ($(TARGET),)
|
||||||
$(error No TARGET identified. Is the config.h valid for $(CONFIG)?)
|
$(error No TARGET identified. Is the config.h valid for $(CONFIG)?)
|
||||||
|
@ -132,6 +133,9 @@ TARGET := $(DEFAULT_TARGET)
|
||||||
endif
|
endif
|
||||||
endif #CONFIG
|
endif #CONFIG
|
||||||
|
|
||||||
|
# default xtal value
|
||||||
|
HSE_VALUE ?= 8000000
|
||||||
|
|
||||||
BASE_CONFIGS = $(sort $(notdir $(patsubst %/,%,$(dir $(wildcard $(ROOT)/src/config/*/config.h)))))
|
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)))))
|
BASE_TARGETS = $(sort $(notdir $(patsubst %/,%,$(dir $(wildcard $(ROOT)/src/main/target/*/target.mk)))))
|
||||||
CI_TARGETS := $(BASE_TARGETS) CRAZYBEEF4SX1280 CRAZYBEEF4FR IFLIGHT_BLITZ_F722
|
CI_TARGETS := $(BASE_TARGETS) CRAZYBEEF4SX1280 CRAZYBEEF4FR IFLIGHT_BLITZ_F722
|
||||||
|
|
|
@ -32,10 +32,6 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SYSTEM_HSE_MHZ) && !defined(HSE_VALUE)
|
|
||||||
#define HSE_VALUE (SYSTEM_HSE_MHZ * 1000000)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// MCU specific platform from drivers/XX
|
// MCU specific platform from drivers/XX
|
||||||
#include "platform_mcu.h"
|
#include "platform_mcu.h"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue