Skip to content

Commit 4898719

Browse files
Merge pull request #217 from bbcmicrobit/partial-flashing
Add partial flashing and improve WebUSB error handling.
2 parents bff54c0 + b837e2b commit 4898719

File tree

11 files changed

+1112
-201
lines changed

11 files changed

+1112
-201
lines changed

editor.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,13 @@ <h2><i class="fa fa-unlock-alt"></i> <strong>{{ title }}</strong></h2>
253253
</li>
254254
</ul>
255255
</div>
256+
<div class="buttons_menu_item">
257+
<span id="partial-flashing" class="menu-switch-label">Partial Flashing:</span>
258+
<label class="menu-switch" id="menu-switch-partial-flashing-label">
259+
<input type="checkbox" class="action" id="menu-switch-partial-flashing" checked>
260+
<span class="menu-switch-slider"></span>
261+
</label>
262+
</div>
256263
</div>
257264
</div>
258265
<a href="#" class="roundbutton action" id="command-help"
@@ -310,7 +317,10 @@ <h2><i class="fa fa-unlock-alt"></i> <strong>{{ title }}</strong></h2>
310317
<input id="script-name" class="flex1">
311318
</div>
312319
</div>
313-
<div id="request-repl" style="">Click here or press CTRL-C to enter the REPL</div>
320+
<div id="serial-buttons">
321+
<div id="request-repl" style="">Send CTRL-C for REPL</div>
322+
<div id="request-serial" style="">Send CTRL-D to reset</div>
323+
</div>
314324
<div id="repl" style="display: none;">
315325
</div>
316326
<div id="editor-container" class="hbox flex1">
@@ -321,8 +331,10 @@ <h2><i class="fa fa-unlock-alt"></i> <strong>{{ title }}</strong></h2>
321331
<div id="flashing-overlay">
322332
<div id="flashing-info">
323333
<h2 id="flashing-text">Flashing micro:bit</h2>
334+
<div id="webusb-flashing-loader"></div>
324335
<progress id="webusb-flashing-progress" max="1">
325336
</progress>
337+
<i id="webusb-flashing-complete" class="fa fa-check"></i>
326338
</div>
327339
<div id="flashing-overlay-error"></div>
328340
</div>

