stm32: Do not wait for USB host if USB is disabled

For USB console, we wait for USB host to grab the data before writing
the next chunk of characters. However, if the USB peripheral is
disabled, the current implementation is confused as to whether the host
has grabbed the previous chunk of data.

Fix this by explicitly checking for USB peripheral enabled.

BRANCH=ryu
BUG=None
TEST=Boot on Ryu and check console isn't slow.

Signed-off-by: Vic Yang <victoryang@chromium.org>
Change-Id: I438c95835e56707b7ca1796734f2e47062799f44
Reviewed-on: https://chromium-review.googlesource.com/231115
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Vic Yang
2014-11-20 12:43:46 -08:00
committed by chrome-internal-fetch
parent 1728af5b83
commit b16bcb0eb0
3 changed files with 11 additions and 0 deletions

View File

@@ -21,6 +21,9 @@
*/
void usb_init(void);
/* Check if USB peripheral is enabled. */
int usb_is_enabled(void);
/*
* Enable the pullup on the DP line to signal that this device exists to the
* host and to start the enumeration process.