Skip to content
Snippets Groups Projects
Commit 0cf78726 authored by q3k's avatar q3k
Browse files

st3m/usb: disconnect PHY on init

This makes sure we don't start claiming to be a ttyACM device before the
user actually enables USB.
parent 07508de3
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,7 @@ void st3m_usb_init(void) {
assert(_mu == NULL);
_mu = xSemaphoreCreateMutex();
assert(_mu != NULL);
_mode = st3m_usb_mode_kind_disabled;
_generate_serial();
st3m_usb_cdc_init();
......@@ -57,6 +58,7 @@ void st3m_usb_init(void) {
};
// TODO(q3k): set self-powered based on battery state?
ESP_ERROR_CHECK(usb_new_phy(&phy_conf, &phy_hdl));
usb_phy_action(phy_hdl, USB_PHY_ACTION_HOST_FORCE_DISCONN);
if (!tusb_init()) {
ESP_LOGE(TAG, "TInyUSB init failed");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment