Skip to content

Commit

Permalink
Add sim support for RGB LED in maker
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Oct 5, 2021
1 parent c9748b8 commit 1aeecfd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
9 changes: 0 additions & 9 deletions jdsim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,4 @@ namespace jacdac {
export function __physGetDiagnostics(): Buffer {
return null // TODO?
}

/**
* Sets the status led value for a given channel
**/
//% shim=jacdac::_setLedChannel
export function _setLedChannel(ch: number, val: number) {
// TODO (keep return)
return
}
}
7 changes: 7 additions & 0 deletions maker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace jacdac {
/**
* Sets the status led value for a given channel
**/
//% shim=jacdac::_setLedChannel
export declare function _setLedChannel(ch: number, val: number): void;
}
10 changes: 10 additions & 0 deletions nonmaker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace jacdac {
/**
* Sets the status led value for a given channel
**/
//% shim=jacdac::_setLedChannel
export function _setLedChannel(ch: number, val: number) {
// impl. for micro:bit and arcade (not supported natively)
return
}
}
4 changes: 4 additions & 0 deletions pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"led.cpp",
"hw-esp32.c",
"jdsim.ts",
"nonmaker.ts",
"maker.ts",
"hw.h",
"mbbridge.h",
"mbbridge.cpp",
Expand Down Expand Up @@ -62,6 +64,8 @@
"testDependencies": {},
"fileDependencies": {
"mbcompat.ts": "target:microbit",
"nonmaker.ts": "!target:maker",
"maker.ts": "target:maker",
"test.microbit.ts": "target:microbit",
"hw.cpp": "!core---esp32 && !core---esp32s2",
"hw-esp32.c": "core---esp32 || core---esp32s2"
Expand Down

0 comments on commit 1aeecfd

Please sign in to comment.