mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 02:02:23 +00:00
This reverts commit 987623567a.
This commit is contained in:
@@ -64,10 +64,6 @@ Router::Router() : concurrency::OSThread("Router"), fromRadioQueue(MAX_RX_FROMRA
|
|||||||
*/
|
*/
|
||||||
int32_t Router::runOnce()
|
int32_t Router::runOnce()
|
||||||
{
|
{
|
||||||
#ifdef ARCH_PORTDUINO
|
|
||||||
const std::lock_guard<std::mutex> lock(queueMutex);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
meshtastic_MeshPacket *mp;
|
meshtastic_MeshPacket *mp;
|
||||||
while ((mp = fromRadioQueue.dequeuePtr(0)) != NULL) {
|
while ((mp = fromRadioQueue.dequeuePtr(0)) != NULL) {
|
||||||
// printPacket("handle fromRadioQ", mp);
|
// printPacket("handle fromRadioQ", mp);
|
||||||
@@ -84,10 +80,6 @@ int32_t Router::runOnce()
|
|||||||
*/
|
*/
|
||||||
void Router::enqueueReceivedMessage(meshtastic_MeshPacket *p)
|
void Router::enqueueReceivedMessage(meshtastic_MeshPacket *p)
|
||||||
{
|
{
|
||||||
#ifdef ARCH_PORTDUINO
|
|
||||||
const std::lock_guard<std::mutex> lock(queueMutex);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Try enqueue until successful
|
// Try enqueue until successful
|
||||||
while (!fromRadioQueue.enqueue(p, 0)) {
|
while (!fromRadioQueue.enqueue(p, 0)) {
|
||||||
meshtastic_MeshPacket *old_p;
|
meshtastic_MeshPacket *old_p;
|
||||||
|
|||||||
@@ -8,9 +8,6 @@
|
|||||||
#include "PointerQueue.h"
|
#include "PointerQueue.h"
|
||||||
#include "RadioInterface.h"
|
#include "RadioInterface.h"
|
||||||
#include "concurrency/OSThread.h"
|
#include "concurrency/OSThread.h"
|
||||||
#ifdef ARCH_PORTDUINO
|
|
||||||
#include <mutex>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A mesh aware router that supports multiple interfaces.
|
* A mesh aware router that supports multiple interfaces.
|
||||||
@@ -22,12 +19,6 @@ class Router : protected concurrency::OSThread, protected PacketHistory
|
|||||||
/// forwarded to the phone.
|
/// forwarded to the phone.
|
||||||
PointerQueue<meshtastic_MeshPacket> fromRadioQueue;
|
PointerQueue<meshtastic_MeshPacket> fromRadioQueue;
|
||||||
|
|
||||||
#ifdef ARCH_PORTDUINO
|
|
||||||
/// linux calls enqueueReceivedMessage from an other thread when receiving UDP packets,
|
|
||||||
/// to avoid a data race with LoRa, lock that method.
|
|
||||||
std::mutex queueMutex;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
RadioInterface *iface = NULL;
|
RadioInterface *iface = NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user