diff --git a/libs/core/_locales/core-jsdoc-strings.json b/libs/core/_locales/core-jsdoc-strings.json index 446c44aab9c..625b9c00008 100644 --- a/libs/core/_locales/core-jsdoc-strings.json +++ b/libs/core/_locales/core-jsdoc-strings.json @@ -329,6 +329,7 @@ "control.runtimeWarning": "Display warning in the simulator.", "control.setDebugFlags": "Set flags used when connecting an external debugger.", "control.simmessages.onReceived": "Registers the handler for a message on a given channel", + "control.singleSimulator": "Allow only one simulator", "control.waitForEvent": "Blocks the calling thread until the specified event is raised.", "control.waitMicros": "Blocks the current fiber for the given microseconds", "control.waitMicros|param|micros": "number of micro-seconds to wait. eg: 4", diff --git a/libs/core/control.cpp b/libs/core/control.cpp index c8074f48e75..031c37e7b92 100644 --- a/libs/core/control.cpp +++ b/libs/core/control.cpp @@ -271,6 +271,12 @@ namespace control { microbit_reset(); } + + + + //% + void singleSimulator() { } + /** * Blocks the current fiber for the given microseconds * @param micros number of micro-seconds to wait. eg: 4 diff --git a/libs/core/control.ts b/libs/core/control.ts index 83b3a98718b..57d6f7a1c22 100644 --- a/libs/core/control.ts +++ b/libs/core/control.ts @@ -16,6 +16,14 @@ namespace control { export function runInBackground(a: () => void) { control.inBackground(a); } + + /** + * Allow only one simulator + */ + //% shim=control::singleSimulator + export function singleSimulator() { + + } /** * Returns the value of a C++ runtime constant diff --git a/package.json b/package.json index 9f981731bbe..269533244ad 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "docs/static/icons/favicon.ico" ], "devDependencies": { - "@types/dom-mediacapture-record": "^1.0.16", + "@types/dom-mediacapture-record": "1.0.20", "@types/marked": "0.3.0", "@types/node": "8.10.66", "@types/react": "16.4.7",