mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-26 18:09:04 +00:00
Model the time it is busy receiving/transmitting (#1776)
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
This commit is contained in:
parent
137a8dcfdf
commit
ee1ae627a3
@ -171,6 +171,8 @@ void SimRadio::onNotify(uint32_t notification)
|
|||||||
// Packet has been sent, count it toward our TX airtime utilization.
|
// Packet has been sent, count it toward our TX airtime utilization.
|
||||||
uint32_t xmitMsec = getPacketTime(txp);
|
uint32_t xmitMsec = getPacketTime(txp);
|
||||||
airTime->logAirtime(TX_LOG, xmitMsec);
|
airTime->logAirtime(TX_LOG, xmitMsec);
|
||||||
|
|
||||||
|
delay(xmitMsec); // Model the time it is busy sending
|
||||||
completeSending();
|
completeSending();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,6 +209,9 @@ void SimRadio::startSend(MeshPacket * txp)
|
|||||||
|
|
||||||
void SimRadio::startReceive(MeshPacket *p) {
|
void SimRadio::startReceive(MeshPacket *p) {
|
||||||
isReceiving = true;
|
isReceiving = true;
|
||||||
|
size_t length = getPacketLength(p);
|
||||||
|
uint32_t xmitMsec = getPacketTime(length);
|
||||||
|
delay(xmitMsec); // Model the time it is busy receiving
|
||||||
handleReceiveInterrupt(p);
|
handleReceiveInterrupt(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user