Cleanup comments

This commit is contained in:
Ben Meadors
2026-05-12 16:32:00 -05:00
parent d9cb74e4dd
commit f3ae02c425
2 changed files with 2 additions and 9 deletions

View File

@@ -123,11 +123,7 @@ void XModemAdapter::handlePacket(meshtastic_XModem xmodemPacket)
filename[sizeof(filename) - 1] = '\0';
if (xmodemPacket.control == meshtastic_XModem_Control_SOH) { // Receive this file and put to Flash
// Truncate the destination before opening. On Adafruit_LittleFS,
// `open(path, FILE_O_WRITE)` is *append* semantics (O_RDWR|O_CREAT +
// seek-to-EOF), so without a prior remove, our XModem-streamed
// payload would be concatenated onto whatever was there, producing
// a corrupt mixed file.
// FILE_O_WRITE on Adafruit_LittleFS is append, not truncate — remove first.
spiLock->lock();
if (FSCom.exists(filename))
FSCom.remove(filename);

View File

@@ -52,10 +52,7 @@ class XModemAdapter
meshtastic_XModem getForPhone();
void resetForPhone();
// True while a file is being received from or transmitted to the phone.
// Callers (e.g. NodeDB::saveNodeDatabaseToDisk) consult this to avoid
// opening the same on-disk file for write in parallel, which races our
// long-lived xmodem `file` handle and ends up producing a 0-byte file.
// True while a file transfer is in flight; lets callers avoid racing our `file` handle.
bool isBusy() const { return isReceiving || isTransmitting; }
private: