pxt-microbit 7.0.6 → 7.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/built/sim.js CHANGED
@@ -15,62 +15,62 @@ var pxsim;
15
15
  this.controlMessageState = new pxsim.ControlMessageState(this);
16
16
  this.builtinParts["ledmatrix"] = this.ledMatrixState = new pxsim.LedMatrixState(pxsim.runtime);
17
17
  this.builtinParts["buttonpair"] = this.buttonPairState = new pxsim.ButtonPairState({
18
- ID_BUTTON_A: 1 /* MICROBIT_ID_BUTTON_A */,
19
- ID_BUTTON_B: 2 /* MICROBIT_ID_BUTTON_B */,
20
- ID_BUTTON_AB: 3 /* MICROBIT_ID_BUTTON_AB */,
21
- BUTTON_EVT_UP: 2 /* MICROBIT_BUTTON_EVT_UP */,
22
- BUTTON_EVT_CLICK: 3 /* MICROBIT_BUTTON_EVT_CLICK */
18
+ ID_BUTTON_A: 1 /* DAL.MICROBIT_ID_BUTTON_A */,
19
+ ID_BUTTON_B: 2 /* DAL.MICROBIT_ID_BUTTON_B */,
20
+ ID_BUTTON_AB: 3 /* DAL.MICROBIT_ID_BUTTON_AB */,
21
+ BUTTON_EVT_UP: 2 /* DAL.MICROBIT_BUTTON_EVT_UP */,
22
+ BUTTON_EVT_CLICK: 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */
23
23
  });
24
24
  this.builtinParts["edgeconnector"] = this.edgeConnectorState = new pxsim.EdgeConnectorState({
25
25
  pins: [
26
- 100 /* MICROBIT_ID_IO_P0 */,
27
- 101 /* MICROBIT_ID_IO_P1 */,
28
- 102 /* MICROBIT_ID_IO_P2 */,
29
- 103 /* MICROBIT_ID_IO_P3 */,
30
- 104 /* MICROBIT_ID_IO_P4 */,
31
- 105 /* MICROBIT_ID_IO_P5 */,
32
- 106 /* MICROBIT_ID_IO_P6 */,
33
- 107 /* MICROBIT_ID_IO_P7 */,
34
- 108 /* MICROBIT_ID_IO_P8 */,
35
- 109 /* MICROBIT_ID_IO_P9 */,
36
- 110 /* MICROBIT_ID_IO_P10 */,
37
- 111 /* MICROBIT_ID_IO_P11 */,
38
- 112 /* MICROBIT_ID_IO_P12 */,
39
- 113 /* MICROBIT_ID_IO_P13 */,
40
- 114 /* MICROBIT_ID_IO_P14 */,
41
- 115 /* MICROBIT_ID_IO_P15 */,
42
- 116 /* MICROBIT_ID_IO_P16 */,
26
+ 100 /* DAL.MICROBIT_ID_IO_P0 */,
27
+ 101 /* DAL.MICROBIT_ID_IO_P1 */,
28
+ 102 /* DAL.MICROBIT_ID_IO_P2 */,
29
+ 103 /* DAL.MICROBIT_ID_IO_P3 */,
30
+ 104 /* DAL.MICROBIT_ID_IO_P4 */,
31
+ 105 /* DAL.MICROBIT_ID_IO_P5 */,
32
+ 106 /* DAL.MICROBIT_ID_IO_P6 */,
33
+ 107 /* DAL.MICROBIT_ID_IO_P7 */,
34
+ 108 /* DAL.MICROBIT_ID_IO_P8 */,
35
+ 109 /* DAL.MICROBIT_ID_IO_P9 */,
36
+ 110 /* DAL.MICROBIT_ID_IO_P10 */,
37
+ 111 /* DAL.MICROBIT_ID_IO_P11 */,
38
+ 112 /* DAL.MICROBIT_ID_IO_P12 */,
39
+ 113 /* DAL.MICROBIT_ID_IO_P13 */,
40
+ 114 /* DAL.MICROBIT_ID_IO_P14 */,
41
+ 115 /* DAL.MICROBIT_ID_IO_P15 */,
42
+ 116 /* DAL.MICROBIT_ID_IO_P16 */,
43
43
  0,
44
44
  0,
45
- 119 /* MICROBIT_ID_IO_P19 */,
46
- 120 /* MICROBIT_ID_IO_P20 */
45
+ 119 /* DAL.MICROBIT_ID_IO_P19 */,
46
+ 120 /* DAL.MICROBIT_ID_IO_P20 */
47
47
  ],
48
48
  servos: {
49
- "P0": 100 /* MICROBIT_ID_IO_P0 */,
50
- "P1": 101 /* MICROBIT_ID_IO_P1 */,
51
- "P2": 102 /* MICROBIT_ID_IO_P2 */,
52
- "P3": 103 /* MICROBIT_ID_IO_P3 */,
53
- "P4": 104 /* MICROBIT_ID_IO_P4 */,
54
- "P5": 105 /* MICROBIT_ID_IO_P5 */,
55
- "P6": 106 /* MICROBIT_ID_IO_P6 */,
56
- "P7": 107 /* MICROBIT_ID_IO_P7 */,
57
- "P8": 108 /* MICROBIT_ID_IO_P8 */,
58
- "P9": 109 /* MICROBIT_ID_IO_P9 */,
59
- "P10": 110 /* MICROBIT_ID_IO_P10 */,
60
- "P11": 111 /* MICROBIT_ID_IO_P11 */,
61
- "P12": 112 /* MICROBIT_ID_IO_P12 */,
62
- "P13": 113 /* MICROBIT_ID_IO_P13 */,
63
- "P14": 114 /* MICROBIT_ID_IO_P14 */,
64
- "P15": 115 /* MICROBIT_ID_IO_P15 */,
65
- "P16": 116 /* MICROBIT_ID_IO_P16 */,
66
- "P19": 119 /* MICROBIT_ID_IO_P19 */
49
+ "P0": 100 /* DAL.MICROBIT_ID_IO_P0 */,
50
+ "P1": 101 /* DAL.MICROBIT_ID_IO_P1 */,
51
+ "P2": 102 /* DAL.MICROBIT_ID_IO_P2 */,
52
+ "P3": 103 /* DAL.MICROBIT_ID_IO_P3 */,
53
+ "P4": 104 /* DAL.MICROBIT_ID_IO_P4 */,
54
+ "P5": 105 /* DAL.MICROBIT_ID_IO_P5 */,
55
+ "P6": 106 /* DAL.MICROBIT_ID_IO_P6 */,
56
+ "P7": 107 /* DAL.MICROBIT_ID_IO_P7 */,
57
+ "P8": 108 /* DAL.MICROBIT_ID_IO_P8 */,
58
+ "P9": 109 /* DAL.MICROBIT_ID_IO_P9 */,
59
+ "P10": 110 /* DAL.MICROBIT_ID_IO_P10 */,
60
+ "P11": 111 /* DAL.MICROBIT_ID_IO_P11 */,
61
+ "P12": 112 /* DAL.MICROBIT_ID_IO_P12 */,
62
+ "P13": 113 /* DAL.MICROBIT_ID_IO_P13 */,
63
+ "P14": 114 /* DAL.MICROBIT_ID_IO_P14 */,
64
+ "P15": 115 /* DAL.MICROBIT_ID_IO_P15 */,
65
+ "P16": 116 /* DAL.MICROBIT_ID_IO_P16 */,
66
+ "P19": 119 /* DAL.MICROBIT_ID_IO_P19 */
67
67
  }
68
68
  });
