forked from verybadsoldier/esp_rgbww_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
component.mk
79 lines (66 loc) · 2.58 KB
/
component.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
COMPONENT_SEARCH_DIRS := $(PROJECT_DIR)/Components
COMPONENT_DEPENDS += MDNS RGBWWLed LittleFS ConfigDB ArduinoJson6 OtaNetwork
# Set default number of jobs to twice the number of available processors
NUM_JOBS := $(shell echo $(($(nproc) * 2)))
MAKEFLAGS += -j$(NUM_JOBS)
HWCONFIG :=two_roms_two_lfs_$(SMING_ARCH)
#### rBoot options ####
# use rboot build mode
RBOOT_ENABLED = 1
# enable tmp rom switching
RBOOT_RTC_ENABLED = 1
# two rom mode (where two roms sit in the same 1mb block of flash)
RBOOT_TWO_ROMS = 0
RBOOT_BIG_FLASH = 1
ENABLE_CUSTOM_PWM = 0
#ENABLE_CUSTOM_PWM = 0
//COM_SPEED = 230400
//COM_SPEED = 460800
//COM_SPEED = 921600
//COM_SPEED = 2000000
//COM_PORT=/dev/ttyUSB0
//COM_PORT=/dev/ttyACM0
ifeq ($(SMING_ARCH), Esp8266)
$(info arch Esp8266)
ifeq ($(strip $(COM_PORT)),)
override COM_PORT=/dev/serial/by-id/usb-1a86_USB_Single_Serial_5647014434-if00
endif
ifeq ($(strip $(COM_SPEED)),)
override COM_SPEED=921600
endif
$(info COM_PORT is $(COM_PORT)@$(COM_SPEED) for $(SMING_ARCH))
else ifeq ($(SMING_ARCH), Esp32)
ifeq ($(strip $(COM_PORT)),)
override COM_PORT=/dev/serial/by-id/usb-1a86_USB_Single_Serial_5647022450-if00
endif
ifeq ($(strip $(COM_SPEED)),)
override COM_SPEED=115200
endif
$(info COM_PORT is $(COM_PORT)@$(COM_SPEED) for $(SMING_ARCH))
endif
CUSTOM_TARGETS += check_versions
#### GIT VERSION Information #####
GIT_VERSION = $(shell git describe --abbrev=4 --dirty --always --tags)"-["$(shell git rev-parse --abbrev-ref HEAD)"]"
GIT_DATE = $(firstword $(shell git --no-pager show --date=short --format="%ad" --name-only))
SMING_GITVERSION = $(shell git -C $(SMING_HOME)/.. describe --abbrev=4 --dirty --always --tags)"-["$(shell git -C $(SMING_HOME)/.. rev-parse --abbrev-ref HEAD)"]"
WEBAPP_VERSION = $(shell cat $(PROJECT_DIR)/webapp/VERSION)
USER_CFLAGS = -DGITVERSION=\"$(GIT_VERSION)\" -DGITDATE=\"$(GIT_DATE)\" -DWEBAPP_VERSION=\"$(WEBAPP_VERSION)\" -DSMING_GITVERSION=\"$(SMING_GITVERSION)\"
$(info using firmware version $(GIT_VERSION))
$(info using WEBapp $(WEBAPP_VERSION))
$(info using SMING $(SMING_GITVERSION))
# include partition file for initial OTA
EXTRA_LDFLAGS := $(call Wrap,user_pre_init)
USER_CFLAGS += -DPARTITION_TABLE_OFFSET=$(PARTITION_TABLE_OFFSET)
.PHONY: check_versions
check_versions:
ifndef GIT_VERSION
$(info no GIT_VERSION available, using unknown)
GIT_VERSION = "unknown"
endif
ifndef GIT_DATE
$(info no GIT_DATE available, using unknown)
GIT_DATE = "unknown"
endif
ifndef WEBAPP_VERSION
$(error can not find webapp/VERSION file - please ensure the source code is complete)
endif