Skip to content

Commit c5a19af

Browse files
IDF 5.3 fixes (#269) (#271)
(cherry picked from commit df75268) Co-authored-by: Pablo Garrido <[email protected]>
1 parent 2f5c210 commit c5a19af

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

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
@@ -135,6 +135,21 @@ ifeq ($(IDF_TARGET),$(filter $(IDF_TARGET),esp32s2 esp32c3))
135135
rm -rf $(UROS_DIR)/atomic_workaround; \
136136
cd ..;
137137
endif
138+
ifeq ($(IDF_TARGET),$(filter $(IDF_TARGET),esp32))
139+
echo $(UROS_DIR)/atomic_workaround; \
140+
mkdir $(UROS_DIR)/atomic_workaround; cd $(UROS_DIR)/atomic_workaround; \
141+
$(X_AR) x $(UROS_DIR)/install/lib/librcutils.a; \
142+
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_fetch_add_8; \
143+
if [ $(IDF_VERSION_MAJOR) -ge 5 ] && [ $(IDF_VERSION_MINOR) -ge 3 ]; then \
144+
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_load_8; \
145+
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_store_8; \
146+
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_exchange_8; \
147+
fi; \
148+
$(X_AR) rc -s librcutils.a *.obj; \
149+
cp -rf librcutils.a $(UROS_DIR)/install/lib/librcutils.a; \
150+
cd ..; \
151+
rm -rf $(UROS_DIR)/atomic_workaround;
152+
endif
138153

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

0 commit comments

Comments
 (0)