Tidy up handling of the initial 'limbo' device

This commit is contained in:
Gordon Williams 2015-06-04 17:09:53 +01:00
parent 815239ff6e
commit 8d1ff55ae7
3 changed files with 2 additions and 3 deletions

View File

@ -310,6 +310,7 @@ const char *jshGetDeviceString(IOEventFlags device) {
switch (device) {
case EV_LOOPBACKA: return "LoopbackA";
case EV_LOOPBACKB: return "LoopbackB";
case EV_LIMBO: return "Limbo";
#ifdef USB
case EV_USBSERIAL: return "USB";
#endif

View File

@ -581,8 +581,6 @@ void jsiInit(bool autoLoad) {
jsiStatus = JSIS_NONE;
consoleDevice = EV_LIMBO;
pinBusyIndicator = DEFAULT_BUSY_PIN_INDICATOR;
if (jshIsUSBSERIALConnected())
consoleDevice = EV_USBSERIAL;
/* If flash contains any code, then we should
Try and load from it... */

View File

@ -1333,7 +1333,7 @@ void jshIdle() {
bool USBConnected = jshIsUSBSERIALConnected();
if (wasUSBConnected != USBConnected) {
wasUSBConnected = USBConnected;
if (USBConnected)
if (USBConnected && jsiGetConsoleDevice() != EV_LIMBO)
jsiSetConsoleDevice(EV_USBSERIAL);
else {
if (jsiGetConsoleDevice() == EV_USBSERIAL)