mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ASIO: fixed undefined ref to atomic functions and enabled examples for CI (esp32s2beta)
Implemented the atomic functions needed to compile and link the asio examples on esp32s2beta.
This commit is contained in:
parent
bf1977e48e
commit
845003a1c3
@ -34,6 +34,25 @@
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define FETCH_ADD(n, type) type __atomic_fetch_add_ ## n (type* ptr, type value, int memorder) \
|
||||
{ \
|
||||
unsigned state = portENTER_CRITICAL_NESTED(); \
|
||||
type ret = *ptr; \
|
||||
*ptr = *ptr + value; \
|
||||
portEXIT_CRITICAL_NESTED(state); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
#define FETCH_SUB(n, type) type __atomic_fetch_sub_ ## n (type* ptr, type value, int memorder) \
|
||||
{ \
|
||||
unsigned state = portENTER_CRITICAL_NESTED(); \
|
||||
type ret = *ptr; \
|
||||
*ptr = *ptr - value; \
|
||||
portEXIT_CRITICAL_NESTED(state); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
|
||||
//this piece of code should only be compiled if the cpu doesn't support atomic compare and swap (s32c1i)
|
||||
#if XCHAL_HAVE_S32C1I == 0
|
||||
|
||||
@ -44,4 +63,14 @@ CMP_EXCHANGE(2, uint16_t)
|
||||
CMP_EXCHANGE(4, uint32_t)
|
||||
CMP_EXCHANGE(8, uint64_t)
|
||||
|
||||
FETCH_ADD(1, uint8_t)
|
||||
FETCH_ADD(2, uint16_t)
|
||||
FETCH_ADD(4, uint32_t)
|
||||
FETCH_ADD(8, uint64_t)
|
||||
|
||||
FETCH_SUB(1, uint8_t)
|
||||
FETCH_SUB(2, uint16_t)
|
||||
FETCH_SUB(4, uint32_t)
|
||||
FETCH_SUB(8, uint64_t)
|
||||
|
||||
#endif
|
@ -6,6 +6,5 @@ cmake_minimum_required(VERSION 3.5)
|
||||
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
|
||||
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
|
||||
|
||||
set(SUPPORTED_TARGETS esp32)
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(asio_chat_client)
|
||||
|
@ -6,6 +6,5 @@ cmake_minimum_required(VERSION 3.5)
|
||||
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
|
||||
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
|
||||
|
||||
set(SUPPORTED_TARGETS esp32)
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(asio_chat_server)
|
||||
|
@ -6,6 +6,5 @@ cmake_minimum_required(VERSION 3.5)
|
||||
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
|
||||
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
|
||||
|
||||
set(SUPPORTED_TARGETS esp32)
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(asio_tcp_echo_server)
|
||||
|
@ -6,6 +6,5 @@ cmake_minimum_required(VERSION 3.5)
|
||||
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
|
||||
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
|
||||
|
||||
set(SUPPORTED_TARGETS esp32)
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(asio_udp_echo_server)
|
||||
|
Loading…
Reference in New Issue
Block a user