Skip to content

Commit

Permalink
Merge pull request #9 from microbit-foundation/v2-sim
Browse files Browse the repository at this point in the history
V2 sim
  • Loading branch information
martinwork authored Sep 12, 2021
2 parents 43447bb + adc4676 commit 6cd6123
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions power.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ namespace power {
//% group="micro:bit (V2)"
//% weight=700
//% block="request low power||and $mode"
//% parts="v2"
//% shim=power::lowPowerRequest
export function lowPowerRequest(mode?: LowPowerMode): void {
basic.pause(0)
Expand All @@ -61,6 +62,7 @@ export function lowPowerRequest(mode?: LowPowerMode): void {
//% weight=600
//% interval.shadow=longTimePicker
//% block="request low power for $interval ms"
//% parts="v2"
//% shim=power::lowPowerPause
export function lowPowerPause(interval: number): void {
basic.pause(interval)
Expand All @@ -74,6 +76,7 @@ export function lowPowerPause(interval: number): void {
//% help=power/low-power-enable
//% weight=500
//% block="low power %enable"
//% parts="v2"
//% shim=power::lowPowerEnable
export function lowPowerEnable(enable: LowPowerEnable): void {
return
Expand All @@ -100,6 +103,7 @@ export function lowPowerIsEnabled(): boolean {
//% interval.shadow=longTimePicker
//% afterOnStart=true
//% block="full power every $interval ms"
//% parts="v2"
//% shim=power::fullPowerEvery
export function fullPowerEvery(interval: number, code: () => void): void {
loops.everyInterval(interval, code)
Expand Down Expand Up @@ -135,6 +139,7 @@ export function fullPowerSourceIsEnabled(source: FullPowerSource): boolean {
//% group="micro:bit (V2)"
//% weight=900
//% block="full power on %source"
//% parts="v2"
//% shim=power::fullPowerOn
export function fullPowerOn(source: FullPowerSource): void {
return
Expand Down
2 changes: 1 addition & 1 deletion pxt.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "power",
"version": "0.2.1",
"version": "0.2.2",
"description": "Power saving. micro:bit (V2) only.",
"dependencies": {
"core": "*"
Expand Down

0 comments on commit 6cd6123

Please sign in to comment.