UART refactored (#236)

`Uart` is now an abstract class with a `UartEsp` and a `UartPosix` implementation.
This commit is contained in:
Ken Van Hoeylandt
2025-02-26 17:13:37 +01:00
committed by GitHub
parent de46401d85
commit b85ef7a2e7
22 changed files with 867 additions and 592 deletions
@@ -1,7 +1,6 @@
#pragma once
#include "../Device.h"
#include "../uart/Uart.h"
#include "Satellites.h"
#include <Tactility/Mutex.h>
@@ -12,7 +11,6 @@
namespace tt::hal::gps {
enum class GpsResponse {
None,
NotAck,
@@ -24,7 +22,7 @@ enum class GpsModel {
Unknown = 0,
AG3335,
AG3352,
ATGM336H,
ATGM336H, // Casic (might work with AT6558, Neoway N58 LTE Cat.1, Neoway G2, Neoway G7A)
LS20031,
MTK,
MTK_L76B,
@@ -48,7 +46,7 @@ public:
struct Configuration {
std::string name;
uart_port_t uartPort;
std::string uartName; // e.g. "Internal" or "/dev/ttyUSB0"
uint32_t baudRate;
GpsModel model;
};
@@ -75,7 +73,7 @@ private:
const Configuration configuration;
Mutex mutex = Mutex(Mutex::Type::Recursive);
std::unique_ptr<Thread> thread;
std::unique_ptr<Thread> _Nullable thread;
bool threadInterrupted = false;
std::vector<GgaSubscription> ggaSubscriptions;
std::vector<RmcSubscription> rmcSubscriptions;