Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Devices/cyd-2432s024c/Source/devices/SdCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define TAG "twodotfour_sdcard"

#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/RecursiveMutex.h>

constexpr auto SDCARD_SPI_HOST = SPI3_HOST;
constexpr auto SDCARD_PIN_CS = GPIO_NUM_5;
Expand All @@ -16,7 +17,7 @@ std::shared_ptr<SdCardDevice> createSdCard() {
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive),
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SDCARD_SPI_HOST
);
Expand Down
3 changes: 2 additions & 1 deletion Devices/cyd-2432s028r/Source/devices/SdCard.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "SdCard.h"
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/RecursiveMutex.h>

using tt::hal::sdcard::SpiSdCardDevice;

Expand All @@ -11,7 +12,7 @@ std::shared_ptr<SdCardDevice> createSdCard() {
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive),
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SPI3_HOST
);
Expand Down
3 changes: 2 additions & 1 deletion Devices/cyd-2432s028rv3/Source/devices/SdCard.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "SdCard.h"
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/RecursiveMutex.h>

using tt::hal::sdcard::SpiSdCardDevice;

Expand All @@ -11,7 +12,7 @@ std::shared_ptr<SdCardDevice> createSdCard() {
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive),
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SPI3_HOST
);
Expand Down
3 changes: 2 additions & 1 deletion Devices/cyd-2432s032c/Source/devices/SdCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/RecursiveMutex.h>

constexpr auto SDCARD_SPI_HOST = SPI3_HOST;
constexpr auto SDCARD_PIN_CS = GPIO_NUM_5;
Expand All @@ -15,7 +16,7 @@ std::shared_ptr<SdCardDevice> createSdCard() {
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive),
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SDCARD_SPI_HOST
);
Expand Down
4 changes: 2 additions & 2 deletions Devices/cyd-4848s040c/Source/devices/St7701Display.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <Tactility/Mutex.h>
#include <Tactility/RecursiveMutex.h>

#include <EspLcdDisplay.h>
#include <lvgl.h>
Expand All @@ -21,7 +21,7 @@ class St7701Display final : public EspLcdDisplay {

public:

St7701Display() : EspLcdDisplay(std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive)) {}
St7701Display() : EspLcdDisplay(std::make_shared<tt::RecursiveMutex>()) {}

std::string getName() const override { return "ST7701S"; }

Expand Down
3 changes: 2 additions & 1 deletion Devices/cyd-e32r28t/Source/devices/SdCard.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "SdCard.h"
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/RecursiveMutex.h>

using tt::hal::sdcard::SpiSdCardDevice;

Expand All @@ -10,7 +11,7 @@ std::shared_ptr<SdCardDevice> createSdCard() {
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive),
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SPI3_HOST
);
Expand Down
3 changes: 2 additions & 1 deletion Devices/cyd-e32r32p/Source/devices/SdCard.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "SdCard.h"
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/RecursiveMutex.h>

using tt::hal::sdcard::SpiSdCardDevice;
using SdCardDevice = tt::hal::sdcard::SdCardDevice;
Expand All @@ -11,7 +12,7 @@ std::shared_ptr<SdCardDevice> createSdCard() {
GPIO_NUM_NC, // MISO override: leave NC
GPIO_NUM_NC, // SCLK override: leave NC
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive),
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SD_SPI_HOST // SPI host for SD card (SPI3_HOST)
);
Expand Down
3 changes: 2 additions & 1 deletion Devices/cyd-jc2432w328c/Source/devices/SdCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/RecursiveMutex.h>

constexpr auto SDCARD_SPI_HOST = SPI3_HOST;
constexpr auto SDCARD_PIN_CS = GPIO_NUM_5;
Expand All @@ -15,7 +16,7 @@ std::shared_ptr<SdCardDevice> createSdCard() {
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive),
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SDCARD_SPI_HOST
);
Expand Down
3 changes: 2 additions & 1 deletion Devices/cyd-jc8048w550c/Source/devices/SdCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/RecursiveMutex.h>

using tt::hal::sdcard::SpiSdCardDevice;

Expand All @@ -12,7 +13,7 @@ std::shared_ptr<SdCardDevice> createSdCard() {
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive),
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SPI2_HOST
);
Expand Down
6 changes: 3 additions & 3 deletions Devices/simulator/Source/LvglTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

