Merge branch 'master' into dismiss_frames

This commit is contained in:
Jason P 2025-08-19 08:13:19 -05:00 committed by GitHub
commit 98298ce2ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -192,12 +192,6 @@ bool PhoneAPI::handleToRadio(const uint8_t *buf, size_t bufLength)
size_t PhoneAPI::getFromRadio(uint8_t *buf) size_t PhoneAPI::getFromRadio(uint8_t *buf)
{ {
if (!available()) {
return 0;
}
// In case we send a FromRadio packet
memset(&fromRadioScratch, 0, sizeof(fromRadioScratch));
// Respond to heartbeat by sending queue status // Respond to heartbeat by sending queue status
if (heartbeatReceived) { if (heartbeatReceived) {
memset(&fromRadioScratch, 0, sizeof(fromRadioScratch)); memset(&fromRadioScratch, 0, sizeof(fromRadioScratch));
@ -209,6 +203,12 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
return numbytes; return numbytes;
} }
if (!available()) {
return 0;
}
// In case we send a FromRadio packet
memset(&fromRadioScratch, 0, sizeof(fromRadioScratch));
// Advance states as needed // Advance states as needed
switch (state) { switch (state) {
case STATE_SEND_NOTHING: case STATE_SEND_NOTHING: