Skip to content

Commit a8db502

Browse files
committed
ESP32C3: First step
* https://github.com/mongoose-os-apps/empty builds (w/o OTA support) * Created `platforms/esp32xx` - a repository of files common to IDF-based platforms. * GPIO and UART are quite different between the two chips, other stuff can be shared.
1 parent 7ba54b2 commit a8db502

26 files changed

+1564
-286
lines changed

Diff for: include/mgos_iram.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#ifndef __ASSEMBLER__
2626
#define _IRAM_STR_LIT(a) #a
2727
#define _IRAM_STR(a) _IRAM_STR_LIT(a)
28-
#ifdef MGOS_ESP32
28+
#if defined(MGOS_ESP32) || defined(MGOS_ESP32C3)
2929
#define _IRAM_SECTION_PREFIX ".iram1"
3030
#else
3131
#define _IRAM_SECTION_PREFIX ".text.IRAM"

Diff for: include/mgos_uart.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@
3232

3333
#if CS_PLATFORM == CS_P_CC3200 || CS_PLATFORM == CS_P_CC3220
3434
#include "cc32xx_uart.h"
35-
#elif CS_PLATFORM == CS_P_ESP32
35+
#elif defined(MGOS_ESP32)
3636
#include "esp32_uart.h"
37+
#elif defined(MGOS_ESP32C3)
38+
#include "esp32c3_uart.h"
3739
#elif CS_PLATFORM == CS_P_ESP8266
3840
#include "esp_uart.h"
3941
#elif defined(RS14100)

Diff for: platforms/esp32/Makefile.build

+6-247
Original file line numberDiff line numberDiff line change
@@ -6,252 +6,11 @@ ifdef MGOS_VARS_FILE
66
include $(MGOS_VARS_FILE)
77
endif
88

9-
APP ?= mongoose-os
109
APP_PLATFORM = esp32
11-
APP_CFLAGS ?=
12-
APP_CXXFLAGS ?=
13-
APP_CONF_SCHEMA ?=
14-
APP_EXTRA_SRCS ?=
15-
APP_VERSION ?=
16-
APP_BUILD_ID ?=
17-
FFI_SYMBOLS ?=
18-
# List of app source files, globs are supported
19-
APP_SOURCES ?=
20-
# List of include dirs, in addition to dirs from APP_SOURCES
21-
APP_INCLUDES ?=
22-
# List of app files to put into the device's filesystem, globs are supported
23-
APP_FS_FILES ?=
24-
# List of static libs (.a) which are parts of the app
25-
APP_BIN_LIBS ?=
26-
# Extra parts to include in firmware
27-
APP_EXTRA_FW_PARTS ?=
28-
# Override some settings in SDKCONFIG, e.g. to disable FOO and enable BAR:
29-
# ESP_IDF_SDKCONFIG_OPTS = "CONFIG_FOO= CONFIG_BAR=y"
30-
ESP_IDF_SDKCONFIG_OPTS ?=
31-
# Extra components of ESP-IDF to enable during build
32-
ESP_IDF_EXTRA_COMPONENTS ?=
33-
# Extra flash partition definition.
34-
# ESP_IDF_EXTRA_PARTITION="fs_ext,data,spiffs,,256K"
35-
# Partition will be placed after all other mOS partitions.
36-
ESP_IDF_EXTRA_PARTITION ?=
37-
ESP_IDF_EXTRA_PARTITION_1 ?=
38-
ESP_IDF_EXTRA_PARTITION_2 ?=
39-
ESP_IDF_EXTRA_PARTITION_3 ?=
10+
SDK_COMPONENTS = xtensa xtensa-debug-module
11+
MGOS_ESP_SRCS = esp32_exc.c esp32_gpio.c esp32_hw_timers.c esp32_uart.c
12+
MGOS_ESP32XX_SRCS = esp32xx_debug.c esp32xx_hal.c esp32xx_main.c xtensa_nsleep100.S
13+
MGOS_ESP_CPPFLAGS = -DMGOS_ESP32 -DMGOS_MAX_NUM_UARTS=3 -DMGOS_NUM_HW_TIMERS=4
14+
BOOTLOADER_OFFSET = 0x1000
4015

