Fix USB regression extraction across nested SDK guards

Inspect the complete exclusive TX kick and wrapper functions instead of stopping at the first nested endif. Retain the existing transport guards and verify the pinned SDK pending/kick hooks.

Validation: all 82 tests across the 19-script USB workflow step passed; independent review passed. Production firmware is unchanged.
This commit is contained in:
mikecarper committed 2026-10-04 13:06:55 -07:00
1 parent 6516c719e1
commit ec8f82e918
1 file changed
+8 -5
+8 -5
View File
@@ -356,18 +356,21 @@ int main() {
)
self.assertIn("return Serial.write(data, size);", guarded_write)
kick_start = logging.index(
"static void serviceEsp32HwcdcTxKickExclusive"
)
kick_end = logging.index("#endif", kick_start)
kick = logging[kick_start:kick_end]
# Extract complete functions: their pinned-SDK/fallback branches now
# contain nested #endif directives inside the outer platform guard.
kick = "\n".join(extract_braced(logging, signature) for signature in (
"static void serviceEsp32HwcdcTxKickExclusive(void*)",
"static void serviceEsp32HwcdcTxKick()",
))
self.assertIn("Serial.availableForWrite()", kick)
self.assertIn("esp32_hwcdc_tx_buffer_capacity.load(", kick)
self.assertIn("meshEsp32HwcdcTxPending()", kick)
self.assertIn("canAccessEsp32Hwcdc(nullptr)", kick)
self.assertIn("Serial.isPlugged()", kick)
self.assertIn("usb_serial_jtag_ll_txfifo_flush();", kick)
self.assertIn("USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY", kick)
self.assertIn("portENTER_CRITICAL(&esp32_hwcdc_session_mux)", kick)
self.assertIn("meshEsp32HwcdcKickTx();", kick)
self.assertIn("tryRunExclusive(", kick)
event_start = logging.index("static void handleEsp32HwcdcEvent")