Skip to content

Commit 22882d6

Browse files
WebUSB: Add message to modal during full flashing.
1 parent 22def9f commit 22882d6

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

editor.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ <h2><i class="fa fa-unlock-alt"></i> <strong>{{ title }}</strong></h2>
401401
<div id="flashing-overlay" class="modal-overlay modal-div" tabindex="-1" role="dialog" aria-labelledby="flashing-overlay" aria-modal="true">
402402
<div id="flashing-info">
403403
<h2 id="flashing-text">Flashing micro:bit</h2>
404+
<div id="flashing-extra-msg"></div>
404405
<div id="webusb-flashing-loader"></div>
405406
<progress id="webusb-flashing-progress" max="1">
406407
</progress>

js/partial-flashing.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,9 @@ let PartialFlashing = {
648648
fullFlashAsync: function(dapwrapper, image, updateProgress) {
649649
PartialFlashingUtils.log("Full flash");
650650
// Event to monitor flashing progress
651-
dapwrapper.daplink.on(DAPjs.DAPLink.EVENT_PROGRESS, updateProgress);
651+
dapwrapper.daplink.on(DAPjs.DAPLink.EVENT_PROGRESS, (progress) => {
652+
updateProgress(progress, true);
653+
});
652654
return dapwrapper.transport.open()
653655
.then(() => dapwrapper.daplink.flash(image))
654656
.then(() => {

python-main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,8 +1451,11 @@ function web_editor(config) {
14511451
$('#flashing-overlay-error').html("");
14521452
$("#flashing-info").removeClass('hidden');
14531453
$("#flashing-overlay-container").css("display", "flex");
1454+
// TODO: Translate this string
1455+
$('#flashing-extra-msg').text('Full flash in progress, subsequent flashes will be much quicker.').hide();
14541456

1455-
var updateProgress = function(progress) {
1457+
var updateProgress = function(progress, longFlash) {
1458+
$('#flashing-extra-msg').toggle(!!longFlash);
14561459
$('#webusb-flashing-progress').val(progress).css('display', 'inline-block');
14571460
};
14581461

0 commit comments

Comments
 (0)