From b001cd5798643fd6c603c058a23e61e542e17a9a Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Mon, 2 Mar 2020 17:43:56 +0000 Subject: [PATCH] Fix issues if BLE=off, 'Make Connectable' is chosen, and the loader resets Bangle.js (fix #108) --- apps.json | 2 +- apps/boot/ChangeLog | 1 + apps/boot/boot0.js | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps.json b/apps.json index 63e053820..b7d1bb3a8 100644 --- a/apps.json +++ b/apps.json @@ -2,7 +2,7 @@ { "id": "boot", "name": "Bootloader", "icon": "bootloader.png", - "version":"0.07", + "version":"0.08", "description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings", "tags": "tool,system", "type":"bootloader", diff --git a/apps/boot/ChangeLog b/apps/boot/ChangeLog index 3c6dfec29..62adcecdc 100644 --- a/apps/boot/ChangeLog +++ b/apps/boot/ChangeLog @@ -4,3 +4,4 @@ 0.05: Add Welcome screen on boot 0.06: Disable GPS time log messages, add (default=1) setting to hide log messages 0.07: Fix issues with alarm scheduling +0.08: Fix issues if BLE=off, 'Make Connectable' is chosen, and the loader resets Bangle.js (fix #108) diff --git a/apps/boot/boot0.js b/apps/boot/boot0.js index cdfa03a73..a5b4b45af 100644 --- a/apps/boot/boot0.js +++ b/apps/boot/boot0.js @@ -15,8 +15,9 @@ if (s.blerepl===false) { // If not programmable, force terminal off Bluetooth if (s.log) Terminal.setConsole(); // if showing debug, put REPL on terminal (until connection) else Bluetooth.setConsole(true); // else if no debug, force REPL to Bluetooth } -// we just reset, so BLE should be on -if (s.ble===false) NRF.sleep(); +// we just reset, so BLE should be on. +// Don't disconnect if something is already connected to us +if (s.ble===false && !NRF.getSecurityStatus().connected) NRF.sleep(); // Set time, vibrate, beep, etc if (!s.vibrate) Bangle.buzz=Promise.resolve; if (!s.beep) Bangle.beep=Promise.resolve;