Skip to content

Commit c43739e

Browse files
Add call to startRunning in autogenerated.ts file (#597)
This change ensures the model starts running on the micro:bit immediately, even if no ml event blocks are used.
1 parent c0e9844 commit c43739e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/makecode/__snapshots__/utils.test.ts.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ namespace ml {
4545
};
4646
4747
simulatorSendData();
48+
startRunning();
4849
}
4950
5051
// Auto-generated. Do not edit. Really.
@@ -5278,7 +5279,7 @@ ml.onStart(ml.event.Clap, function () {
52785279
basic.showIcon(IconNames.EighthNote)
52795280
})
52805281
",
5281-
"pxt.json": "{"name":"A project name","description":"","dependencies":{"core":"*","microphone":"*","radio":"*","machine-learning":"github:microbit-foundation/pxt-microbit-ml#v1.0.10"},"files":["main.ts","main.blocks","autogenerated.ts","dataset.json","pxt.json","README.md"],"preferredEditor":"blocksprj"}",
5282+
"pxt.json": "{"name":"A project name","description":"","dependencies":{"core":"*","microphone":"*","radio":"*","machine-learning":"github:microbit-foundation/pxt-microbit-ml#v1.0.11"},"files":["main.ts","main.blocks","autogenerated.ts","dataset.json","pxt.json","README.md"],"preferredEditor":"blocksprj"}",
52825283
},
52835284
}
52845285
`;

src/makecode/generate-custom-scripts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ ${createEventListeners(actionNames)}
8686
};
8787
8888
simulatorSendData();
89+
startRunning();
8990
}
9091
9192
// Auto-generated. Do not edit. Really.

src/makecode/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const filenames = {
2626

2727
// Exported for testing.
2828
export const extensionName = "machine-learning";
29-
const extensionURL = "github:microbit-foundation/pxt-microbit-ml#v1.0.10";
29+
const extensionURL = "github:microbit-foundation/pxt-microbit-ml#v1.0.11";
3030

3131
export const pxt = {
3232
name: untitledProjectName,

0 commit comments

Comments
 (0)