mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 01:32:40 +00:00
coroutine: kinda works now
This commit is contained in:
@@ -41,20 +41,22 @@ Router::Router() : concurrency::OSThread("Router"), fromRadioQueue(MAX_RX_FROMRA
|
||||
/* DEBUG_MSG("Size of NodeInfo %d\n", sizeof(NodeInfo));
|
||||
DEBUG_MSG("Size of SubPacket %d\n", sizeof(SubPacket));
|
||||
DEBUG_MSG("Size of MeshPacket %d\n", sizeof(MeshPacket)); */
|
||||
|
||||
fromRadioQueue.setReader(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* do idle processing
|
||||
* Mostly looking in our incoming rxPacket queue and calling handleReceived.
|
||||
*/
|
||||
uint32_t Router::runOnce()
|
||||
int32_t Router::runOnce()
|
||||
{
|
||||
MeshPacket *mp;
|
||||
while ((mp = fromRadioQueue.dequeuePtr(0)) != NULL) {
|
||||
perhapsHandleReceived(mp);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return INT32_MAX; // Wait a long time - until we get woken for the message queue
|
||||
}
|
||||
|
||||
/// Generate a unique packet id
|
||||
|
||||
Reference in New Issue
Block a user