#include <Tactility/Log.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/Mutex.h>
#include <Tactility/RecursiveMutex.h>
#include <Tactility/Thread.h>

#include <lvgl.h>

#define TAG "lvgl_task"

// Mutex for LVGL drawing
static tt::Mutex lvgl_mutex(tt::Mutex::Type::Recursive);
static tt::Mutex task_mutex(tt::Mutex::Type::Recursive);
static tt::RecursiveMutex lvgl_mutex;
static tt::RecursiveMutex task_mutex;

static uint32_t task_max_sleep_ms = 10;
// Mutex for LVGL task state (to modify task_running state)
Expand Down
4 changes: 2 additions & 2 deletions Devices/simulator/Source/hal/SimulatorSdCard.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "Tactility/hal/sdcard/SdCardDevice.h"
#include <Tactility/Mutex.h>
#include <Tactility/RecursiveMutex.h>
#include <memory>

using tt::hal::sdcard::SdCardDevice;
Expand All @@ -16,7 +16,7 @@ class SimulatorSdCard final : public SdCardDevice {

SimulatorSdCard() : SdCardDevice(MountBehaviour::AtBoot),
state(State::Unmounted),
lock(std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive))
lock(std::make_shared<tt::RecursiveMutex>())
{}

std::string getName() const override { return "Mock SD Card"; }
Expand Down
3 changes: 2 additions & 1 deletion Devices/waveshare-s3-lcd-13/Source/devices/SdCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/RecursiveMutex.h>

using tt::hal::sdcard::SpiSdCardDevice;

Expand All @@ -12,7 +13,7 @@ std::shared_ptr<SdCardDevice> createSdCard() {
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive),
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SPI3_HOST
);
Expand Down
3 changes: 2 additions & 1 deletion Devices/waveshare-s3-touch-lcd-128/Source/devices/SdCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/RecursiveMutex.h>

using tt::hal::sdcard::SpiSdCardDevice;

Expand All @@ -12,7 +13,7 @@ std::shared_ptr<SdCardDevice> createSdCard() {
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCardDevice::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive),
std::make_shared<tt::RecursiveMutex>(),
std::vector<gpio_num_t>(),
SPI3_HOST
);
Expand Down
3 changes: 2 additions & 1 deletion Drivers/RgbDisplay/Source/RgbDisplay.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#pragma once

#include <Tactility/hal/display/DisplayDevice.h>
#include <Tactility/RecursiveMutex.h>
#include <EspLcdDisplayDriver.h>
#include <esp_lcd_panel_rgb.h>
#include <esp_lvgl_port_disp.h>

class RgbDisplay final : public tt::hal::display::DisplayDevice {

std::shared_ptr<tt::Lock> lock = std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive);
std::shared_ptr<tt::Lock> lock = std::make_shared<tt::RecursiveMutex>();

public:

Expand Down
4 changes: 2 additions & 2 deletions Tactility/Include/Tactility/hal/gps/GpsDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "GpsConfiguration.h"
#include "Satellites.h"

#include <Tactility/Mutex.h>
#include <Tactility/RecursiveMutex.h>
#include <Tactility/Thread.h>

#include <minmea.h>
Expand Down Expand Up @@ -47,7 +47,7 @@ class GpsDevice : public Device {
};

const GpsConfiguration configuration;
Mutex mutex = Mutex(Mutex::Type::Recursive);
RecursiveMutex mutex;
std::unique_ptr<Thread> _Nullable thread;
bool threadInterrupted = false;
std::vector<GgaSubscription> ggaSubscriptions;
Expand Down
4 changes: 2 additions & 2 deletions Tactility/Include/Tactility/hal/gps/Satellites.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <Tactility/RtosCompat.h>
#include <Tactility/Mutex.h>
#include <Tactility/RecursiveMutex.h>

#include <minmea.h>

Expand Down Expand Up @@ -30,7 +30,7 @@ class SatelliteStorage {
bool inUse = false;
};

Mutex mutex = Mutex(Mutex::Type::Recursive);
RecursiveMutex mutex;
std::array<SatelliteRecord, recordCount> records;
uint16_t recycleTimeSeconds;
uint16_t recentTimeSeconds;
Expand Down
9 changes: 4 additions & 5 deletions Tactility/Include/Tactility/hal/sdcard/SdmmcDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

#include "SdCardDevice.h"