41-
MGOS_UPDATE_BOOT_LOADER ?= false
42-
43-
MGOS_DEBUG_UART ?= 0
44-
MGOS_ROOT_DEVTAB ?=
45-
MGOS_ROOT_FS_TYPE ?= LFS
46-
MGOS_ROOT_FS_SIZE ?= 262144
47-
48-
export IDF_TARGET = $(APP_PLATFORM)
49-
50-
export MGOS_ROOT_FS_SIZE
51-
52-
# SPIFFS uses its own VFS-level encryption because flash access
53-
# is not compatible with built-in flash encryption.
54-
ifneq ("$(MGOS_ROOT_FS_TYPE)", "SPIFFS")
55-
export FS_PART_ENCR_FLAG = encrypted
56-
FS_PART_ENCR_FLAG_JSON = true
57-
else
58-
export FS_PART_ENCR_FLAG =
59-
FS_PART_ENCR_FLAG_JSON = false
60-
endif
61-
62-
APP_FS_DIRS = $(sort $(dir $(APP_FS_FILES)))
63-
64-
MGOS_PATH ?= ../..
65-
include $(MGOS_PATH)/tools/mk/mgos_common.mk
66-
67-
APP_PATH := $(CURDIR)
68-
MGOS_ESP_PATH := $(MGOS_PATH)/platforms/$(APP_PLATFORM)
69-
MGOS_ESP_SRC_PATH := $(MGOS_ESP_PATH)/main
70-
71-
BUILD_DIR ?= $(CURDIR)/.build
72-
FS_STAGING_DIR = $(BUILD_DIR)/fs
73-
FW_STAGING_DIR ?= $(BUILD_DIR)/fw_temp
74-
FW_DIR ?= $(BUILD_DIR)/firmware
75-
GEN_DIR ?= $(BUILD_DIR)/gen
76-
77-
export APP_SLOT_SIZE ?= 0x180000
78-
FS_IMG = $(FW_STAGING_DIR)/fs.img
79-
export ESP_IDF_EXTRA_PARTITION
80-
export ESP_IDF_EXTRA_PARTITION_1
81-
export ESP_IDF_EXTRA_PARTITION_2
82-
export ESP_IDF_EXTRA_PARTITION_3
83-
export NVS_ADDR ?= 0x9000
84-
export NVS_SIZE ?= 0x4000
85-
export APP_OFFSET ?= 0x10000
86-
export OTA_DATA_ADDR ?= 0xd000
87-
export OTA_DATA_SIZE = 0x2000
88-
MAP_FILE = $(BUILD_DIR)/$(APP).map
89-
90-
# Absolutize all paths which can be given by the caller
91-
override APP_SOURCES := $(abspath $(APP_SOURCES))
92-
override APP_INCLUDES := $(abspath $(APP_INCLUDES))
93-
override APP_FS_FILES := $(abspath $(APP_FS_FILES))
94-
override APP_BIN_LIBS := $(abspath $(APP_BIN_LIBS))
95-
override APP_CONF_SCHEMA := $(abspath $(APP_CONF_SCHEMA))
96-
override APP_EXTRA_SRCS := $(abspath $(APP_EXTRA_SRCS))
97-
override BUILD_DIR := $(abspath $(BUILD_DIR))
98-
override FW_STAGING_DIR := $(abspath $(FW_STAGING_DIR))
99-
override GEN_DIR := $(abspath $(GEN_DIR))
100-
override MGOS_PATH := $(abspath $(MGOS_PATH))
101-
102-
BUILD_INFO_JSON = $(GEN_DIR)/build_info.json
103-
104-
GEN_BUILD_INFO_EXTRA ?=
105-
106-
MGOS_FEATURES =
107-
MGOS_CONF_SCHEMA =
108-
FS_FILES =
109-
110-
include $(MGOS_PATH)/tools/mk/mgos_features.mk
111-
112-
BUILD_INFO_C = $(GEN_DIR)/build_info.c
113-
FFI_EXPORTS_C = $(GEN_DIR)/ffi_exports.c
114-
MG_BUILD_INFO_C = $(GEN_DIR)/mg_build_info.c
115-
MGOS_CONFIG_C = $(GEN_DIR)/mgos_config.c
116-
MGOS_RO_VARS_C = $(GEN_DIR)/mgos_ro_vars.c
117-
APP_BIN = $(BUILD_DIR)/$(APP).bin
118-
BOOTLOADER_BIN = $(BUILD_DIR)/bootloader/bootloader.bin
119-
PARTITION_TABLE_BIN = $(BUILD_DIR)/partition_table/partition-table.bin
120-
PARTITION_TABLE_OFFSET = 0x8000
121-
122-
# TODO(rojer): We should really stop doing this.
123-
APP_SOURCE_DIRS = $(sort $(dir $(APP_SOURCES)))
124-
125-
include $(MGOS_PATH)/tools/mk/mgos_build_info.mk
126-
include $(MGOS_PATH)/tools/mk/mgos_config.mk
127-
include $(MGOS_PATH)/tools/mk/mgos_ffi_exports.mk
128-
include $(MGOS_PATH)/tools/mk/mgos_mkfs.mk
129-
130-
MGOS_FEATURES += $(MG_FEATURES_TINY) \
131-
-DMG_ENABLE_FILESYSTEM -DMG_ENABLE_DIRECTORY_LISTING \
132-
-DMG_NET_IF=MG_NET_IF_LWIP_LOW_LEVEL
133-
134-
# -fno-jump-tables -fno-tree-switch-conversion:
135-
# https://github.com/espressif/esp-idf/issues/1552#issuecomment-883600363
136-
export EXTRA_CPPFLAGS = -pipe -Wall -Werror -Wno-error=strict-aliasing \
137-
-fno-jump-tables -fno-tree-switch-conversion \
138-
-DMGOS_ROOT_DEVTAB=$(MGOS_ROOT_DEVTAB) \
139-
-DMGOS_ROOT_FS_TYPE=$(MGOS_ROOT_FS_TYPE) \
140-
-DMGOS_ROOT_FS_OPTS=$(MGOS_ROOT_FS_OPTS) \
141-
-DMGOS_APP="$(APP)" -DFW_ARCHITECTURE=$(APP_PLATFORM) \
142-
-DMGOS_ESP32 -include mgos_iram.h \
143-
$(MGOS_FEATURES) -DMGOS_MAX_NUM_UARTS=3 -DMGOS_NUM_HW_TIMERS=4 \
144-
$(addprefix -I,$(APP_INCLUDES) $(MGOS_IPATH) $(GEN_DIR) $(APP_SOURCE_DIRS)) \
145-
-I$(IDF_PATH)/components/freertos/include/freertos
146-
export EXTRA_CFLAGS = $(APP_CFLAGS)
147-
export EXTRA_CXXFLAGS = $(APP_CXXFLAGS)
148-
149-
export APP
150-
export MGOS_ESP_PATH
151-
152-
ifeq "$(VERBOSE)" "1"
153-
export VERBOSE
154-
endif
155-
export COLOR = 0
156-
157-
# Explicitly specify SDK components to build.
158-
SDK_COMPONENTS = app_trace app_update bootloader bootloader_support cxx driver efuse esp32 \
159-
esp_common esp_event esp_gdbstub esp_ipc esp_hw_support esp_netif esp_phy esp_pm \
160-
esp_ringbuf esp_rom esp_system esp_timer espcoredump esptool_py \
161-
freertos hal heap log lwip micro-ecc newlib nvs_flash partition_table \
162-
pthread soc spi_flash vfs xtensa xtensa-debug-module
163-
164-
export COMPONENTS = $(SDK_COMPONENTS) main mosapp $(ESP_IDF_EXTRA_COMPONENTS)
165-
166-
MGOS_SRCS += mgos_config_util.c mgos_core_dump.c mgos_dlsym.c mgos_event.c \
167-
mgos_gpio.c mgos_init.c mgos_mmap_esp.c \
168-
mgos_sys_config.c \
169-
mgos_file_utils.c mgos_hw_timers.c mgos_system.c mgos_system.cpp \
170-
mgos_time.c mgos_timers.c mgos_timers.cpp mgos_uart.c mgos_utils.c \
171-
mgos_json_utils.cpp mgos_utils.cpp error_codes.cpp status.cpp \
172-
common/cs_crc32.c common/cs_file.c common/cs_hex.c common/cs_rbuf.c common/cs_varint.c common/json_utils.c \
173-
frozen/frozen.c
174-
175-
MGOS_ESP_SRCS = esp32_debug.c esp32_exc.c \
176-
esp32_gpio.c esp32_hal.c esp32_hw_timers.c \
177-
esp32_main.c esp32_uart.c \
178-
esp32_nsleep100.S
179-
180-
export MGOS_SOURCES = $(addprefix $(MGOS_SRC_PATH)/,$(MGOS_SRCS)) \
181-
$(addprefix $(MGOS_ESP_SRC_PATH)/,$(MGOS_ESP_SRCS))
182-
183-
$(BUILD_INFO_C): $(MGOS_SOURCES) $(APP_SOURCES)
184-
$(call gen_build_info,$@,$(APP_PATH),$(APP_BUILD_ID),$(APP_VERSION),,$(BUILD_INFO_C),$(BUILD_INFO_JSON))
185-
186-
$(MG_BUILD_INFO_C): $(MGOS_SOURCES)
187-
$(call gen_build_info,$@,$(MGOS_PATH)/fw,,,mg_,$(MG_BUILD_INFO_C),)
188-
189-
export GEN_SOURCES = $(MGOS_CONFIG_C) $(MGOS_RO_VARS_C) $(BUILD_INFO_C) $(MG_BUILD_INFO_C) $(FFI_EXPORTS_C)
190-
191-
export APP_BIN_LIBS
192-
export APP_SOURCES
193-
194-
SDKCONFIG_OUT = $(GEN_DIR)/sdkconfig
195-
SDKCONFIG_DEFAULTS_OUT = $(GEN_DIR)/sdkconfig.defaults
196-
197-
$(SDKCONFIG_DEFAULTS_OUT): $(MGOS_ESP_PATH)/sdkconfig.defaults $(MANIFEST_FINAL)
198-
@mkdir -p $(dir $@)
199-
@(cat $< && for kv in $(ESP_IDF_SDKCONFIG_OPTS); do echo $$kv; done) > $@
200-
@# Force rebuild of sdkconfig, otherwise it's not updated
201-
@rm -f $(SDKCONFIG_OUT)
202-
203-
$(FFI_EXPORTS_C): $(APP_FS_FILES)
204-
$(call gen_ffi_exports,$@,$(FFI_SYMBOLS),$(filter %.js,$(FS_FILES)))
205-
206-
FW_PARTS = boot:type=boot,addr=0x1000,src=$(BOOTLOADER_BIN),encrypt=true,update=$(MGOS_UPDATE_BOOT_LOADER) \
207-
pt:type=pt,addr=$(PARTITION_TABLE_OFFSET),src=$(PARTITION_TABLE_BIN),encrypt=true \
208-
otadata:type=otadata,ptn=otadata,src=$(MGOS_ESP_PATH)/otadata.bin,encrypt=true \
209-
nvs:type=nvs,ptn=nvs,size=$(NVS_SIZE),fill=0xff,encrypt=false \
210-
app:type=app,ptn=app_0,src=$(APP_BIN),encrypt=true \
211-
fs:type=fs,ptn=fs_0,src=$(FS_IMG),fs_size=$(MGOS_ROOT_FS_SIZE),encrypt=$(FS_PART_ENCR_FLAG_JSON) \
212-
$(APP_EXTRA_FW_PARTS)
213-
214-
include $(MGOS_PATH)/tools/mk/mgos_fw_meta.mk
215-
216-
all: $(FW_STAGING_DIR) $(FW_DIR) $(GEN_DIR) $(FW_ZIP)
217-
218-
cmake-out: $(BUILD_DIR) $(SDKCONFIG_DEFAULTS_OUT) $(APP_SOURCES) $(MGOS_SOURCES) $(GEN_SOURCES) $(MANIFEST_FINAL)
219-
cd $(BUILD_DIR) && \
220-
cmake -DCOMPONENTS="$(COMPONENTS)" \
221-
-DEXTRA_COMPONENT_DIRS="$(APP_PATH)/components" \
222-
-DFFI_EXPORTS_C="$(FFI_EXPORTS_C)" \
223-
-DSDKCONFIG="$(SDKCONFIG_OUT)" \
224-
-DSDKCONFIG_DEFAULTS="$(SDKCONFIG_DEFAULTS_OUT)" \
225-
$(MGOS_ESP_PATH)
226-
227-
$(APP_BIN): cmake-out
228-
$(MAKE) -C $(BUILD_DIR) all
229-
230-
$(BOOTLOADER_BIN) $(PARTITION_TABLE_BIN): $(APP_BIN)
231-
232-
FS_FILES += $(GEN_DIR)/conf0.json
233-
234-
$(BUILD_DIR) $(FW_DIR) $(FW_STAGING_DIR) $(GEN_DIR):
235-
$(vecho) "MKDIR $@"
236-
$(Q) mkdir -p $@
237-
238-
app-bin-check: $(APP_BIN)
239-
$(eval _appsize := $(shell ls -1 -l $(APP_BIN) | awk '{print $$5}'))
240-
$(eval _appslotsize := $(shell echo $$(($(APP_SLOT_SIZE)))))
241-
$(eval _appsizepct := $(shell echo $$(($(_appsize) * 100 / $(_appslotsize)))))
242-
$(vecho) " App size: $(_appsize) of $(_appslotsize) ($(_appsizepct)%)"
243-
@[ $(_appsize) -lt $(_appslotsize) ] || { echo App is too big && exit 1; }
244-
245-
$(FW_MANIFEST): app-bin-check $(BOOTLOADER_BIN) $(PARTITION_TABLE_BIN) $(FS_IMG) $(MKFS)
246-
247-
$(FS_IMG): $(MKFS) $(APP_FS_DIRS) $(FS_FILES)
248-
$(call mkfs,$(MGOS_ROOT_FS_SIZE),$(MGOS_ROOT_FS_OPTS))
249-
250-
# Lib targets, used in lib builds.
251-
$(BUILD_DIR)/lib.a $(BUILD_DIR)/moslib/libmoslib.a: cmake-out
252-
$(MAKE) -C $(BUILD_DIR) -f esp-idf/mosapp/CMakeFiles/__idf_mosapp.dir/build.make esp-idf/mosapp/libmosapp.a
253-
@mkdir -p $(dir $@)
254-
@cp $(BUILD_DIR)/esp-idf/mosapp/libmosapp.a $@
255-
256-
clean:
257-
rm -rf $(BUILD_DIR)
16+
include $(MGOS_PATH)/platforms/esp32xx/Makefile.build