lang/en.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,17 @@ var language = {
8888
},
8989
'webusb': {
9090
'err': {
91-
'update-req':'You need to <a target="_blank" href="https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit">update your micro:bit firmware</a> to make use of this feature.',
92-
'clear-connect':'Another process is connected to this device.</div><div>Close any other tabs that may be using WebUSB (e.g. MakeCode, Python Editor), or unplug and replug the micro:bit before trying again.',
93-
'restart-microbit':'Please restart your micro:bit and try again'
91+
'update-req': 'You need to <a target="_blank" href="https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit">update your micro:bit firmware</a> to make use of this feature.',
92+
'clear-connect': 'Another process is connected to this device.<br>Close any other tabs that may be using WebUSB (e.g. MakeCode, Python Editor), or unplug and replug the micro:bit before trying again.',
93+
'reconnect-microbit': 'Please reconnect your micro:bit and try again.',
94+
'partial-flashing-disable': 'If the errors persist, try disabling partial flashing in the beta options.',
95+
'device-disconnected': 'Device disconnected.'
9496
},
9597
'close': 'Close',
96-
'request-repl': 'Click here or press CTRL-C to enter the REPL',
97-
'flashing-text': 'Flashing micro:bit'
98+
'request-repl': 'Send CTRL-C for REPL',
99+
'request-serial': 'Send CTRL-D to reset',
100+
'flashing-text': 'Flashing micro:bit',
101+
'download': 'Download Hex'
98102
},
99103
'load': {
100104
'show-files' : 'Show Files',
@@ -179,6 +183,7 @@ var language = {
179183
'options-dropdown': {
180184
'autocomplete': 'Autocomplete',
181185
'on-enter': 'On Enter',
186+
'partial-flashing': 'Partial Flashing',
182187
'lang-select': 'Select Language:'
183188
},
184189
'text-editor': {

lang/es.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,17 @@ var language = {
8888
},
8989
'webusb': {
9090
'err': {
91-
'update-req':'<a target="_blank" href="https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit">actualizar el firmware del micro:bit firmware </a> para poder usar esta función!',
92-
'clear-connect':'Hay otro proceso conectado a este dispositivo.</div><div>Cierre cualquier otra pestaña que pueda estar usando WebUSB (por ejemplo, MakeCode or Editor de Python), o desconecte y vuelva a conectar el micro:bit antes de volver a intentarlo.',
93-
'restart-microbit':'Por favor reinicie el micro:bit e intentelo de nuevo.'
91+
'update-req': 'Necesitas <a target="_blank" href="https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit">actualizar el firmware del micro:bit </a> para poder usar esta función!',
92+
'clear-connect': 'Hay otro proceso conectado a este dispositivo.<br>Cierre cualquier otra pestaña que pueda estar usando WebUSB (por ejemplo, MakeCode or Editor de Python), o desconecte y vuelva a conectar el micro:bit antes de volver a intentarlo.',
93+
'reconnect-microbit': 'Por favor reconecta el micro:bit e intentalo de nuevo.',
94+
'partial-flashing-disable': 'Si el error persiste, intenta deshabilitar el flasheo parcial en las opciones beta.',
95+
'device-disconnected': 'Dispositivo desconectado.'
9496
},
9597
'close': 'Cerrar',
96-
'request-repl': 'Haz clic aqui o presione CTRL-C para entrar al REPL',
97-
'flashing-text': 'Flasheando micro:bit'
98+
'request-repl': 'Envia CTRL-C para el REPL',
99+
'request-serial': 'Envia CTRL-D para reiniciar',
100+
'flashing-text': 'Flasheando micro:bit',
101+
'download': 'Descargar Hex'
98102
},
99103
'load': {
100104
'show-files' : 'Mostrar Archivos',
@@ -179,6 +183,7 @@ var language = {
179183
'options-dropdown': {
180184
'autocomplete': 'Autocompletar',
181185
'on-enter': 'Al presionar Intro',
186+
'partial-flashing': 'Flasheo Parcial',
182187
'lang-select': 'Seleccionar Idioma:'
183188
},
184189
'text-editor': {

lang/pl.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,16 @@ var language = {
8989
'webusb': {
9090
'err': {
9191
'update-req': 'Musisz <a target="_blank" href="https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit">zaktualizuj oprogramowanie układowe micro: bit</a>, aby skorzystać z tej funkcji.',
92-
'clear-connect': 'Inny proces jest podłączony do tego urządzenia.</div><div> Zamknij wszystkie inne okna które mogą korzystać z WebUSB (np. MakeCode, Python Editor), lub odłącz i ponownie podłącz micro: bit przed ponowną próbą.',
93-
'restart-microbit': 'Proszę uruchom ponownie twój micro:bit i spróbuj ponownie'
92+
'clear-connect': 'Inny proces jest podłączony do tego urządzenia.<br> Zamknij wszystkie inne okna które mogą korzystać z WebUSB (np. MakeCode, Python Editor), lub odłącz i ponownie podłącz micro: bit przed ponowną próbą.',
93+
'reconnect-microbit': 'Please reconnect your micro:bit and try again.',
94+
'partial-flashing-disable': 'If the errors persist, try disabling partial flashing in the beta options.',
95+
'device-disconnected': 'Device disconnected.'
9496
},
9597
'close': 'Zamknij',
96-
'request-repl': 'Kliknij tutaj lub naciśnij CTRL-C, aby otworzyć REPL',
97-
'flashing-text': 'Instalowanie na micro:bit'
98+
'request-repl': 'Send CTRL-C for REPL',
99+
'request-serial': 'Send CTRL-D to reset',
100+
'flashing-text': 'Instalowanie na micro:bit',
101+
'download': 'Download hex'
98102
},
99103
'load': {
100104
'save-hex': 'Pobierz hex',
@@ -179,6 +183,7 @@ var language = {
179183
'options-dropdown': {
180184
'autocomplete': 'Autocomplete',
181185
'on-enter': 'Na Enter:',
186+
'partial-flashing': 'Partial Flashing',
182187
'lang-select': 'Wybierz Język:'
183188
},
184189
'text-editor': {

0 commit comments

Comments
 (0)