Merge develop into main (#365)

### TactilityC
- Create UART HAL
- Refactor locking APIs
- Bind new C++ functionality
- Bind new LVGL functionality

### Apps
- Remove Serial Console as it has been ported as an external app
This commit is contained in:
Ken Van Hoeylandt
2025-10-08 23:16:45 +02:00
committed by GitHub
parent 17b4fc6a47
commit d25603166a
26 changed files with 391 additions and 702 deletions
+27 -5
View File
@@ -1,20 +1,42 @@
#include <tt_lock.h>
#include <tt_lock_private.h>
#include <Tactility/Mutex.h>
#include <Tactility/file/File.h>
#define HANDLE_AS_LOCK(handle) (static_cast<LockHolder*>(handle)->lock)
extern "C" {
LockHandle tt_lock_alloc_mutex(TtMutexType type) {
auto* lock_holder = new LockHolder();
switch (type) {
case MutexTypeNormal:
lock_holder->lock = std::make_shared<tt::Mutex>(tt::Mutex::Type::Normal);
break;
case MutexTypeRecursive:
lock_holder->lock = std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive);
break;
default:
tt_crash("Type not supported");
}
return lock_holder;
}
LockHandle tt_lock_alloc_for_path(const char* path) {
const auto lock = tt::file::getLock(path);
return new LockHolder(lock);
}
bool tt_lock_acquire(LockHandle handle, TickType timeout) {
auto holder = static_cast<LockHolder*>(handle);
return holder->lock->lock(timeout);
return HANDLE_AS_LOCK(handle)->lock(timeout);
}
bool tt_lock_release(LockHandle handle) {
auto holder = static_cast<LockHolder*>(handle);
return holder->lock->unlock();
return HANDLE_AS_LOCK(handle)->unlock();
}
void tt_lock_free(LockHandle handle) {
auto holder = static_cast<LockHolder*>(handle);
const auto holder = static_cast<LockHolder*>(handle);
delete holder;
}