Diff for: platforms/esp32/sdk.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docker.io/mgos/esp32-build:4.4.1-r5
1+
docker.io/mgos/esp32-build:4.4.1-r6

Diff for: platforms/esp32/sdkconfig.defaults

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
CONFIG_PARTITION_TABLE_SINGLE_APP=n
55
CONFIG_PARTITION_TABLE_CUSTOM=y
6-
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_mgos.csv"
7-
CONFIG_PARTITION_TABLE_FILENAME="partitions_mgos.csv"
6+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="../esp32xx/partitions_mgos.csv"
7+
CONFIG_PARTITION_TABLE_FILENAME="../esp32xx/partitions_mgos.csv"
88
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
99
CONFIG_COMPILER_CXX_EXCEPTIONS=n
1010
CONFIG_COMPILER_CXX_RTTI=n

Diff for: platforms/esp32c3/CMakeLists.txt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
set(PYTHON_DEPS_CHECKED 1) # Save some build time
3+
set(EXTRA_CFLAGS $ENV{EXTRA_CFLAGS})
4+
set(EXTRA_CPPFLAGS $ENV{EXTRA_CPPFLAGS})
5+
set(EXTRA_CXXFLAGS $ENV{EXTRA_CXXFLAGS})
6+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
7+
project($ENV{APP})
8+
9+
# Add binary libs.
10+
separate_arguments(app_bin_libs NATIVE_COMMAND "$ENV{APP_BIN_LIBS}")
11+
foreach(bin_lib ${app_bin_libs})
12+
get_filename_component(target_name ${bin_lib} NAME_WLE)
13+
add_prebuilt_library(${target_name} ${bin_lib})
14+
target_link_libraries(${CMAKE_PROJECT_NAME}.elf ${target_name})
15+
endforeach()
16+
17+
# ESP-IDF passes component libs multiple times to the linker.
18+
# This looks like a bug but is not a problem unless they are --whole-archive's.
19+
# Which is what we want to do, since that is the only way to make sure weak
20+
# functions are overridden by non-weak ones, which we definitely want to happen.
21+
# We wrap the link command with a script that dedupes the static libs,
22+
# puts them in a group and wraps with --whole-archive.
23+
set(CMAKE_CXX_LINK_EXECUTABLE "/mongoose-os/tools/link.py <CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")

