Skip to content

Commit

Permalink
IDF 5.3 fixes (#269) (#272)
Browse files Browse the repository at this point in the history
(cherry picked from commit df75268)

Co-authored-by: Pablo Garrido <pablogs9@gmail.com>
  • Loading branch information
mergify[bot] and pablogs9 authored Nov 13, 2024
1 parent cd46ab0 commit e1e7b55
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
idf_component_register(SRCS "network_interfaces/uros_ethernet_netif.c" "network_interfaces/uros_wlan_netif.c"
option(BUILD_ETHERNET_INTERFACE "Build ethernet interface support" OFF)
option(BUILD_WLAN_INTERFACE "Build wlan interface support" ON)

set(COMPONENT_SRC "")

if(BUILD_ETHERNET_INTERFACE)
list(APPEND COMPONENT_SRC "network_interfaces/uros_ethernet_netif.c")
endif()

if(BUILD_WLAN_INTERFACE)
list(APPEND COMPONENT_SRC "network_interfaces/uros_wlan_netif.c")
endif()

idf_component_register(SRCS ${COMPONENT_SRC}
INCLUDE_DIRS "network_interfaces"
REQUIRES nvs_flash esp_wifi esp_eth lwip)

Expand Down
15 changes: 15 additions & 0 deletions libmicroros.mk
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,21 @@ ifeq ($(IDF_TARGET),$(filter $(IDF_TARGET),esp32s2 esp32c3))
cd ..; \
rm -rf $(UROS_DIR)/atomic_workaround;
endif
ifeq ($(IDF_TARGET),$(filter $(IDF_TARGET),esp32))
echo $(UROS_DIR)/atomic_workaround; \
mkdir $(UROS_DIR)/atomic_workaround; cd $(UROS_DIR)/atomic_workaround; \
$(X_AR) x $(UROS_DIR)/install/lib/librcutils.a; \
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_fetch_add_8; \
if [ $(IDF_VERSION_MAJOR) -ge 5 ] && [ $(IDF_VERSION_MINOR) -ge 3 ]; then \
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_load_8; \
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_store_8; \
$(X_STRIP) atomic_64bits.c.obj --strip-symbol=__atomic_exchange_8; \
fi; \
$(X_AR) rc -s librcutils.a *.obj; \
cp -rf librcutils.a $(UROS_DIR)/install/lib/librcutils.a; \
cd ..; \
rm -rf $(UROS_DIR)/atomic_workaround;
endif

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

0 comments on commit e1e7b55

Please sign in to comment.