stmhal: add option to query for the current usb mode

Fetch the current usb mode and return a string representation when
pyb.usb_mode() is called with no args. The possible string values are interned
as qstr's. None will be returned if an incorrect mode is set.
This commit is contained in:
Tony Abboud
2015-08-30 17:20:38 -04:00
committed by Damien George
parent 821b7f22fe
commit 8d8fdcb4be
5 changed files with 48 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ codepoint2name[ord('}')] = 'brace_close'
codepoint2name[ord('*')] = 'star'
codepoint2name[ord('!')] = 'bang'
codepoint2name[ord('\\')] = 'backslash'
codepoint2name[ord('+')] = 'plus'
# this must match the equivalent function in qstr.c
def compute_hash(qstr, bytes_hash):