69
69
  this.builtinParts["radio"] = this.radioState = new pxsim.RadioState(pxsim.runtime, this, {
70
- ID_RADIO: 9 /* MICROBIT_ID_RADIO */,
71
- RADIO_EVT_DATAGRAM: 1 /* MICROBIT_RADIO_EVT_DATAGRAM */
70
+ ID_RADIO: 9 /* DAL.MICROBIT_ID_RADIO */,
71
+ RADIO_EVT_DATAGRAM: 1 /* DAL.MICROBIT_RADIO_EVT_DATAGRAM */
72
72
  });
73
- this.builtinParts["microphone"] = this.microphoneState = new pxsim.MicrophoneState(3001 /* DEVICE_ID_MICROPHONE */, 0, 255, 86, 165);
73
+ this.builtinParts["microphone"] = this.microphoneState = new pxsim.MicrophoneState(3001 /* DAL.DEVICE_ID_MICROPHONE */, 0, 255, 86, 165);
74
74
  this.builtinParts["recording"] = this.recordingState = new pxsim.RecordingState();
75
75
  this.builtinParts["accelerometer"] = this.accelerometerState = new pxsim.AccelerometerState(pxsim.runtime);
76
76
  this.builtinParts["serial"] = this.serialState = new pxsim.SerialState(pxsim.runtime, this);
@@ -78,7 +78,7 @@ var pxsim;
78
78
  this.builtinParts["lightsensor"] = this.lightSensorState = new pxsim.LightSensorState();
79
79
  this.builtinParts["compass"] = this.compassState = new pxsim.CompassState();
80
80
  this.builtinParts["microservo"] = this.edgeConnectorState;
81
- this.builtinParts["logotouch"] = this.logoTouch = new pxsim.Button(121 /* MICROBIT_ID_LOGO */);
81
+ this.builtinParts["logotouch"] = this.logoTouch = new pxsim.Button(121 /* DAL.MICROBIT_ID_LOGO */);
82
82
  this.builtinVisuals["buttonpair"] = () => new pxsim.visuals.ButtonPairView();
83
83
  this.builtinVisuals["ledmatrix"] = () => new pxsim.visuals.LedMatrixView();
84
84
  this.builtinVisuals["microservo"] = () => new pxsim.visuals.MicroServoView();
@@ -148,7 +148,7 @@ var pxsim;
148
148
  }
