SDK improvements (#352)

TactilityC additions for:
- C randomization functions
- Tactility app paths
- Tactility locks
This commit is contained in:
Ken Van Hoeylandt
2025-09-29 22:45:14 +02:00
committed by GitHub
parent 6dc4f698c9
commit c7621b5e4c
13 changed files with 204 additions and 18 deletions
+5 -5
View File
@@ -5,11 +5,11 @@ extern "C" {
#define HANDLE_AS_MUTEX(handle) ((tt::Mutex*)(handle))
MutexHandle tt_mutex_alloc(enum TtMutexType type) {
MutexHandle tt_mutex_alloc(TtMutexType type) {
switch (type) {
case TtMutexType::MUTEX_TYPE_NORMAL:
case MUTEX_TYPE_NORMAL:
return new tt::Mutex(tt::Mutex::Type::Normal);
case TtMutexType::MUTEX_TYPE_RECURSIVE:
case MUTEX_TYPE_RECURSIVE:
return new tt::Mutex(tt::Mutex::Type::Recursive);
default:
tt_crash("Type not supported");
@@ -20,8 +20,8 @@ void tt_mutex_free(MutexHandle handle) {
delete HANDLE_AS_MUTEX(handle);
}
bool tt_mutex_lock(MutexHandle handle, TickType_t timeout) {
return HANDLE_AS_MUTEX(handle)->lock((TickType_t)timeout);
bool tt_mutex_lock(MutexHandle handle, TickType timeout) {
return HANDLE_AS_MUTEX(handle)->lock(timeout);
}
bool tt_mutex_unlock(MutexHandle handle) {