Diff for: platforms/esp32c3/Makefile.build

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
MAKEFLAGS += --no-builtin-rules --no-print-directory
2+
#MAKEFLAGS += --warn-undefined-variables
3+
.DEFAULT_GOAL := all
4+
5+
ifdef MGOS_VARS_FILE
6+
include $(MGOS_VARS_FILE)
7+
endif
8+
9+
APP_PLATFORM = esp32c3
10+
SDK_COMPONENTS = riscv
11+
MGOS_ESP_SRCS = esp32c3_gpio.c esp32c3_hw_timers.c esp32c3_uart.c
12+
MGOS_ESP32XX_SRCS = esp32xx_debug.c esp32xx_hal.c esp32xx_main.c riscv_nsleep100.S
13+
MGOS_ESP_CPPFLAGS = -DMGOS_ESP32C3 -DMGOS_MAX_NUM_UARTS=2 -DMGOS_NUM_HW_TIMERS=2
14+
BOOTLOADER_OFFSET = 0
15+
16+
include $(MGOS_PATH)/platforms/esp32xx/Makefile.build

Diff for: platforms/esp32c3/components/mosapp/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
separate_arguments(app_srcs NATIVE_COMMAND "$ENV{APP_SOURCES}")
2+
idf_component_register(
3+
SRCS ${app_srcs}
4+
REQUIRES main
5+
)

