pxt-microbit 4.1.13 → 4.1.16
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/hexcache/{10b89901ceecd59577303c0e0f3edd3d8c39a91e6a66c8e2150d45d1a17ff4d5.hex → 38f5afc7bfbf3b7025f36f6387d636994b161ec828b5f14d7de5ab4cd1cc33fd.hex} +7593 -7591
- package/built/hexcache/{1961e178039bfaea0cab6bff3ec56cee9848056c5c95032197462fcac592c6b6.hex → 5baf884ee3e3fc309ebe20fbf09f5de9780cf9183a1da685e3688194d4074c11.hex} +10760 -10754
- package/built/hexcache/becf72e02ed99aecb1bc9054dce656fb3379778d5ec7f16a4715d4addf05f02c.hex +20253 -0
- package/built/hexcache/f90d36a5042a5d2c5770f6f83317c0a89c8141ad426d5da91dea991b5516e699.hex +14853 -0
- package/built/sim.d.ts +2 -0
- package/built/sim.js +35 -2
- package/built/target.js +157 -41
- package/built/target.json +157 -41
- package/built/targetlight.json +6 -6
- package/built/web/react-common-authcode.css +207 -5
- package/built/web/react-common-skillmap.css +1 -1
- package/built/web/rtlreact-common-skillmap.css +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/package.json +3 -3
- package/pxtarget.json +1 -1
- package/built/hexcache/29660f89c4dc9eaa33a4f1a687576da4d4b40b4a5b16664dd35f9b6f4fadb5cc.hex +0 -14849
- package/built/hexcache/834bc33478f017bbd2a17cbc1d0e76d0b2617aef9be442ad8884e5573519bb7c.hex +0 -20247
package/built/sim.d.ts
CHANGED
|
@@ -232,6 +232,7 @@ declare namespace pxsim {
|
|
|
232
232
|
function getPin(id: number): Pin;
|
|
233
233
|
}
|
|
234
234
|
declare namespace pxsim.pins {
|
|
235
|
+
let edgeConnectorSoundDisabled: boolean;
|
|
235
236
|
function digitalReadPin(pinId: number): number;
|
|
236
237
|
function digitalWritePin(pinId: number, value: number): void;
|
|
237
238
|
function setPull(pinId: number, pull: number): void;
|
|
@@ -254,6 +255,7 @@ declare namespace pxsim.music {
|
|
|
254
255
|
}
|
|
255
256
|
declare namespace pxsim.pins {
|
|
256
257
|
function setAudioPin(pinId: number): void;
|
|
258
|
+
function setAudioPinEnabled(enabled: boolean): void;
|
|
257
259
|
}
|
|
258
260
|
declare namespace pxsim {
|
|
259
261
|
enum PinFlags {
|
package/built/sim.js
CHANGED
|
@@ -849,6 +849,7 @@ var pxsim;
|
|
|
849
849
|
(function (pxsim) {
|
|
850
850
|
var pins;
|
|
851
851
|
(function (pins_1) {
|
|
852
|
+
pins_1.edgeConnectorSoundDisabled = false;
|
|
852
853
|
function digitalReadPin(pinId) {
|
|
853
854
|
let pin = pxsim.getPin(pinId);
|
|
854
855
|
if (!pin)
|
|
@@ -961,7 +962,7 @@ var pxsim;
|
|
|
961
962
|
const pins = ec.pins;
|
|
962
963
|
const pin = ec.pitchEnabled && (pins.filter(pin => !!pin && pin.pitch)[0] || pins[0]);
|
|
963
964
|
const pitchVolume = ec.pitchVolume | 0;
|
|
964
|
-
if (pin) {
|
|
965
|
+
if (pin && !pins_1.edgeConnectorSoundDisabled) {
|
|
965
966
|
pin.mode = pxsim.PinFlags.Analog | pxsim.PinFlags.Output;
|
|
966
967
|
if (frequency <= 0 || pitchVolume <= 0) {
|
|
967
968
|
pin.value = 0;
|
|
@@ -984,7 +985,7 @@ var pxsim;
|
|
|
984
985
|
else {
|
|
985
986
|
setTimeout(() => {
|
|
986
987
|
pxsim.AudioContextManager.stop();
|
|
987
|
-
if (pin) {
|
|
988
|
+
if (pin && !pins_1.edgeConnectorSoundDisabled) {
|
|
988
989
|
pin.value = 0;
|
|
989
990
|
pin.period = 0;
|
|
990
991
|
pin.mode = pxsim.PinFlags.Unused;
|
|
@@ -1025,6 +1026,38 @@ var pxsim;
|
|
|
1025
1026
|
pxsim.pins.analogSetPitchPin(pinId);
|
|
1026
1027
|
}
|
|
1027
1028
|
pins.setAudioPin = setAudioPin;
|
|
1029
|
+
const disabledSVG = `
|
|
1030
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
|
|
1031
|
+
<clipPath id="bounds" clipPathUnits="userSpaceOnUse">
|
|
1032
|
+
<circle cx="50" cy="50" r="45" />
|
|
1033
|
+
</clipPath>
|
|
1034
|
+
<circle cx="50" cy="50" r="40" stroke-width="10" stroke="red" fill="none" clip-path="url(#bounds)" />
|
|
1035
|
+
<line x1="100" y1="0" x2="0" y2="100" stroke="red" stroke-width="10" clip-path="url(#bounds)" />
|
|
1036
|
+
</svg>
|
|
1037
|
+
`;
|
|
1038
|
+
function setAudioPinEnabled(enabled) {
|
|
1039
|
+
pins.edgeConnectorSoundDisabled = !enabled;
|
|
1040
|
+
const headphone = pxsim.board().viewHost.getView().querySelector("g.sim-headphone-cmp");
|
|
1041
|
+
if (headphone) {
|
|
1042
|
+
const existing = headphone.querySelector("#headphone-disabled");
|
|
1043
|
+
if (existing) {
|
|
1044
|
+
if (enabled) {
|
|
1045
|
+
existing.remove();
|
|
1046
|
+
}
|
|
1047
|
+
else {
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
if (!enabled) {
|
|
1052
|
+
const img = document.createElementNS("http://www.w3.org/2000/svg", "image");
|
|
1053
|
+
img.setAttribute("href", "data:image/svg+xml;utf8," + encodeURIComponent(disabledSVG));
|
|
1054
|
+
img.setAttribute("id", "headphone-disabled");
|
|
1055
|
+
img.style.transform = "scale(1.5) translate(-10px, -10px)";
|
|
1056
|
+
headphone.appendChild(img);
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
pins.setAudioPinEnabled = setAudioPinEnabled;
|
|
1028
1061
|
})(pins = pxsim.pins || (pxsim.pins = {}));
|
|
1029
1062
|
})(pxsim || (pxsim = {}));
|
|
1030
1063
|
var pxsim;
|