Update docs and fix bugs (#149)
Improved the docs for the 3 main Tactility projects. I also fixed some inaccuracies and bugs in certain APIs as I went through the code.
This commit is contained in:
committed by
GitHub
parent
ff4287e2ce
commit
415096c3b2
@@ -13,11 +13,11 @@ void tt_message_queue_free(MessageQueueHandle handle) {
|
||||
delete HANDLE_TO_MESSAGE_QUEUE(handle);
|
||||
}
|
||||
|
||||
bool tt_message_queue_put(MessageQueueHandle handle, const void* message, uint32_t timeout) {
|
||||
bool tt_message_queue_put(MessageQueueHandle handle, const void* message, TickType_t timeout) {
|
||||
return HANDLE_TO_MESSAGE_QUEUE(handle)->put(message, timeout);
|
||||
}
|
||||
|
||||
bool tt_message_queue_get(MessageQueueHandle handle, void* message, uint32_t timeout) {
|
||||
bool tt_message_queue_get(MessageQueueHandle handle, void* message, TickType_t timeout) {
|
||||
return HANDLE_TO_MESSAGE_QUEUE(handle)->get(message, timeout);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -11,8 +13,8 @@ typedef void* MessageQueueHandle;
|
||||
|
||||
MessageQueueHandle tt_message_queue_alloc(uint32_t capacity, uint32_t messageSize);
|
||||
void tt_message_queue_free(MessageQueueHandle handle);
|
||||
bool tt_message_queue_put(MessageQueueHandle handle, const void* message, uint32_t timeout);
|
||||
bool tt_message_queue_get(MessageQueueHandle handle, void* message, uint32_t timeout);
|
||||
bool tt_message_queue_put(MessageQueueHandle handle, const void* message, TickType_t timeout);
|
||||
bool tt_message_queue_get(MessageQueueHandle handle, void* message, TickType_t timeout);
|
||||
uint32_t tt_message_queue_get_capacity(MessageQueueHandle handle);
|
||||
uint32_t tt_message_queue_get_message_size(MessageQueueHandle handle);
|
||||
uint32_t tt_message_queue_get_count(MessageQueueHandle handle);
|
||||
|
||||
@@ -20,8 +20,8 @@ void tt_mutex_free(MutexHandle handle) {
|
||||
delete HANDLE_AS_MUTEX(handle);
|
||||
}
|
||||
|
||||
bool tt_mutex_lock(MutexHandle handle, uint32_t timeoutTicks) {
|
||||
return HANDLE_AS_MUTEX(handle)->lock(timeoutTicks);
|
||||
bool tt_mutex_lock(MutexHandle handle, TickType_t timeout) {
|
||||
return HANDLE_AS_MUTEX(handle)->lock((TickType_t)timeout);
|
||||
}
|
||||
|
||||
bool tt_mutex_unlock(MutexHandle handle) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -16,7 +18,7 @@ enum TtMutexType {
|
||||
|
||||
MutexHandle tt_mutex_alloc(enum TtMutexType);
|
||||
void tt_mutex_free(MutexHandle handle);
|
||||
bool tt_mutex_lock(MutexHandle handle, uint32_t timeoutTicks);
|
||||
bool tt_mutex_lock(MutexHandle handle, TickType_t timeoutTicks);
|
||||
bool tt_mutex_unlock(MutexHandle handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -5,7 +5,7 @@ extern "C" {
|
||||
|
||||
#define HANDLE_AS_SEMAPHORE(handle) ((tt::Semaphore*)(handle))
|
||||
|
||||
SemaphoreHandle tt_semaphore_alloc(uint32_t maxCount, uint32_t initialCount) {
|
||||
SemaphoreHandle tt_semaphore_alloc(uint32_t maxCount, TickType_t initialCount) {
|
||||
return new tt::Semaphore(maxCount, initialCount);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ void tt_semaphore_free(SemaphoreHandle handle) {
|
||||
delete HANDLE_AS_SEMAPHORE(handle);
|
||||
}
|
||||
|
||||
bool tt_semaphore_acquire(SemaphoreHandle handle, uint32_t timeoutTicks) {
|
||||
bool tt_semaphore_acquire(SemaphoreHandle handle, TickType_t timeoutTicks) {
|
||||
return HANDLE_AS_SEMAPHORE(handle)->acquire(timeoutTicks);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -9,9 +11,9 @@ extern "C" {
|
||||
|
||||
typedef void* SemaphoreHandle;
|
||||
|
||||
SemaphoreHandle tt_semaphore_alloc(uint32_t maxCount, uint32_t initialCount);
|
||||
SemaphoreHandle tt_semaphore_alloc(uint32_t maxCount, TickType_t initialCount);
|
||||
void tt_semaphore_free(SemaphoreHandle handle);
|
||||
bool tt_semaphore_acquire(SemaphoreHandle handle, uint32_t timeoutTicks);
|
||||
bool tt_semaphore_acquire(SemaphoreHandle handle, TickType_t timeoutTicks);
|
||||
bool tt_semaphore_release(SemaphoreHandle handle);
|
||||
uint32_t tt_semaphore_get_count(SemaphoreHandle handle);
|
||||
|
||||
|
||||
@@ -29,11 +29,11 @@ void tt_timer_free(TimerHandle handle) {
|
||||
delete wrapper;
|
||||
}
|
||||
|
||||
bool tt_timer_start(TimerHandle handle, uint32_t intervalTicks) {
|
||||
bool tt_timer_start(TimerHandle handle, TickType_t intervalTicks) {
|
||||
return ((TimerWrapper*)handle)->timer->start(intervalTicks);
|
||||
}
|
||||
|
||||
bool tt_timer_restart(TimerHandle handle, uint32_t intervalTicks) {
|
||||
bool tt_timer_restart(TimerHandle handle, TickType_t intervalTicks) {
|
||||
return ((TimerWrapper*)handle)->timer->restart(intervalTicks);
|
||||
}
|
||||
|
||||
@@ -49,11 +49,12 @@ uint32_t tt_timer_get_expire_time(TimerHandle handle) {
|
||||
return ((TimerWrapper*)handle)->timer->getExpireTime();
|
||||
}
|
||||
|
||||
bool tt_timer_set_pending_callback(TimerHandle handle, TimerPendingCallback callback, void* callbackContext, uint32_t arg) {
|
||||
bool tt_timer_set_pending_callback(TimerHandle handle, TimerPendingCallback callback, void* callbackContext, uint32_t callbackArg, TickType_t timeoutTicks) {
|
||||
return ((TimerWrapper*)handle)->timer->setPendingCallback(
|
||||
callback,
|
||||
callbackContext,
|
||||
arg
|
||||
callbackArg,
|
||||
(TickType_t)timeoutTicks
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -24,12 +26,12 @@ typedef void (*TimerPendingCallback)(void* context, uint32_t arg);
|
||||
|
||||
TimerHandle tt_timer_alloc(TimerType type, TimerCallback callback, void* callbackContext);
|
||||
void tt_timer_free(TimerHandle handle);
|
||||
bool tt_timer_start(TimerHandle handle, uint32_t intervalTicks);
|
||||
bool tt_timer_restart(TimerHandle handle, uint32_t intervalTicks);
|
||||
bool tt_timer_start(TimerHandle handle, TickType_t intervalTicks);
|
||||
bool tt_timer_restart(TimerHandle handle, TickType_t intervalTicks);
|
||||
bool tt_timer_stop(TimerHandle handle);
|
||||
bool tt_timer_is_running(TimerHandle handle);
|
||||
uint32_t tt_timer_get_expire_time(TimerHandle handle);
|
||||
bool tt_timer_set_pending_callback(TimerHandle handle, TimerPendingCallback callback, void* callbackContext, uint32_t arg);
|
||||
bool tt_timer_set_pending_callback(TimerHandle handle, TimerPendingCallback callback, void* callbackContext, uint32_t callbackArg, TickType_t timeoutTicks);
|
||||
void tt_timer_set_thread_priority(TimerHandle handle, TimerThreadPriority priority);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user