usb: increase timeout to detect slower usb storage devices
What changed, and why it matters
This commit simply waits longer (about 3 seconds instead of 1 second) before showing a 'please insert USB device' prompt when a user plugs in a slow USB storage device. It is a usability fix, not a security fix.
No security action required; treat as a normal usability/compatbility patch.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change increases a retry counter from 5 to 15 in the USB mass-storage detection loop. Each iteration waits 200 ms, so the total detection grace period extends from ~1 s to ~3 s before the UI prompts the user. There is no change to parsing, authentication, cryptography, or trust boundaries.
Changed components
main/usbhmsc/usbmode.cInspect captured patch +2 / −2
diff --git a/main/usbhmsc/usbmode.c b/main/usbhmsc/usbmode.c
index 91511bd..01ee6e3 100644
--- a/main/usbhmsc/usbmode.c
+++ b/main/usbhmsc/usbmode.c
@@ -348,8 +348,8 @@ static bool handle_usbstorage_action(const char* title, usbstorage_action_fn_t u
if (!act_prompt) {
if (state.usbstorage_state == USBSTORAGE_STATE_NONE) {
- // If the usb-storage device is not detected/mounted after ~1s, show a screen prompting the user
- if (counter < 5) {
+ // If the usb-storage device is not detected/mounted after ~3s, show a screen prompting the user
+ if (counter < 15) {
xSemaphoreTake(state.semaphore_usbstorage_event, 200 / portTICK_PERIOD_MS);
++counter;
continue;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.