mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
- WiFi Connect app is now hidden by default, but accessible at the bottom of the WiFi Manage app when WiFi is turned on. - WiFi service now turns on WiFi when calling connect() and WiFi is not on. - Removed `blocking` option for `service::loader::startApp()`. This feature was unused and complex. - Various apps: Moved private headers into Private/ folder. - Various apps: created start() function for easy starting. - Added documentation to all TactilityC APIs - Refactored various `enum` into `class enum` - Refactor M5Stack `initBoot()` (but VBus is still 0V for some reason)
45 lines
1.3 KiB
C++
45 lines
1.3 KiB
C++
#include "tt_message_queue.h"
|
|
#include <MessageQueue.h>
|
|
|
|
#define HANDLE_TO_MESSAGE_QUEUE(handle) ((tt::MessageQueue*)(handle))
|
|
|
|
extern "C" {
|
|
|
|
MessageQueueHandle tt_message_queue_alloc(uint32_t capacity, uint32_t messageSize) {
|
|
return new tt::MessageQueue(capacity, messageSize);
|
|
}
|
|
|
|
void tt_message_queue_free(MessageQueueHandle handle) {
|
|
delete HANDLE_TO_MESSAGE_QUEUE(handle);
|
|
}
|
|
|
|
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, TickType_t timeout) {
|
|
return HANDLE_TO_MESSAGE_QUEUE(handle)->get(message, timeout);
|
|
}
|
|
|
|
uint32_t tt_message_queue_get_capacity(MessageQueueHandle handle) {
|
|
return HANDLE_TO_MESSAGE_QUEUE(handle)->getCapacity();
|
|
}
|
|
|
|
uint32_t tt_message_queue_get_message_size(MessageQueueHandle handle) {
|
|
return HANDLE_TO_MESSAGE_QUEUE(handle)->getMessageSize();
|
|
}
|
|
|
|
uint32_t tt_message_queue_get_count(MessageQueueHandle handle) {
|
|
return HANDLE_TO_MESSAGE_QUEUE(handle)->getCount();
|
|
}
|
|
|
|
uint32_t tt_message_queue_get_space(MessageQueueHandle handle) {
|
|
return HANDLE_TO_MESSAGE_QUEUE(handle)->getSpace();
|
|
}
|
|
|
|
bool tt_message_queue_reset(MessageQueueHandle handle) {
|
|
return HANDLE_TO_MESSAGE_QUEUE(handle)->reset();
|
|
}
|
|
|
|
}
|