From b67ff733ab5652810874c8e2e8d713a44db88b73 Mon Sep 17 00:00:00 2001 From: Richard Knoll Date: Tue, 24 Oct 2017 13:10:54 -0700 Subject: [PATCH] Move forever and runinbackground after onstart (#555) --- libs/core/basic.cpp | 10 +++++----- libs/core/control.cpp | 2 +- libs/core/shims.d.ts | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libs/core/basic.cpp b/libs/core/basic.cpp index 8b17946b..71f2728e 100644 --- a/libs/core/basic.cpp +++ b/libs/core/basic.cpp @@ -16,7 +16,7 @@ namespace basic { //% blockId=device_show_number block="show|number %number" blockGap=8 //% async //% parts="ledmatrix" - void showNumber(int value, int interval = 150) { + void showNumber(int value, int interval = 150) { if (interval <= 0) interval = 1; ManagedString t(value); @@ -32,7 +32,7 @@ namespace basic { * @param leds the pattern of LED to turn on/off * @param interval time in milliseconds to pause after drawing */ - //% help=basic/show-leds + //% help=basic/show-leds //% weight=95 blockGap=8 //% imageLiteral=1 async //% blockId=device_show_leds @@ -47,9 +47,9 @@ namespace basic { * @param text the text to scroll on the screen, eg: "Hello!" * @param interval how fast to shift characters; eg: 150, 100, 200, -100 */ - //% help=basic/show-string + //% help=basic/show-string //% weight=87 blockGap=8 - //% block="show|string %text" + //% block="show|string %text" //% async //% blockId=device_print_message //% parts="ledmatrix" @@ -112,7 +112,7 @@ namespace basic { * Repeats the code forever in the background. On each iteration, allows other codes to run. * @param body code to execute */ - //% help=basic/forever weight=55 blockGap=8 blockAllowMultiple=1 + //% help=basic/forever weight=55 blockGap=8 blockAllowMultiple=1 afterOnStart=true //% blockId=device_forever block="forever" icon="\uf01e" void forever(Action a) { if (a != 0) { diff --git a/libs/core/control.cpp b/libs/core/control.cpp index 6c137720..f01ad250 100644 --- a/libs/core/control.cpp +++ b/libs/core/control.cpp @@ -217,7 +217,7 @@ namespace control { /** * Schedules code that run in the background. */ - //% help=control/in-background blockAllowMultiple=1 + //% help=control/in-background blockAllowMultiple=1 afterOnStart=true //% blockId="control_in_background" block="run in background" blockGap=8 void inBackground(Action a) { runInBackground(a); diff --git a/libs/core/shims.d.ts b/libs/core/shims.d.ts index 9fc25673..b206499b 100644 --- a/libs/core/shims.d.ts +++ b/libs/core/shims.d.ts @@ -145,7 +145,7 @@ declare namespace basic { * @param leds the pattern of LED to turn on/off * @param interval time in milliseconds to pause after drawing */ - //% help=basic/show-leds + //% help=basic/show-leds //% weight=95 blockGap=8 //% imageLiteral=1 async //% blockId=device_show_leds @@ -158,9 +158,9 @@ declare namespace basic { * @param text the text to scroll on the screen, eg: "Hello!" * @param interval how fast to shift characters; eg: 150, 100, 200, -100 */ - //% help=basic/show-string + //% help=basic/show-string //% weight=87 blockGap=8 - //% block="show|string %text" + //% block="show|string %text" //% async //% blockId=device_print_message //% parts="ledmatrix" interval.defl=150 shim=basic::showString @@ -196,7 +196,7 @@ declare namespace basic { * Repeats the code forever in the background. On each iteration, allows other codes to run. * @param body code to execute */ - //% help=basic/forever weight=55 blockGap=8 blockAllowMultiple=1 + //% help=basic/forever weight=55 blockGap=8 blockAllowMultiple=1 afterOnStart=true //% blockId=device_forever block="forever" icon="\uf01e" shim=basic::forever function forever(a: () => void): void; @@ -373,7 +373,7 @@ declare namespace control { /** * Schedules code that run in the background. */ - //% help=control/in-background blockAllowMultiple=1 + //% help=control/in-background blockAllowMultiple=1 afterOnStart=true //% blockId="control_in_background" block="run in background" blockGap=8 shim=control::inBackground function inBackground(a: () => void): void;