mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-21 07:55:06 +00:00
Cleanup/improvements
This commit is contained in:
parent
1aa5daf1b0
commit
601b7733d4
@ -13,9 +13,7 @@ namespace tt {
|
||||
/**
|
||||
* A dictionary that maps keys (strings) onto several atomary types.
|
||||
*/
|
||||
class Bundle {
|
||||
|
||||
private:
|
||||
class Bundle final {
|
||||
|
||||
typedef uint32_t Hash;
|
||||
|
||||
|
||||
@ -19,7 +19,8 @@ namespace tt {
|
||||
* Generally, one task would dispatch the execution,
|
||||
* while the other thread consumes and executes the work.
|
||||
*/
|
||||
class Dispatcher {
|
||||
class Dispatcher final {
|
||||
|
||||
public:
|
||||
|
||||
typedef std::function<void()> Function;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
namespace tt {
|
||||
|
||||
/** Starts a Thread to process dispatched messages */
|
||||
class DispatcherThread {
|
||||
class DispatcherThread final {
|
||||
|
||||
Dispatcher dispatcher;
|
||||
std::unique_ptr<Thread> thread;
|
||||
|
||||
@ -8,8 +8,7 @@ namespace tt {
|
||||
/**
|
||||
* Wrapper for FreeRTOS xEventGroup.
|
||||
*/
|
||||
class EventFlag {
|
||||
private:
|
||||
class EventFlag final {
|
||||
|
||||
struct EventGroupHandleDeleter {
|
||||
void operator()(EventGroupHandle_t handleToDelete) {
|
||||
|
||||
@ -7,7 +7,7 @@ namespace tt {
|
||||
|
||||
/** Publish and subscribe to messages in a thread-safe manner. */
|
||||
template<typename DataType>
|
||||
class PubSub {
|
||||
class PubSub final {
|
||||
|
||||
struct Subscription {
|
||||
uint64_t id;
|
||||
|
||||
@ -21,8 +21,6 @@ namespace tt {
|
||||
*/
|
||||
class Semaphore final : public Lock {
|
||||
|
||||
private:
|
||||
|
||||
struct SemaphoreHandleDeleter {
|
||||
void operator()(QueueHandle_t handleToDelete) {
|
||||
assert(!kernel::isIsr());
|
||||
|
||||
@ -22,9 +22,7 @@ namespace tt {
|
||||
* interrupt that will write to the buffer (the writer), and only one task or
|
||||
* interrupt that will read from the buffer (the reader).
|
||||
*/
|
||||
class StreamBuffer {
|
||||
|
||||
private:
|
||||
class StreamBuffer final {
|
||||
|
||||
struct StreamBufferHandleDeleter {
|
||||
void operator()(StreamBufferHandle_t handleToDelete) {
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreDefines.h"
|
||||
#include "RtosCompatTask.h"
|
||||
|
||||
#include <functional>
|
||||
@ -11,7 +10,7 @@ namespace tt {
|
||||
|
||||
typedef TaskHandle_t ThreadId;
|
||||
|
||||
class Thread {
|
||||
class Thread final {
|
||||
|
||||
public:
|
||||
|
||||
@ -184,8 +183,8 @@ public:
|
||||
static uint32_t awaitFlags(uint32_t flags, uint32_t options, uint32_t timeout);
|
||||
};
|
||||
|
||||
#define THREAD_PRIORITY_SERVICE Thread::Priority::High
|
||||
#define THREAD_PRIORITY_RENDER Thread::Priority::Higher
|
||||
#define THREAD_PRIORITY_ISR Thread::Priority::Critical
|
||||
constexpr auto THREAD_PRIORITY_SERVICE = Thread::Priority::High;
|
||||
constexpr auto THREAD_PRIORITY_RENDER = Thread::Priority::Higher;
|
||||
constexpr auto THREAD_PRIORITY_ISR = Thread::Priority::Critical;
|
||||
|
||||
} // namespace
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
namespace tt {
|
||||
|
||||
inline static StreamBufferHandle_t createStreamBuffer(size_t size, size_t triggerLevel) {
|
||||
static StreamBufferHandle_t createStreamBuffer(size_t size, size_t triggerLevel) {
|
||||
assert(size != 0);
|
||||
return xStreamBufferCreate(size, triggerLevel);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user