From 27b810a76c27f6bbd6da2f6d4ddf6a3f1dc01669 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 19 Jan 2022 16:13:28 +0100 Subject: [PATCH 1/2] Add Twitter and Readthedocs shields (#307) (#308) * Add Twitter and Readthedocs shields Signed-off-by: Pablo Garrido * Update Signed-off-by: Pablo Garrido * Fix Signed-off-by: Pablo Garrido (cherry picked from commit 8b78d229f9cfc98fc86fc25db6ce608dbab78ec5) Co-authored-by: Pablo Garrido --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index da8781ab..1ed80d72 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ [![Issues](https://img.shields.io/github/issues/eProsima/Micro-XRCE-DDS-Client.svg)](https://github.com/eProsima/Micro-XRCE-DDS-Client/issues) [![Forks](https://img.shields.io/github/forks/eProsima/Micro-XRCE-DDS-Client.svg)](https://github.com/eProsima/Micro-XRCE-DDS-Client/network/members) [![Stars](https://img.shields.io/github/stars/eProsima/Micro-XRCE-DDS-Client.svg)](https://github.com/eProsima/Micro-XRCE-DDS-Client/stargazers) +[![Read the Docs](https://img.shields.io/readthedocs/micro-xrce-dds?style=flat)](https://micro-xrce-dds.docs.eprosima.com/en/latest/) +[![Twitter Follow](https://img.shields.io/twitter/follow/eprosima?style=social)](https://twitter.com/EProsima) [![Docker Build Status](https://img.shields.io/docker/cloud/build/eprosima/micro-xrce-dds-client)](https://hub.docker.com/r/eprosima/micro-xrce-dds-client/) From 3d19dd547c663ede8bc732c6aef21c0bb1b4f036 Mon Sep 17 00:00:00 2001 From: Dwayne Williams Date: Wed, 22 Feb 2023 14:28:43 -0600 Subject: [PATCH 2/2] add pico sdk multi thread capability Signed-off-by: Dwayne Williams --- include/uxr/client/profile/multithread/multithread.h | 4 ++++ src/c/profile/multithread/multithread.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/include/uxr/client/profile/multithread/multithread.h b/include/uxr/client/profile/multithread/multithread.h index 189b4a7d..11a21a88 100644 --- a/include/uxr/client/profile/multithread/multithread.h +++ b/include/uxr/client/profile/multithread/multithread.h @@ -32,6 +32,8 @@ struct uxrSession; #elif defined(PLATFORM_NAME_FREERTOS) #include "FreeRTOS.h" #include "semphr.h" +#elif defined(PLATFORM_NAME_RPIPICO) +#include "pico/mutex.h" #elif defined(UCLIENT_PLATFORM_ZEPHYR) #elif defined(UCLIENT_PLATFORM_POSIX) #include @@ -45,6 +47,8 @@ typedef struct uxrMutex #elif defined(PLATFORM_NAME_FREERTOS) SemaphoreHandle_t impl; StaticSemaphore_t xMutexBuffer; +#elif defined(PLATFORM_NAME_RPIPICO) + recursive_mutex_t impl; #elif defined(UCLIENT_PLATFORM_ZEPHYR) struct k_mutex impl; #elif defined(UCLIENT_PLATFORM_POSIX) diff --git a/src/c/profile/multithread/multithread.c b/src/c/profile/multithread/multithread.c index 1a8b1d1c..ffb4d7ae 100644 --- a/src/c/profile/multithread/multithread.c +++ b/src/c/profile/multithread/multithread.c @@ -12,6 +12,8 @@ void uxr_init_lock( { #if defined(PLATFORM_NAME_FREERTOS) mutex->impl = xSemaphoreCreateRecursiveMutexStatic( &mutex->xMutexBuffer ); +#elif defined(PLATFORM_NAME_RPIPICO) + recursive_mutex_init(&mutex->impl); #elif defined(UCLIENT_PLATFORM_ZEPHYR) k_mutex_init(&mutex->impl); #elif defined(UCLIENT_PLATFORM_POSIX) @@ -29,6 +31,8 @@ void uxr_lock( { #if defined(PLATFORM_NAME_FREERTOS) xSemaphoreTakeRecursive(mutex->impl, portMAX_DELAY); +#elif defined(PLATFORM_NAME_RPIPICO) + recursive_mutex_enter_blocking(&mutex->impl); #elif defined(UCLIENT_PLATFORM_ZEPHYR) k_mutex_lock(&mutex->impl, K_FOREVER); #elif defined(UCLIENT_PLATFORM_POSIX) @@ -43,6 +47,8 @@ void uxr_unlock( { #if defined(PLATFORM_NAME_FREERTOS) xSemaphoreGiveRecursive(mutex->impl); +#elif defined(PLATFORM_NAME_RPIPICO) + recursive_mutex_exit(&mutex->impl); #elif defined(UCLIENT_PLATFORM_ZEPHYR) k_mutex_unlock(&mutex->impl); #elif defined(UCLIENT_PLATFORM_POSIX)