#include <Tactility/RecursiveMutex.h>
#include <Tactility/hal/Device.h>
#include <Tactility/hal/spi/Spi.h>

#include <sd_protocol_types.h>
#include <soc/gpio_num.h>
#include <utility>
#include <vector>
#include <Tactility/hal/Device.h>
#include <hal/spi_types.h>
#include <soc/gpio_num.h>

namespace tt::hal::sdcard {

Expand All @@ -20,7 +19,7 @@ namespace tt::hal::sdcard {
*/
class SdmmcDevice final : public SdCardDevice {

std::shared_ptr<Mutex> mutex = std::make_shared<Mutex>(Mutex::Type::Recursive);
std::shared_ptr<RecursiveMutex> mutex = std::make_shared<RecursiveMutex>();

public:

Expand Down
4 changes: 2 additions & 2 deletions Tactility/Include/Tactility/network/HttpServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifdef ESP_PLATFORM

#include <esp_http_server.h>
#include <Tactility/Mutex.h>
#include <Tactility/RecursiveMutex.h>
#include <Tactility/kernel/SystemEvents.h>

namespace tt::network {
Expand Down Expand Up @@ -33,7 +33,7 @@ class HttpServer {

std::vector<httpd_uri_t> handlers;

Mutex mutex = Mutex(Mutex::Type::Recursive);
RecursiveMutex mutex;
httpd_handle_t server = nullptr;

bool startInternal();
Expand Down
3 changes: 2 additions & 1 deletion Tactility/Include/Tactility/service/gps/GpsService.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "Tactility/Mutex.h"
#include "Tactility/RecursiveMutex.h"
#include "Tactility/PubSub.h"
#include "Tactility/hal/gps/GpsDevice.h"
#include "Tactility/service/Service.h"
Expand All @@ -20,7 +21,7 @@ class GpsService final : public Service {
minmea_sentence_rmc rmcRecord;
TickType_t rmcTime = 0;

Mutex mutex = Mutex(Mutex::Type::Recursive);
RecursiveMutex mutex;
Mutex stateMutex;
std::vector<GpsDeviceRecord> deviceRecords;
std::shared_ptr<PubSub<State>> statePubSub = std::make_shared<PubSub<State>>();
Expand Down
3 changes: 2 additions & 1 deletion Tactility/Include/Tactility/service/loader/Loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <Tactility/Bundle.h>
#include <Tactility/DispatcherThread.h>
#include <Tactility/PubSub.h>
#include <Tactility/RecursiveMutex.h>
#include <Tactility/service/Service.h>

#include <memory>
Expand All @@ -26,7 +27,7 @@ class LoaderService final : public Service {
private:

std::shared_ptr<PubSub<Event>> pubsubExternal = std::make_shared<PubSub<Event>>();
Mutex mutex = Mutex(Mutex::Type::Recursive);
RecursiveMutex mutex;
std::vector<std::shared_ptr<app::AppInstance>> appStack;
app::LaunchId nextLaunchId = 0;

Expand Down
2 changes: 1 addition & 1 deletion Tactility/Private/Tactility/app/AppInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum class State {
*/
class AppInstance : public AppContext {

Mutex mutex = Mutex(Mutex::Type::Normal);
Mutex mutex;
const std::shared_ptr<AppManifest> manifest;
State state = State::Initial;
LaunchId launchId;
Expand Down
4 changes: 2 additions & 2 deletions Tactility/Private/Tactility/app/files/State.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <Tactility/Mutex.h>
#include <Tactility/RecursiveMutex.h>

#include <string>
#include <vector>
Expand All @@ -20,7 +20,7 @@ class State final {

private:

Mutex mutex = Mutex(Mutex::Type::Recursive);
RecursiveMutex mutex;
std::vector<dirent> dir_entries;
std::string current_path;
std::string selected_child_entry;
Expand Down
4 changes: 2 additions & 2 deletions Tactility/Private/Tactility/app/fileselection/State.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <Tactility/Mutex.h>
#include <Tactility/RecursiveMutex.h>

#include <string>
#include <vector>
Expand All @@ -10,7 +10,7 @@ namespace tt::app::fileselection {

class State final {

Mutex mutex = Mutex(Mutex::Type::Recursive);
RecursiveMutex mutex;
std::vector<dirent> dir_entries;
std::string current_path;
std::string selected_child_entry;
Expand Down
Loading