Skip to content

Commit c5be162

Browse files
IDF 5.3 fixes (#269) (#270)
(cherry picked from commit df75268) Co-authored-by: Pablo Garrido <pablogs9@gmail.com>
1 parent 27df26a commit c5be162

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
idf_component_register(SRCS "network_interfaces/uros_ethernet_netif.c" "network_interfaces/uros_wlan_netif.c"
1+
option(BUILD_ETHERNET_INTERFACE "Build ethernet interface support" OFF)
2+
option(BUILD_WLAN_INTERFACE "Build wlan interface support" ON)
3+
4+
set(COMPONENT_SRC "")
5+
6+
if(BUILD_ETHERNET_INTERFACE)
7+
list(APPEND COMPONENT_SRC "network_interfaces/uros_ethernet_netif.c")
8+
endif()
9+
10+
if(BUILD_WLAN_INTERFACE)
11+
list(APPEND COMPONENT_SRC "network_interfaces/uros_wlan_netif.c")
12+
endif()
13+
14+
idf_component_register(SRCS ${COMPONENT_SRC}
215
INCLUDE_DIRS "network_interfaces"
316
REQUIRES nvs_flash esp_wifi esp_eth lwip)
417

libmicroros.mk

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,21 @@ ifeq ($(IDF_TARGET),$(filter $(IDF_TARGET),esp32s2 esp32c3))
131131
cd ..; \
132132
rm -rf $(UROS_DIR)/atomic_workaround;
133133
endif
134+
ifeq ($(IDF_TARGET),$(filter $(IDF_TARGET),esp32))
135+
echo $(UROS_DIR)/atomic_workaround; \
136+
mkdir $(UROS_DIR)/atomic_workaround; cd $(UROS_DIR)/atomic_workaround; \
137+
$(X_AR) x $(UROS_DIR)/install/lib/librcutils.a; \
138+
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_fetch_add_8; \
139+
if [ $(IDF_VERSION_MAJOR) -ge 5 ] && [ $(IDF_VERSION_MINOR) -ge 3 ]; then \
140+
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_load_8; \
141+
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_store_8; \
142+
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_exchange_8; \
143+
fi; \
144+
$(X_AR) rc -s librcutils.a *.obj; \
145+
cp -rf librcutils.a $(UROS_DIR)/install/lib/librcutils.a; \
146+
cd ..; \
147+
rm -rf $(UROS_DIR)/atomic_workaround;
148+
endif
134149

135150
$(EXTENSIONS_DIR)/libmicroros.a: $(EXTENSIONS_DIR)/micro_ros_src/install patch_atomic
136151
mkdir -p $(UROS_DIR)/libmicroros; cd $(UROS_DIR)/libmicroros; \

0 commit comments

Comments
 (0)