Skip to content

Commit c626fe1

Browse files
Remove block definitions from C++ file to avoid transfering them to the shims file.
1 parent 722a583 commit c626fe1

File tree

2 files changed

+2
-52
lines changed

2 files changed

+2
-52
lines changed

power.cpp

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ void _lowPowerRequest(LowPowerMode mode = LowPowerMode::Continue);
6161
* Request low power when the next idle
6262
* @param mode If Continue, then return immediately; if Wait, then pause until a power-up event occurs
6363
*/
64-
//% help=power/low-power-request
65-
//% group="micro:bit (V2)"
66-
//% weight=700
67-
//% block="request low power||and $mode"
6864
//%
6965
void _lowPowerRequest(LowPowerMode mode) {
7066
#if MICROBIT_CODAL
@@ -82,11 +78,6 @@ void _lowPowerRequest(LowPowerMode mode) {
8278
* Pause for a fixed interval, and request low power when idle.
8379
* @param interval The period of time to pause, in milliseconds.
8480
*/
85-
//% help=power/low-power-for
86-
//% group="micro:bit (V2)"
87-
//% weight=600
88-
//% interval.shadow=longTimePicker
89-
//% block="request low power for $interval ms"
9081
//%
9182
void _lowPowerPause(int interval) {
9283
#if MICROBIT_CODAL
@@ -101,10 +92,7 @@ void _lowPowerPause(int interval) {
10192
* Prevent or allow low power.
10293
* Prevent and allow requests should occur in pairs.
10394
* The default is to allow.
104-
*/
105-
//% help=power/low-power-enable
106-
//% weight=500
107-
//% block="low power %enable"
95+
*/
10896
//%
10997
void _lowPowerEnable(LowPowerEnable enable) {
11098
#if MICROBIT_CODAL
@@ -127,8 +115,7 @@ void _lowPowerEnable(LowPowerEnable enable) {
127115

128116
/**
129117
* Determine if low power is enabled
130-
*/
131-
//% help=power/low-power-is-enabled
118+
*/
132119
//%
133120
bool _lowPowerIsEnabled() {
134121
#if MICROBIT_CODAL
@@ -144,13 +131,6 @@ bool _lowPowerIsEnabled() {
144131
* @param interval the time (in ms) for the timer.
145132
* @param code the code to execute
146133
*/
147-
//% help=power/full-power-every
148-
//% group="micro:bit (V2)"
149-
//% weight=800
150-
//% blockAllowMultiple=1
151-
//% interval.shadow=longTimePicker
152-
//% afterOnStart=true
153-
//% block="full power every $interval ms"
154134
//%
155135
void _fullPowerEvery(int interval, Action code) {
156136
#if MICROBIT_CODAL
@@ -169,7 +149,6 @@ void _fullPowerEvery(int interval, Action code) {
169149
* @param source the source to set
170150
* @param enable true to trigger full power
171151
*/
172-
//% help=power/full-power-source-enable
173152
//%
174153
void _fullPowerSourceEnable(FullPowerSource source, bool enable) {
175154
#if MICROBIT_CODAL
@@ -237,10 +216,6 @@ bool _fullPowerSourceIsEnabled(FullPowerSource source) {
237216
* Set the source to trigger full power.
238217
* @param source the source to set
239218
*/
240-
//% help=power/full-power-on
241-
//% group="micro:bit (V2)"
242-
//% weight=900
243-
//% block="full power on %source"
244219
//%
245220
void _fullPowerOn(FullPowerSource source) {
246221
_fullPowerSourceEnable(source, true);

shims.d.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,13 @@ declare namespace power {
1111
* Request low power when the next idle
1212
* @param mode If Continue, then return immediately; if Wait, then pause until a power-up event occurs
1313
*/
14-
//% help=power/low-power-request
15-
//% group="micro:bit (V2)"
16-
//% weight=700
17-
//% block="request low power||and $mode"
1814
//% shim=power::_lowPowerRequest
1915
function _lowPowerRequest(mode: LowPowerMode): void;
2016

2117
/**
2218
* Pause for a fixed interval, and request low power when idle.
2319
* @param interval The period of time to pause, in milliseconds.
2420
*/
25-
//% help=power/low-power-for
26-
//% group="micro:bit (V2)"
27-
//% weight=600
28-
//% interval.shadow=longTimePicker
29-
//% block="request low power for $interval ms"
3021
//% shim=power::_lowPowerPause
3122
function _lowPowerPause(interval: int32): void;
3223

@@ -35,16 +26,12 @@ declare namespace power {
3526
* Prevent and allow requests should occur in pairs.
3627
* The default is to allow.
3728
*/
38-
//% help=power/low-power-enable
39-
//% weight=500
40-
//% block="low power %enable"
4129
//% shim=power::_lowPowerEnable
4230
function _lowPowerEnable(enable: LowPowerEnable): void;
4331

4432
/**
4533
* Determine if low power is enabled
4634
*/
47-
//% help=power/low-power-is-enabled
4835
//% shim=power::_lowPowerIsEnabled
4936
function _lowPowerIsEnabled(): boolean;
5037

@@ -53,13 +40,6 @@ declare namespace power {
5340
* @param interval the time (in ms) for the timer.
5441
* @param code the code to execute
5542
*/
56-
//% help=power/full-power-every
57-
//% group="micro:bit (V2)"
58-
//% weight=800
59-
//% blockAllowMultiple=1
60-
//% interval.shadow=longTimePicker
61-
//% afterOnStart=true
62-
//% block="full power every $interval ms"
6343
//% shim=power::_fullPowerEvery
6444
function _fullPowerEvery(interval: int32, code: () => void): void;
6545

@@ -68,7 +48,6 @@ declare namespace power {
6848
* @param source the source to set
6949
* @param enable true to trigger full power
7050
*/
71-
//% help=power/full-power-source-enable
7251
//% shim=power::_fullPowerSourceEnable
7352
function _fullPowerSourceEnable(source: FullPowerSource, enable: boolean): void;
7453

@@ -85,10 +64,6 @@ declare namespace power {
8564
* Set the source to trigger full power.
8665
* @param source the source to set
8766
*/
88-
//% help=power/full-power-on
89-
//% group="micro:bit (V2)"
90-
//% weight=900
91-
//% block="full power on %source"
9267
//% shim=power::_fullPowerOn
9368
function _fullPowerOn(source: FullPowerSource): void;
9469
}

0 commit comments

Comments
 (0)