1
0
Fork 0
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:
J Blackman 2023-04-13 13:33:45 +10:00 committed by GitHub
parent 1498c0aa5e
commit ba01a6a48d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -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
@ -116,6 +113,10 @@ $(error Config file not found: $(CONFIG_FILE))
endif
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

View file

@ -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"