mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
Tidy up handling of the initial 'limbo' device
This commit is contained in:
parent
815239ff6e
commit
8d1ff55ae7
@ -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
|
||||
|
||||
@ -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... */
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user