Diff for: platforms/esp32c3/include/sys/mman.h

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (c) 2014-2018 Cesanta Software Limited
3+
* All rights reserved
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the ""License"");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an ""AS IS"" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#ifndef CS_FW_PLATFORMS_ESP8266_INCLUDE_SYS_MMAN_H_
19+
#define CS_FW_PLATFORMS_ESP8266_INCLUDE_SYS_MMAN_H_
20+
21+
#include <sys/types.h>
22+
23+
#ifdef __cplusplus
24+
extern "C" {
25+
#endif
26+
27+
#define MAP_PRIVATE 1
28+
#define PROT_READ 1
29+
#define MAP_FAILED ((void *) (-1))
30+
31+
void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);
32+
int munmap(void *addr, size_t len);
33+
34+
#ifdef __cplusplus
35+
}
36+
#endif
37+
38+
#endif /* CS_FW_PLATFORMS_ESP8266_INCLUDE_SYS_MMAN_H_ */

Diff for: platforms/esp32c3/main/CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
separate_arguments(gen_srcs NATIVE_COMMAND "$ENV{GEN_SOURCES}")
2+
separate_arguments(mgos_srcs NATIVE_COMMAND "$ENV{MGOS_SOURCES}")
3+
idf_component_register(
4+
INCLUDE_DIRS "."
5+
SRCS ${app_srcs} ${gen_srcs} ${mgos_srcs}
6+
)
7+
# In ffi exports file we use fake signatures: void func(void), and it conflicts
8+
# with the builtin functions like fopen, etc.
9+
set_source_files_properties(${FFI_EXPORTS_C} PROPERTIES COMPILE_FLAGS -fno-builtin)

0 commit comments

Comments
 (0)