17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-28 23:57:28 +01:00

hardware protocol v2: configuration, wiring and debug panel

Adds the WITH_HARDWARE_PROTOCOL_V2 build option and the eu07.ini entries
which configure it: uart2 declares a serial link and may be repeated for
several controllers, the remaining uart2* entries tune frame size,
heartbeat, rate limits and logging. UART v1 is untouched and both may be
active at the same time on different ports.

The driver mode starts the manager when at least one link is configured
and pumps it from the input polling loop, and the debug panel gains a
Hardware Protocol v2 section reporting link and session condition,
packet rates, round trip time, protocol and transport error counters and
whatever diagnostics the device itself reports, with switches for
protocol and frame logging.
This commit is contained in:
2026-09-05 20:35:04 +00:00
parent 4e3afdd2a6
commit 91be90548f
11 changed files with 269 additions and 9 deletions

View File

@@ -82,8 +82,8 @@ public:
explicit hardware_manager( config const &Config );
~hardware_manager();
// called once per simulation frame from the input polling code
void update( double const Deltatime );
// called once per simulation frame from the input polling code; the time step is measured here
void update();
std::vector<link_report> const &reports() const { return m_reports; }
bool active() const { return false == m_links.empty(); }
@@ -102,6 +102,8 @@ private:
std::vector<std::unique_ptr<hardware_link>> m_links;
std::vector<link_report> m_reports;
state_snapshot m_snapshot;
std::chrono::steady_clock::time_point m_lastupdate;
bool m_updatestarted = false;
std::thread m_thread;
std::atomic<bool> m_quit { false };
};