Blevene / LabsConBadge_2023

LabsConBadge 2023
4 stars 2 forks source link

Make badge go into USB r/w mode when on USB power #9

Closed securelyfitz closed 1 year ago

securelyfitz commented 1 year ago

There's no need to make the badge USB host rewriteable when in battery power and no USB connection.

Automatically going into USB host rw mode when on USB power makes programming easier.

However, there is reason to make it USB host read-only when on USB connection for debug purposes.

So, only go into USB host rw mode if USB power is good (high, 1, false) AND center button is NOT pressed (high, 1, false)

  1. Connect a gpio to USB power through a large resistor plus a very weak pulldown because it will be 5v on a 3.3v io
  2. Change boot.py logic to !(USB_POWER && CENTER_BUTTON)
securelyfitz commented 1 year ago

consolidated into #12

securelyfitz commented 1 year ago

GPIO26_ADC0/USB_DET in the schematic is A0 on xiao schematic