149
149
  neopixelState(pinId) {
150
150
  if (pinId === undefined) {
151
- pinId = 100 /* MICROBIT_ID_IO_P0 */;
151
+ pinId = 100 /* DAL.MICROBIT_ID_IO_P0 */;
152
152
  }
153
153
  let state = this.lightState[pinId];
154
154
  if (!state)
@@ -198,7 +198,7 @@ var pxsim;
198
198
  pxsim.board = board;
199
199
  function parsePinString(gpioPin) {
200
200
  if (gpioPin == "*")
201
- return board().edgeConnectorState.getPin(100 /* MICROBIT_ID_IO_P0 */);
201
+ return board().edgeConnectorState.getPin(100 /* DAL.MICROBIT_ID_IO_P0 */);
202
202
  const m = /^(Analog|Digital)Pin\.P(\d)+/.exec(gpioPin);
203
203
  if (!m)
204
204
  return undefined;
@@ -222,7 +222,7 @@ var pxsim;
222
222
  }
223
223
  function onGesture(gesture, handler) {
224
224
  const b = accForGesture(gesture);
225
- pxsim.pxtcore.registerWithDal(13 /* MICROBIT_ID_GESTURE */, gesture, handler);
225
+ pxsim.pxtcore.registerWithDal(13 /* DAL.MICROBIT_ID_GESTURE */, gesture, handler);
226
226
  }
227
227
  input.onGesture = onGesture;
228
228
  function isGesture(gesture) {
@@ -330,7 +330,7 @@ var pxsim;
330
330
  this.isActive = false;
331
331
  this.sampleRange = 2;
332
332
  this.flags = 0;
333
- this.id = 5 /* MICROBIT_ID_ACCELEROMETER */;
333
+ this.id = 5 /* DAL.MICROBIT_ID_ACCELEROMETER */;
334
334
  }
335
335
  setSampleRange(range) {
336
336
  this.activate();
@@ -356,7 +356,7 @@ var pxsim;
356
356
  // Update gesture tracking
357
357
  this.updateGesture();
358
358
  // Indicate that a new sample is available
359
- pxsim.board().bus.queue(this.id, 1 /* MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE */);
359
+ pxsim.board().bus.queue(this.id, 1 /* DAL.MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE */);
360
360
  }
361
361
  getStrength() {
362
362
  return Math.floor(Math.sqrt(this.instantaneousAccelerationSquared()));
@@ -397,21 +397,21 @@ var pxsim;
397
397
  //
398
398
  // If we see enough zero crossings in succession (MICROBIT_ACCELEROMETER_SHAKE_COUNT_THRESHOLD), then we decide that the device
399
399
  // has been shaken.
400
- if ((this.getX() < -400 /* MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && this.shake.x) || (this.getX() > 400 /* MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && !this.shake.x)) {
400
+ if ((this.getX() < -400 /* DAL.MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && this.shake.x) || (this.getX() > 400 /* DAL.MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && !this.shake.x)) {
401
401
  shakeDetected = true;
402
402
  this.shake.x = !this.shake.x;
403
403
  }
404
- if ((this.getY() < -400 /* MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && this.shake.y) || (this.getY() > 400 /* MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && !this.shake.y)) {
404
+ if ((this.getY() < -400 /* DAL.MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && this.shake.y) || (this.getY() > 400 /* DAL.MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && !this.shake.y)) {
405
405
  shakeDetected = true;
406
406
  this.shake.y = !this.shake.y;
407
407
  }
408
- if ((this.getZ() < -400 /* MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && this.shake.z) || (this.getZ() > 400 /* MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && !this.shake.z)) {
408
+ if ((this.getZ() < -400 /* DAL.MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && this.shake.z) || (this.getZ() > 400 /* DAL.MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE */ && !this.shake.z)) {
409
409
  shakeDetected = true;
410
410
  this.shake.z = !this.shake.z;
411
411
  }
412
- if (shakeDetected && this.shake.count < 4 /* MICROBIT_ACCELEROMETER_SHAKE_COUNT_THRESHOLD */ && ++this.shake.count == 4 /* MICROBIT_ACCELEROMETER_SHAKE_COUNT_THRESHOLD */)
412
+ if (shakeDetected && this.shake.count < 4 /* DAL.MICROBIT_ACCELEROMETER_SHAKE_COUNT_THRESHOLD */ && ++this.shake.count == 4 /* DAL.MICROBIT_ACCELEROMETER_SHAKE_COUNT_THRESHOLD */)
413
413
  this.shake.shaken = 1;
414
- if (++this.shake.timer >= 10 /* MICROBIT_ACCELEROMETER_SHAKE_DAMPING */) {
414
+ if (++this.shake.timer >= 10 /* DAL.MICROBIT_ACCELEROMETER_SHAKE_DAMPING */) {
415
415
  this.shake.timer = 0;
416
416
  if (this.shake.count > 0) {
417
417
  if (--this.shake.count == 0)
@@ -419,29 +419,29 @@ var pxsim;
419
419
  }
420
420
  }
421
421
  if (this.shake.shaken)
422
- return 11 /* MICROBIT_ACCELEROMETER_EVT_SHAKE */;
422
+ return 11 /* DAL.MICROBIT_ACCELEROMETER_EVT_SHAKE */;
423
423
  let sq = (n) => n * n;
424
- if (force < sq(400 /* MICROBIT_ACCELEROMETER_FREEFALL_TOLERANCE */))
425
- return 7 /* MICROBIT_ACCELEROMETER_EVT_FREEFALL */;
426
- if (force > sq(3072 /* MICROBIT_ACCELEROMETER_3G_TOLERANCE */))
427
- return 8 /* MICROBIT_ACCELEROMETER_EVT_3G */;
428
- if (force > sq(6144 /* MICROBIT_ACCELEROMETER_6G_TOLERANCE */))
429
- return 9 /* MICROBIT_ACCELEROMETER_EVT_6G */;
430
- if (force > sq(8192 /* MICROBIT_ACCELEROMETER_8G_TOLERANCE */))
431
- return 10 /* MICROBIT_ACCELEROMETER_EVT_8G */;
424
+ if (force < sq(400 /* DAL.MICROBIT_ACCELEROMETER_FREEFALL_TOLERANCE */))
425
+ return 7 /* DAL.MICROBIT_ACCELEROMETER_EVT_FREEFALL */;
426
+ if (force > sq(3072 /* DAL.MICROBIT_ACCELEROMETER_3G_TOLERANCE */))
427
+ return 8 /* DAL.MICROBIT_ACCELEROMETER_EVT_3G */;
428
+ if (force > sq(6144 /* DAL.MICROBIT_ACCELEROMETER_6G_TOLERANCE */))
429
+ return 9 /* DAL.MICROBIT_ACCELEROMETER_EVT_6G */;
430
+ if (force > sq(8192 /* DAL.MICROBIT_ACCELEROMETER_8G_TOLERANCE */))
431
+ return 10 /* DAL.MICROBIT_ACCELEROMETER_EVT_8G */;
432
432
  // Determine our posture.
433
- if (this.getX() < (-1000 + 200 /* MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
434
- return 3 /* MICROBIT_ACCELEROMETER_EVT_TILT_LEFT */;
435
- if (this.getX() > (1000 - 200 /* MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
436
- return 4 /* MICROBIT_ACCELEROMETER_EVT_TILT_RIGHT */;
437
- if (this.getY() < (-1000 + 200 /* MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
438
- return 2 /* MICROBIT_ACCELEROMETER_EVT_TILT_DOWN */;
439
- if (this.getY() > (1000 - 200 /* MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
440
- return 1 /* MICROBIT_ACCELEROMETER_EVT_TILT_UP */;
441
- if (this.getZ() < (-1000 + 200 /* MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
442
- return 5 /* MICROBIT_ACCELEROMETER_EVT_FACE_UP */;
443
- if (this.getZ() > (1000 - 200 /* MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
444
- return 6 /* MICROBIT_ACCELEROMETER_EVT_FACE_DOWN */;
433
+ if (this.getX() < (-1000 + 200 /* DAL.MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
434
+ return 3 /* DAL.MICROBIT_ACCELEROMETER_EVT_TILT_LEFT */;
435
+ if (this.getX() > (1000 - 200 /* DAL.MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
436
+ return 4 /* DAL.MICROBIT_ACCELEROMETER_EVT_TILT_RIGHT */;
437
+ if (this.getY() < (-1000 + 200 /* DAL.MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
438
+ return 2 /* DAL.MICROBIT_ACCELEROMETER_EVT_TILT_DOWN */;
439
+ if (this.getY() > (1000 - 200 /* DAL.MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
440
+ return 1 /* DAL.MICROBIT_ACCELEROMETER_EVT_TILT_UP */;
441
+ if (this.getZ() < (-1000 + 200 /* DAL.MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
442
+ return 5 /* DAL.MICROBIT_ACCELEROMETER_EVT_FACE_UP */;
443
+ if (this.getZ() > (1000 - 200 /* DAL.MICROBIT_ACCELEROMETER_TILT_TOLERANCE */))
444
+ return 6 /* DAL.MICROBIT_ACCELEROMETER_EVT_FACE_DOWN */;
445
445
  return 0;
446
446
  }
447
447
  updateGesture() {
@@ -452,10 +452,10 @@ var pxsim;
452
452
  this.currentGesture = g;
453
453
  this.sigma = 0;
454
454
  }
455
- else if (this.sigma < 5 /* MICROBIT_ACCELEROMETER_GESTURE_DAMPING */) {
455
+ else if (this.sigma < 5 /* DAL.MICROBIT_ACCELEROMETER_GESTURE_DAMPING */) {
456
456
  ++this.sigma;
457
457
  }
458
- if (this.currentGesture !== this.lastGesture && this.sigma >= 5 /* MICROBIT_ACCELEROMETER_GESTURE_DAMPING */) {
458
+ if (this.currentGesture !== this.lastGesture && this.sigma >= 5 /* DAL.MICROBIT_ACCELEROMETER_GESTURE_DAMPING */) {
459
459
  this.enqueueCurrentGesture();
460
460
  }
461
461
  }
@@ -465,7 +465,7 @@ var pxsim;
465
465
  }
466
466
  enqueueCurrentGesture() {
467
467
  this.lastGesture = this.currentGesture;
468
- pxsim.board().bus.queue(13 /* MICROBIT_ID_GESTURE */, this.lastGesture);
468
+ pxsim.board().bus.queue(13 /* DAL.MICROBIT_ID_GESTURE */, this.lastGesture);
469
469
  }
470
470
  /**
471
471
  * Reads the X axis value of the latest update from the accelerometer.
@@ -587,7 +587,7 @@ var pxsim;
587
587
  this.accelerometer = new Accelerometer(runtime);
588
588
  }
589
589
  shake() {
590
- this.accelerometer.forceGesture(11 /* MICROBIT_ACCELEROMETER_EVT_SHAKE */); // SHAKE == 11
590
+ this.accelerometer.forceGesture(11 /* DAL.MICROBIT_ACCELEROMETER_EVT_SHAKE */); // SHAKE == 11
591
591
  }
592
592
  }
593
593
  pxsim.AccelerometerState = AccelerometerState;
@@ -602,7 +602,7 @@ var pxsim;
602
602
  b.usesButtonAB = true;
603
603
  pxsim.runtime.queueDisplayUpdate();
604
604
  }
605
- pxsim.pxtcore.registerWithDal(button, 3 /* MICROBIT_BUTTON_EVT_CLICK */, handler);
605
+ pxsim.pxtcore.registerWithDal(button, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */, handler);
606
606
  }
607
607
  input.onButtonPressed = onButtonPressed;
608
608
  function buttonIsPressed(button) {
@@ -832,7 +832,7 @@ var pxsim;
832
832
  return;
833
833
  pin.isTouched();
834
834
  pxsim.runtime.queueDisplayUpdate();
835
- pxsim.pxtcore.registerWithDal(pin.id, 3 /* MICROBIT_BUTTON_EVT_CLICK */, handler);
835
+ pxsim.pxtcore.registerWithDal(pin.id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */, handler);
836
836
  }
837
837
  input.onPinPressed = onPinPressed;
838
838
  function onPinReleased(pinId, handler) {
@@ -841,7 +841,7 @@ var pxsim;
841
841
  return;
842
842
  pin.isTouched();
843
843
  pxsim.runtime.queueDisplayUpdate();
844
- pxsim.pxtcore.registerWithDal(pin.id, 2 /* MICROBIT_BUTTON_EVT_UP */, handler);
844
+ pxsim.pxtcore.registerWithDal(pin.id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */, handler);
845
845
  }
846
846
  input.onPinReleased = onPinReleased;
847
847
  function pinIsPressed(pinId) {
@@ -1108,10 +1108,10 @@ var pxsim;
1108
1108
  setPull(pull) {
1109
1109
  this.pull = pull;
1110
1110
  switch (pull) {
1111
- case 0 /* PullDown */:
1111
+ case 0 /* PinPullMode.PullDown */:
1112
1112
  this.value = 0;
1113
1113
  break;
1114
- case 1 /* PullUp */:
1114
+ case 1 /* PinPullMode.PullUp */:
1115
1115
  this.value = 1023;
1116
1116
  break;
1117
1117
  default:
@@ -1240,7 +1240,7 @@ var pxsim;
1240
1240
  /** edge 18 does not support text encoder, so fall back to length **/
1241
1241
  logSize += typeof TextEncoder !== "undefined" ? (new TextEncoder().encode(data)).length : data.length;
1242
1242
  if (logSize >= logEnd) {
1243
- pxsim.board().bus.queue(44 /* MICROBIT_ID_LOG */, 1 /* MICROBIT_LOG_EVT_LOG_FULL */);
1243
+ pxsim.board().bus.queue(44 /* DAL.MICROBIT_ID_LOG */, 1 /* DAL.MICROBIT_LOG_EVT_LOG_FULL */);
1244
1244
  clear(false);
1245
1245
  }
1246
1246
  if (mirrorToSerial) {
@@ -1253,15 +1253,15 @@ var pxsim;
1253
1253
  function beginRow() {
1254
1254
  init();
1255
1255
  if (currentRow)
1256
- return -1015 /* DEVICE_INVALID_STATE */;
1256
+ return -1015 /* DAL.DEVICE_INVALID_STATE */;
1257
1257
  currentRow = [];
1258
- return 0 /* DEVICE_OK */;
1258
+ return 0 /* DAL.DEVICE_OK */;
1259
1259
  }
1260
1260
  flashlog.beginRow = beginRow;
1261
1261
  function logData(key, value, prepend = false) {
1262
1262
  init();
1263
1263
  if (!currentRow)
1264
- return -1015 /* DEVICE_INVALID_STATE */;
1264
+ return -1015 /* DAL.DEVICE_INVALID_STATE */;
1265
1265
  // find header index
1266
1266
  let index = headers.indexOf(key);
1267
1267
  if (index < 0) {
@@ -1278,15 +1278,15 @@ var pxsim;
1278
1278
  }
1279
1279
  // store
1280
1280
  currentRow[index] = value;
1281
- return 0 /* DEVICE_OK */;
1281
+ return 0 /* DAL.DEVICE_OK */;
1282
1282
  }
1283
1283
  flashlog.logData = logData;
1284
1284
  function endRow() {
1285
1285
  init();
1286
1286
  if (!currentRow)
1287
- return -1015 /* DEVICE_INVALID_STATE */;
1287
+ return -1015 /* DAL.DEVICE_INVALID_STATE */;
1288
1288
  if (!currentRow.some(el => el !== "" && el != undefined))
1289
- return 0 /* DEVICE_OK */;
1289
+ return 0 /* DAL.DEVICE_OK */;
1290
1290
  if (timestampFormat !== FlashLogTimeStampFormat.None) {
1291
1291
  let unit = "";
1292
1292
  switch (timestampFormat) {
@@ -1323,7 +1323,7 @@ var pxsim;
1323
1323
  }
1324
1324
  currentRow = undefined;
1325
1325
  commitRow(line, "row");
1326
- return 0 /* DEVICE_OK */;
1326
+ return 0 /* DAL.DEVICE_OK */;
1327
1327
  }
1328
1328
  flashlog.endRow = endRow;
1329
1329
  function logString(s) {
@@ -1486,7 +1486,7 @@ var pxsim;
1486
1486
  var fonts;
1487
1487
  (function (fonts) {
1488
1488
  function charCodeBuffer(charCode) {
1489
- if (charCode < 32 /* MICROBIT_FONT_ASCII_START */ || charCode > 126 /* MICROBIT_FONT_ASCII_END */)
1489
+ if (charCode < 32 /* DAL.MICROBIT_FONT_ASCII_START */ || charCode > 126 /* DAL.MICROBIT_FONT_ASCII_END */)
1490
1490
  return undefined;
1491
1491
  const b = pxsim.board();
1492
1492
  const led = b.ledMatrixState;
@@ -1494,7 +1494,7 @@ var pxsim;
1494
1494
  const h = font.height;
1495
1495
  const w = font.width;
1496
1496
  const buf = pxsim.control.createBuffer(h);
1497
- const offset = (charCode - 32 /* MICROBIT_FONT_ASCII_START */) * h;
1497
+ const offset = (charCode - 32 /* DAL.MICROBIT_FONT_ASCII_START */) * h;
1498
1498
  for (let row = 0; row < h; ++row)
1499
1499
  buf.data[row] = pxsim.FONT_DATA[offset + row];
1500
1500
  return buf;
@@ -1795,7 +1795,7 @@ var pxsim;
1795
1795
  // minimum v2
1796
1796
  b.ensureHardwareVersion(2);
1797
1797
  // register handle
1798
- pxsim.pxtcore.registerWithDal(121 /* MICROBIT_ID_LOGO */, action, handler);
1798
+ pxsim.pxtcore.registerWithDal(121 /* DAL.MICROBIT_ID_LOGO */, action, handler);
1799
1799
  }
1800
1800
  input.onLogoEvent = onLogoEvent;
1801
1801
  function logoIsPressed() {
@@ -1994,7 +1994,7 @@ var pxsim;
1994
1994
  (function (control) {
1995
1995
  control.inBackground = pxsim.thread.runInBackground;
1996
1996
  function onEvent(id, evid, handler) {
1997
- if (id == 3 /* MICROBIT_ID_BUTTON_AB */) {
1997
+ if (id == 3 /* DAL.MICROBIT_ID_BUTTON_AB */) {
1998
1998
  const b = pxsim.board().buttonPairState;
1999
1999
  if (!b.usesButtonAB) {
2000
2000
  b.usesButtonAB = true;
@@ -2170,7 +2170,7 @@ var pxsim;
2170
2170
  bluetooth.uartReadUntil = uartReadUntil;
2171
2171
  function onUartDataReceived(delimiters, handler) {
2172
2172
  let b = pxsim.board();
2173
- b.bus.listen(1200 /* MICROBIT_ID_BLE_UART */, 1 /* MICROBIT_UART_S_EVT_DELIM_MATCH */, handler);
2173
+ b.bus.listen(1200 /* DAL.MICROBIT_ID_BLE_UART */, 1 /* DAL.MICROBIT_UART_S_EVT_DELIM_MATCH */, handler);
2174
2174
  }
2175
2175
  bluetooth.onUartDataReceived = onUartDataReceived;
2176
2176
  function onBluetoothConnected(a) {
@@ -2586,7 +2586,7 @@ var pxsim;
2586
2586
  serial.readString = readString;
2587
2587
  function onDataReceived(delimiters, handler) {
2588
2588
  let b = pxsim.board();
2589
- b.bus.listen(12 /* MICROBIT_ID_SERIAL */, 1 /* MICROBIT_SERIAL_EVT_DELIM_MATCH */, handler);
2589
+ b.bus.listen(12 /* DAL.MICROBIT_ID_SERIAL */, 1 /* DAL.MICROBIT_SERIAL_EVT_DELIM_MATCH */, handler);
2590
2590
  }
2591
2591
  serial.onDataReceived = onDataReceived;
2592
2592
  function redirect(tx, rx, rate) {
@@ -3922,7 +3922,7 @@ path.sim-board {
3922
3922
  this.flashAntenna();
3923
3923
  break;
3924
3924
  case "eventbus":
3925
- if (msg.id == 2000 /* MES_BROADCAST_GENERAL_ID */)
3925
+ if (msg.id == 2000 /* DAL.MES_BROADCAST_GENERAL_ID */)
3926
3926
  this.flashAntenna();
3927
3927
  break;
3928
3928
  }
@@ -4044,7 +4044,7 @@ path.sim-board {
4044
4044
  let state = this.board;
4045
4045
  state.edgeConnectorState.pins[index].touched = true;
4046
4046
  this.updatePin(state.edgeConnectorState.pins[index], index);
4047
- this.board.bus.queue(state.edgeConnectorState.pins[index].id, 1 /* MICROBIT_BUTTON_EVT_DOWN */);
4047
+ this.board.bus.queue(state.edgeConnectorState.pins[index].id, 1 /* DAL.MICROBIT_BUTTON_EVT_DOWN */);
4048
4048
  pressedTime = pxsim.runtime.runningTime();
4049
4049
  }));
4050
4050
  btn.addEventListener(pxsim.pointerEvents.leave, ev => {
@@ -4056,19 +4056,19 @@ path.sim-board {
4056
4056
  let state = this.board;
4057
4057
  state.edgeConnectorState.pins[index].touched = false;
4058
4058
  this.updatePin(state.edgeConnectorState.pins[index], index);
4059
- this.board.bus.queue(state.edgeConnectorState.pins[index].id, 2 /* MICROBIT_BUTTON_EVT_UP */);
4059
+ this.board.bus.queue(state.edgeConnectorState.pins[index].id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */);
4060
4060
  const currentTime = pxsim.runtime.runningTime();
4061
- if (currentTime - pressedTime > 1000 /* DEVICE_BUTTON_LONG_CLICK_TIME */)
4062
- this.board.bus.queue(state.edgeConnectorState.pins[index].id, 4 /* MICROBIT_BUTTON_EVT_LONG_CLICK */);
4061
+ if (currentTime - pressedTime > 1000 /* DAL.DEVICE_BUTTON_LONG_CLICK_TIME */)
4062
+ this.board.bus.queue(state.edgeConnectorState.pins[index].id, 4 /* DAL.MICROBIT_BUTTON_EVT_LONG_CLICK */);
4063
4063
  else
4064
- this.board.bus.queue(state.edgeConnectorState.pins[index].id, 3 /* MICROBIT_BUTTON_EVT_CLICK */);
4064
+ this.board.bus.queue(state.edgeConnectorState.pins[index].id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
4065
4065
  pressedTime = undefined;
4066
4066
  });
4067
4067
  pxsim.accessibility.enableKeyboardInteraction(btn, undefined, () => {
4068
4068
  let state = this.board;
4069
- this.board.bus.queue(state.edgeConnectorState.pins[index].id, 1 /* MICROBIT_BUTTON_EVT_DOWN */);
4070
- this.board.bus.queue(state.edgeConnectorState.pins[index].id, 2 /* MICROBIT_BUTTON_EVT_UP */);
4071
- this.board.bus.queue(state.edgeConnectorState.pins[index].id, 3 /* MICROBIT_BUTTON_EVT_CLICK */);
4069
+ this.board.bus.queue(state.edgeConnectorState.pins[index].id, 1 /* DAL.MICROBIT_BUTTON_EVT_DOWN */);
4070
+ this.board.bus.queue(state.edgeConnectorState.pins[index].id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */);
4071
+ this.board.bus.queue(state.edgeConnectorState.pins[index].id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
4072
4072
  });
4073
4073
  });
4074
4074
  }
@@ -4087,7 +4087,7 @@ path.sim-board {
4087
4087
  // console.log(`down ${stateButton.id}`)
4088
4088
  stateButton.pressed = true;
4089
4089
  pxsim.svg.fill(elButton, this.props.theme.buttonDown);
4090
- this.board.bus.queue(stateButton.id, 1 /* MICROBIT_BUTTON_EVT_DOWN */);
4090
+ this.board.bus.queue(stateButton.id, 1 /* DAL.MICROBIT_BUTTON_EVT_DOWN */);
4091
4091
  pressedTime = pxsim.runtime.runningTime();
4092
4092
  }));
4093
4093
  buttonOuter.addEventListener(pxsim.pointerEvents.leave, ev => {
@@ -4097,18 +4097,18 @@ path.sim-board {
4097
4097
  buttonOuter.addEventListener(pxsim.pointerEvents.up, ev => {
4098
4098
  stateButton.pressed = false;
4099
4099
  pxsim.svg.fill(elButton, this.props.theme.buttonUp);
4100
- this.board.bus.queue(stateButton.id, 2 /* MICROBIT_BUTTON_EVT_UP */);
4100
+ this.board.bus.queue(stateButton.id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */);
4101
4101
  const currentTime = pxsim.runtime.runningTime();
4102
- if (currentTime - pressedTime > 1000 /* DEVICE_BUTTON_LONG_CLICK_TIME */)
4103
- this.board.bus.queue(stateButton.id, 4 /* MICROBIT_BUTTON_EVT_LONG_CLICK */);
4102
+ if (currentTime - pressedTime > 1000 /* DAL.DEVICE_BUTTON_LONG_CLICK_TIME */)
4103
+ this.board.bus.queue(stateButton.id, 4 /* DAL.MICROBIT_BUTTON_EVT_LONG_CLICK */);
4104
4104
  else
4105
- this.board.bus.queue(stateButton.id, 3 /* MICROBIT_BUTTON_EVT_CLICK */);
4105
+ this.board.bus.queue(stateButton.id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
4106
4106
  pressedTime = undefined;
4107
4107
  });
4108
4108
  pxsim.accessibility.enableKeyboardInteraction(buttonOuter, undefined, () => {
4109
- this.board.bus.queue(stateButton.id, 1 /* MICROBIT_BUTTON_EVT_DOWN */);
4110
- this.board.bus.queue(stateButton.id, 2 /* MICROBIT_BUTTON_EVT_UP */);
4111
- this.board.bus.queue(stateButton.id, 3 /* MICROBIT_BUTTON_EVT_CLICK */);
4109
+ this.board.bus.queue(stateButton.id, 1 /* DAL.MICROBIT_BUTTON_EVT_DOWN */);
4110
+ this.board.bus.queue(stateButton.id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */);
4111
+ this.board.bus.queue(stateButton.id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
4112
4112
  });
4113
4113
  }
4114
4114
  attachAPlusBEvents() {
@@ -4122,7 +4122,7 @@ path.sim-board {
4122
4122
  pxsim.svg.fill(this.buttons[0], this.props.theme.buttonDown);
4123
4123
  pxsim.svg.fill(this.buttons[1], this.props.theme.buttonDown);
4124
4124
  pxsim.svg.fill(this.buttons[2], this.props.theme.buttonDown);
4125
- this.board.bus.queue(bpState.abBtn.id, 1 /* MICROBIT_BUTTON_EVT_DOWN */);
4125
+ this.board.bus.queue(bpState.abBtn.id, 1 /* DAL.MICROBIT_BUTTON_EVT_DOWN */);
4126
4126
  pressedTime = pxsim.runtime.runningTime();
4127
4127
  }));
4128
4128
  this.buttonsOuter[2].addEventListener(pxsim.pointerEvents.leave, ev => {
@@ -4140,18 +4140,18 @@ path.sim-board {
4140
4140
  pxsim.svg.fill(this.buttons[0], this.props.theme.buttonUp);
4141
4141
  pxsim.svg.fill(this.buttons[1], this.props.theme.buttonUp);
4142
4142
  pxsim.svg.fill(this.buttons[2], this.props.theme.virtualButtonUp);
4143
- this.board.bus.queue(bpState.abBtn.id, 2 /* MICROBIT_BUTTON_EVT_UP */);
4143
+ this.board.bus.queue(bpState.abBtn.id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */);
4144
4144
  const currentTime = pxsim.runtime.runningTime();
4145
- if (currentTime - pressedTime > 1000 /* DEVICE_BUTTON_LONG_CLICK_TIME */)
4146
- this.board.bus.queue(bpState.abBtn.id, 4 /* MICROBIT_BUTTON_EVT_LONG_CLICK */);
4145
+ if (currentTime - pressedTime > 1000 /* DAL.DEVICE_BUTTON_LONG_CLICK_TIME */)
4146
+ this.board.bus.queue(bpState.abBtn.id, 4 /* DAL.MICROBIT_BUTTON_EVT_LONG_CLICK */);
4147
4147
  else
4148
- this.board.bus.queue(bpState.abBtn.id, 3 /* MICROBIT_BUTTON_EVT_CLICK */);
4148
+ this.board.bus.queue(bpState.abBtn.id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
4149
4149
  pressedTime = undefined;
4150
4150
  });
4151
4151
  pxsim.accessibility.enableKeyboardInteraction(this.buttonsOuter[2], undefined, () => {
4152
- this.board.bus.queue(bpState.abBtn.id, 1 /* MICROBIT_BUTTON_EVT_DOWN */);
4153
- this.board.bus.queue(bpState.abBtn.id, 2 /* MICROBIT_BUTTON_EVT_UP */);
4154
- this.board.bus.queue(bpState.abBtn.id, 3 /* MICROBIT_BUTTON_EVT_CLICK */);
4152
+ this.board.bus.queue(bpState.abBtn.id, 1 /* DAL.MICROBIT_BUTTON_EVT_DOWN */);
4153
+ this.board.bus.queue(bpState.abBtn.id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */);
4154
+ this.board.bus.queue(bpState.abBtn.id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
4155
4155
  });
4156
4156
  }
4157
4157
  }
@@ -4554,10 +4554,10 @@ var pxsim;
4554
4554
  this.state = state;
4555
4555
  switch (state) {
4556
4556
  case ThresholdState.High:
4557
- pxsim.board().bus.queue(this.id, 2 /* SENSOR_THRESHOLD_HIGH */);
4557
+ pxsim.board().bus.queue(this.id, 2 /* DAL.SENSOR_THRESHOLD_HIGH */);
4558
4558
  break;
4559
4559
  case ThresholdState.Low:
4560
- pxsim.board().bus.queue(this.id, 1 /* SENSOR_THRESHOLD_LOW */);
4560
+ pxsim.board().bus.queue(this.id, 1 /* DAL.SENSOR_THRESHOLD_LOW */);
4561
4561
  break;
4562
4562
  case ThresholdState.Normal:
4563
4563
  break;