mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-02 02:39:57 +00:00
Fix rare assertion failure which could occur due to pending interrupts
* fix assertion failure ``` 22:57:36 64409 [PositionPlugin] FIXME-update-db Sniffing packet 22:57:36 64409 [PositionPlugin] Delivering rx packet (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxtime=1628895456 priority=10) 22:57:36 64409 [PositionPlugin] Forwarding to phone (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxtime=1628895456 priority=10) 22:57:36 64409 [PositionPlugin] Update DB node 0x85f4da1, rx_time=1628895456 22:57:36 64409 [PositionPlugin] Plugin routing considered 22:57:36 64409 [PositionPlugin] Add packet record (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxtime=1628895456 priority=10) 22:57:36 64409 [PositionPlugin] Expanding short PSK #1 22:57:36 64409 [PositionPlugin] Installing AES128 key! 22:57:36 64409 [PositionPlugin] enqueuing for send (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0xb1 encrypted rxtime=1628895456 priority=10) 22:57:36 64409 [PositionPlugin] (bw=125, sf=12, cr=4/8) packet symLen=32 ms, payloadSize=22, time 2596 ms 22:57:36 64409 [PositionPlugin] txGood=6,rxGood=10,rxBad=0 22:57:36 64409 [PositionPlugin] AirTime - Packet transmitted : 2596ms 22:57:36 64409 [RadioIf] assert failed src/mesh/RadioLibInterface.cpp: 240, void RadioLibInterface::handleReceiveInterrupt(), test=isReceiving ```
This commit is contained in:
parent
3266d57cfb
commit
0d758347af
@ -2,24 +2,6 @@
|
||||
|
||||
You probably don't care about this section - skip to the next one.
|
||||
|
||||
|
||||
|
||||
* fix assertion failure
|
||||
```
|
||||
22:57:36 64409 [PositionPlugin] FIXME-update-db Sniffing packet
|
||||
22:57:36 64409 [PositionPlugin] Delivering rx packet (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxtime=1628895456 priority=10)
|
||||
22:57:36 64409 [PositionPlugin] Forwarding to phone (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxtime=1628895456 priority=10)
|
||||
22:57:36 64409 [PositionPlugin] Update DB node 0x85f4da1, rx_time=1628895456
|
||||
22:57:36 64409 [PositionPlugin] Plugin routing considered
|
||||
22:57:36 64409 [PositionPlugin] Add packet record (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0x0 Portnum=3 rxtime=1628895456 priority=10)
|
||||
22:57:36 64409 [PositionPlugin] Expanding short PSK #1
|
||||
22:57:36 64409 [PositionPlugin] Installing AES128 key!
|
||||
22:57:36 64409 [PositionPlugin] enqueuing for send (id=0x5851f437 Fr0xa1 To0xff, WantAck0, HopLim3 Ch0xb1 encrypted rxtime=1628895456 priority=10)
|
||||
22:57:36 64409 [PositionPlugin] (bw=125, sf=12, cr=4/8) packet symLen=32 ms, payloadSize=22, time 2596 ms
|
||||
22:57:36 64409 [PositionPlugin] txGood=6,rxGood=10,rxBad=0
|
||||
22:57:36 64409 [PositionPlugin] AirTime - Packet transmitted : 2596ms
|
||||
22:57:36 64409 [RadioIf] assert failed src/mesh/RadioLibInterface.cpp: 240, void RadioLibInterface::handleReceiveInterrupt(), test=isReceiving
|
||||
```
|
||||
* send debug info 'in-band'
|
||||
* fix wifi connections for mqtt
|
||||
* usb lora dongle from pine64
|
||||
|
@ -72,14 +72,21 @@ bool NotifiedWorkerThread::notifyLater(uint32_t delay, uint32_t v, bool overwrit
|
||||
return didIt;
|
||||
}
|
||||
|
||||
int32_t NotifiedWorkerThread::runOnce()
|
||||
void NotifiedWorkerThread::checkNotification()
|
||||
{
|
||||
auto n = notification;
|
||||
enabled = false; // Only run once per notification
|
||||
notification = 0; // clear notification
|
||||
if (n) {
|
||||
onNotify(n);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int32_t NotifiedWorkerThread::runOnce()
|
||||
{
|
||||
enabled = false; // Only run once per notification
|
||||
checkNotification();
|
||||
|
||||
return RUN_SAME;
|
||||
}
|
||||
|
@ -38,8 +38,14 @@ class NotifiedWorkerThread : public OSThread
|
||||
protected:
|
||||
virtual void onNotify(uint32_t notification) = 0;
|
||||
|
||||
/// just calls checkNotification()
|
||||
virtual int32_t runOnce();
|
||||
|
||||
/// Sometimes we might want to check notifications independently of when our thread was getting woken up (i.e. if we are about to change
|
||||
/// radio transmit/receive modes we want to handle any pending interrupts first). You can call this method and if any notifications are currently
|
||||
/// pending they will be handled immediately.
|
||||
void checkNotification();
|
||||
|
||||
private:
|
||||
/**
|
||||
* Notify this thread so it can run
|
||||
|
@ -146,6 +146,8 @@ void INTERRUPT_ATTR SX1262Interface::disableInterrupt()
|
||||
|
||||
void SX1262Interface::setStandby()
|
||||
{
|
||||
checkNotification(); // handle any pending interrupts before we force standby
|
||||
|
||||
int err = lora.standby();
|
||||
assert(err == ERR_NONE);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user