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
@@ -3,10 +3,10 @@
|
||||
|
||||
namespace tt::lvgl {
|
||||
|
||||
Mutex lockMutex;
|
||||
static Mutex lockMutex;
|
||||
|
||||
static bool defaultLock(uint32_t timeoutTicks) {
|
||||
return lockMutex.acquire(timeoutTicks) == TtStatusOk;
|
||||
static bool defaultLock(uint32_t timeoutMillis) {
|
||||
return lockMutex.acquire(timeoutMillis) == TtStatusOk;
|
||||
}
|
||||
|
||||
static void defaultUnlock() {
|
||||
@@ -21,8 +21,8 @@ void syncSet(LvglLock lock, LvglUnlock unlock) {
|
||||
unlock_singleton = unlock;
|
||||
}
|
||||
|
||||
bool lock(uint32_t timeout_ticks) {
|
||||
return lock_singleton(timeout_ticks);
|
||||
bool lock(TickType_t timeout) {
|
||||
return lock_singleton(pdMS_TO_TICKS(timeout == 0 ? portMAX_DELAY : timeout));
|
||||
}
|
||||
|
||||
void unlock() {
|
||||
@@ -33,7 +33,7 @@ class LvglSync : public Lockable {
|
||||
public:
|
||||
~LvglSync() override = default;
|
||||
|
||||
bool lock(uint32_t timeoutTicks) const override {
|
||||
bool lock(TickType_t timeoutTicks) const override {
|
||||
return tt::lvgl::lock(timeoutTicks);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,12 +6,23 @@
|
||||
|
||||
namespace tt::lvgl {
|
||||
|
||||
typedef bool (*LvglLock)(uint32_t timeout_ticks);
|
||||
/**
|
||||
* LVGL locking function
|
||||
* @param[in] timeoutMillis timeout in milliseconds. waits forever when 0 is passed.
|
||||
* @warning this works with milliseconds, as opposed to every other FreeRTOS function that works in ticks!
|
||||
* @warning when passing zero, we wait forever, as this is the default behaviour for esp_lvgl_port, and we want it to remain consistent
|
||||
*/
|
||||
typedef bool (*LvglLock)(uint32_t timeoutMillis);
|
||||
typedef void (*LvglUnlock)();
|
||||
|
||||
void syncSet(LvglLock lock, LvglUnlock unlock);
|
||||
bool isSyncSet();
|
||||
bool lock(uint32_t timeout_ticks);
|
||||
|
||||
/**
|
||||
* LVGL locking function
|
||||
* @param[in] timeout as ticks
|
||||
* @warning when passing zero, we wait forever, as this is the default behaviour for esp_lvgl_port, and we want it to remain consistent
|
||||
*/
|
||||
bool lock(TickType_t timeout);
|
||||
void unlock();
|
||||
|
||||
std::shared_ptr<Lockable> getLvglSyncLockable();
|
||||
|
||||
Reference in New Issue
Block a user