Skip to content

Commit e2998f6

Browse files
usb: host pref lives in com.micropythonos.settings
1 parent 37c0ee3 commit e2998f6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

docs/frameworks/usb-manager.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ USBManager.deactivate() # stop host, bring CDC back (REPL rejoins automatically
7676
USBManager.host_mode_active() # live host state
7777
```
7878

79-
Both persist the choice (`host_mode` in the `com.micropythonos.usb`
80-
preferences) so reboots keep it; pass `persist=False` for a one-shot switch.
79+
Both persist the choice (`usb_host_mode` in the `com.micropythonos.settings`
80+
preferences — the same key the Settings row edits, so UI, REPL and boot
81+
share one source of truth) so reboots keep it; pass `persist=False` for a
82+
one-shot switch.
8183
`mpos.main` honors the persisted flag at boot. Both are idempotent and safe
8284
to retry. On stock builds (no `usb` module) they return `False`.
8385

0 commit comments

Comments
 (0)