From 3365b9eed74a0b1e6374b6432367941578000dfa Mon Sep 17 00:00:00 2001 From: jusax23 Date: Sun, 10 Sep 2023 00:11:42 +0200 Subject: [PATCH] fixes --- library.properties | 2 +- src/JuSDK.h | 7 +++++++ src/esp32/esp32_queue.c | 2 +- src/esp32/esp32_queue.h | 2 ++ src/jmutex.h | 6 +----- 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 src/JuSDK.h diff --git a/library.properties b/library.properties index 689d954..9f17a4d 100644 --- a/library.properties +++ b/library.properties @@ -6,4 +6,4 @@ sentence=Arduino library for pico and esp32. paragraph=Add compatible Features. category= url=https://jusax.de/git/jusax23/JuSDK -architectures=esp32,pico +architectures=esp32,rp2040 diff --git a/src/JuSDK.h b/src/JuSDK.h new file mode 100644 index 0000000..e2f6d3c --- /dev/null +++ b/src/JuSDK.h @@ -0,0 +1,7 @@ +#ifndef _JU_SDK_H +#define _JU_SDK_H + +#include "jmutex.h" +#include "jqueue.h" + +#endif \ No newline at end of file diff --git a/src/esp32/esp32_queue.c b/src/esp32/esp32_queue.c index c05dd1f..a2324fe 100644 --- a/src/esp32/esp32_queue.c +++ b/src/esp32/esp32_queue.c @@ -1,5 +1,5 @@ -#ifdef defined(_POSIX_THREADS) +#if defined(_POSIX_THREADS) #include "esp32_queue.h" #include "Arduino.h" diff --git a/src/esp32/esp32_queue.h b/src/esp32/esp32_queue.h index 256fcde..5ab3825 100644 --- a/src/esp32/esp32_queue.h +++ b/src/esp32/esp32_queue.h @@ -7,6 +7,8 @@ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. * * SPDX-License-Identifier: BSD-3-Clause + * + * Modified to run on an esp32. */ #include "../jmutex.h" diff --git a/src/jmutex.h b/src/jmutex.h index 47fa164..f09f28a 100644 --- a/src/jmutex.h +++ b/src/jmutex.h @@ -4,15 +4,11 @@ #if defined(ARDUINO_ARCH_RP2040) #include "pico/mutex.h" -void test(){ - -} - #elif defined(ARDUINO_ARCH_ESP32) #include "pthread.h" -typedef pthread_mutex_t mutex_t +#define mutex_t pthread_mutex_t inline void mutex_init(mutex_t *mtx) { pthread_mutex_init(mtx, NULL); } inline void mutex_enter_blocking(mutex_t *mtx) { pthread_mutex_lock(mtx); }