From 5c0c18326bde73c21356642bb51f6b9b335c7aea Mon Sep 17 00:00:00 2001 From: Tom Harkness Date: Wed, 14 Oct 2026 20:11:44 +1100 Subject: [PATCH] pm5 cep: skip resync on the FAP's 0xFF dummy-poll bytes Co-Authored-By: Claude Sonnet 5 --- armsrc/pm5_cep.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/armsrc/pm5_cep.c b/armsrc/pm5_cep.c index 1983d402a..991fb22bf 100644 --- a/armsrc/pm5_cep.c +++ b/armsrc/pm5_cep.c @@ -387,6 +387,12 @@ bool cep_spi_data_available(void) { } s_last_spi_activity_tick = GetTickCount(); // FAP is still polling, valid frame or not uint16_t data_len = (len_header[1] << 8) | len_header[0]; + if (data_len == 0xFFFF) { + // FAP's reply-poll drives 0xFF dummy bytes when it has nothing to + // send (furi_hal_spi_bus_trx with a NULL tx buffer) - not a desync, + // same treatment as a CEP_SYNC_BYTE run, no resync needed. + return false; + } if (data_len > PM3_CMD_DATA_SIZE * 2) { // Same reasoning: an implausible length is itself evidence of a // desynced read, not just "no frame yet."