mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-10-23 12:42:25 +00:00
core: restore upstream shape for the shared mesh core
- Mesh, Dispatcher, Packet, packet pool and the core headers rebuilt from Arduino MeshCore's text; ZephCore changes re-applied, each fenced `// ZEPHCORE:` (diff vs upstream: 4540 -> 1147 lines) - upstream header layout; MainBoard gains handleCommand/loop and the other upstream members; RNG::nextInt back in Utils.cpp - packet logging moved to the roles' log hooks (helpers/PacketLog.h) - zero-hop direct ACKs deduplicated and length-checked as upstream - RadioIncludes.h -> src/, LoRaConfig.h -> helpers/ - .editorconfig: shared files keep upstream formatting Verified: 10 role builds, per-function disassembly review, bench DM/ACK regression (T1000-E, Wio L1, XIAO S3 on 1.17.4) incl. via live repeater.
This commit is contained in:
1 parent
2e2d852f29
commit
a7d073900e
44 files changed
+2551
-2488
No files matched your search
@@ -1,28 +1,24 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
* Static pool PacketManager
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <mesh/Dispatcher.h>
|
||||
|
||||
namespace mesh {
|
||||
// ZEPHCORE: the queues and the pool are static and live in the .cpp — no heap in
|
||||
// the packet path. Pool and queue sizes are compile-time (32 each).
|
||||
|
||||
class StaticPoolPacketManager : public PacketManager {
|
||||
class StaticPoolPacketManager : public mesh::PacketManager {
|
||||
public:
|
||||
Packet *allocNew() override;
|
||||
void free(Packet *packet) override;
|
||||
void queueOutbound(Packet *packet, uint8_t priority, uint32_t scheduled_for) override;
|
||||
Packet *getNextOutbound(uint32_t now) override;
|
||||
int getOutboundCount(uint32_t now) const override;
|
||||
int getOutboundTotal() const override;
|
||||
int getFreeCount() const override;
|
||||
Packet *getOutboundByIdx(int i) override;
|
||||
Packet *removeOutboundByIdx(int i) override;
|
||||
uint32_t getOutboundSchedule(int i) const override;
|
||||
bool rescheduleOutbound(int i, uint32_t new_scheduled_for) override;
|
||||
uint8_t peekNextOutboundPriority(uint32_t now) const override;
|
||||
};
|
||||
|
||||
} /* namespace mesh */
|
||||
mesh::Packet* allocNew() override;
|
||||
void free(mesh::Packet* packet) override;
|
||||
void queueOutbound(mesh::Packet* packet, uint8_t priority, uint32_t scheduled_for) override;
|
||||
mesh::Packet* getNextOutbound(uint32_t now) override;
|
||||
int getOutboundCount(uint32_t now) const override;
|
||||
int getOutboundTotal() const override;
|
||||
int getFreeCount() const override;
|
||||
mesh::Packet* getOutboundByIdx(int i) override;
|
||||
mesh::Packet* removeOutboundByIdx(int i) override;
|
||||
// ZEPHCORE: no inbound queue (see mesh::PacketManager); schedule access instead.
|
||||
uint32_t getOutboundSchedule(int i) const override;
|
||||
bool rescheduleOutbound(int i, uint32_t new_scheduled_for) override;
|
||||
uint8_t peekNextOutboundPriority(uint32_t now) const override;
|
||||
};
|
||||
Reference in new issue
Block a user