From 25f9136db9ca39e776095fe776764a4ac6cfc62b Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 30 Oct 2023 09:10:30 -0700 Subject: [PATCH] Lint (#654) --- cli/src/build.ts | 38 +- cli/src/exitcodes.ts | 2 +- cli/src/init.ts | 11 +- cli/src/run.ts | 17 +- cli/src/sidedata.ts | 2 +- compiler/src/boards.json | 2454 ++++++++--------- compiler/src/logparser.ts | 5 +- compiler/src/magic.ts | 1 - compiler/src/opwriter.ts | 20 +- compiler/src/specgen.ts | 26 +- dap/src/devsdbgclient.ts | 5 +- dap/src/tsconfig.json | 18 +- dcfg/archconfig.schema.json | 27 +- dcfg/deviceconfig.schema.json | 345 +-- devs/compiler-tests/redefinition.ts | 8 +- devs/run-tests/02numbers.ts | 2 - devs/run-tests/06numbercollections.ts | 1 - devs/run-tests/07stringcollections.ts | 2 - devs/run-tests/09postprefix.ts | 1 - devs/run-tests/11equalsoperator.ts | 2 - devs/run-tests/12referencecollection.ts | 1 - devs/run-tests/14lazyoperations.ts | 2 - devs/run-tests/17classes.ts | 9 +- devs/run-tests/19forof.ts | 12 +- devs/run-tests/24arraymap.ts | 18 +- devs/run-tests/33inheritance.ts | 2 - devs/run-tests/37objectliterals.ts | 4 +- devs/run-tests/39objectdestructuring.ts | 9 +- devs/run-tests/48instanceof.ts | 2 - devs/run-tests/52errors.ts | 4 +- devs/run-tests/53roles.ts | 2 +- devs/run-tests/54jsx.tsx | 31 +- devs/samples/buzzer.ts | 1 - devs/samples/cloud.ts | 5 +- devs/samples/console.ts | 5 +- devs/samples/fields.ts | 2 +- devs/samples/light-switch.ts | 8 +- devs/samples/pending.ts | 4 +- devs/tsconfig.json | 8 +- interop/src/errors.ts | 17 +- interop/src/tsconfig.json | 16 +- package.json | 4 + packages/cloud/src/appinsights.ts | 5 +- packages/cloud/src/main.ts | 2 +- packages/core/src/array.ts | 16 +- packages/core/src/index.ts | 2 +- packages/core/src/utils.ts | 2 +- packages/drivers/src/grovergblcd.ts | 6 +- packages/drivers/src/sh110x.ts | 124 +- packages/drivers/src/st7735.ts | 11 +- packages/drivers/src/trafficlight.ts | 35 +- packages/drivers/src/uc8151.ts | 10 +- packages/gpio/src/index.ts | 2 +- packages/graphics/src/index.ts | 2 +- packages/i2c/src/client.ts | 2 +- packages/net/src/index.ts | 2 +- packages/observables/src/join.ts | 4 +- packages/ros/src/main.ts | 4 +- packages/runtime/src/colors.ts | 6 +- packages/runtime/src/index.ts | 2 +- packages/runtime/src/main.ts | 63 +- packages/runtime/src/number.ts | 8 +- packages/runtime/src/palette.ts | 15 +- packages/runtime/src/set.ts | 22 +- packages/runtime/src/valuedashboard.ts | 5 +- packages/sampleprj/sim/app.ts | 2 +- packages/sampleprj/sim/runtime.ts | 2 +- packages/sampleprj/src/kbd.ts | 4 +- packages/sampleprj/src/main5x5.ts | 2 +- packages/sampleprj/src/mainblinkypico.ts | 2 +- packages/sampleprj/src/mainblynk.ts | 5 +- packages/sampleprj/src/mainbuttonled.ts | 4 +- packages/sampleprj/src/maindoubleblinky.ts | 6 +- packages/sampleprj/src/mainenv.ts | 10 +- packages/sampleprj/src/mainesp3.ts | 4 +- packages/sampleprj/src/mainesp32rgbmatrix.ts | 2 +- .../sampleprj/src/maingithubbuildstatus.ts | 10 +- .../sampleprj/src/mainhomebridgehumidity.ts | 2 +- packages/sampleprj/src/mainleddisplay.ts | 3 +- packages/sampleprj/src/mainrandom.ts | 4 +- .../sampleprj/src/mainsetstatuslightpico.ts | 4 +- packages/sampleprj/src/mainstandby.ts | 4 +- packages/sampleprj/src/mainswitch.ts | 2 +- packages/sampleprj/src/mainthingspeak.ts | 2 +- packages/sampleprj/src/mainwroomssd1306.ts | 16 +- packages/sampleprj/src/useboard.ts | 2 +- packages/test/src/expect.ts | 5 +- plugin/README.md | 1 - plugin/src/tsconfig.json | 18 +- runtime/boards/archconfig.schema.json | 21 +- runtime/boards/deviceconfig.schema.json | 379 +-- runtime/boards/generic.d.ts | 5 +- runtime/boards/native/native.board.json | 2 +- runtime/boards/wasm/generic_feather.json | 2 +- runtime/boards/wasm/generic_xiao_qtpy.json | 2 +- runtime/devicescript-vm/dist/types.d.ts | 136 +- runtime/devicescript-vm/index.html | 28 +- runtime/devicescript-vm/runner.js | 30 +- runtime/devicescript-vm/tsconfig.json | 20 +- runtime/devicescript/README.md | 8 +- website/docs/contributing.mdx | 13 +- yarn.lock | 5 + 102 files changed, 1942 insertions(+), 2328 deletions(-) diff --git a/cli/src/build.ts b/cli/src/build.ts index 0cd27abcca..06c038ece7 100644 --- a/cli/src/build.ts +++ b/cli/src/build.ts @@ -501,18 +501,20 @@ export async function saveLibFiles( const customServices = buildConfig.services.filter(srv => srv.catalog !== undefined) || [] // generate source files - await Promise.all(["ts", "c"].map(async(lang) => { - const converter = converters()[lang] - let constants = "" - for (const srv of customServices) { - constants += converter(srv) + "\n" - } - const dir = join(pref, GENDIR, lang) - await mkdirp(dir) - return writeFile(join(dir, `constants.${lang}`), constants, { - encoding: "utf-8", + await Promise.all( + ["ts", "c"].map(async lang => { + const converter = converters()[lang] + let constants = "" + for (const srv of customServices) { + constants += converter(srv) + "\n" + } + const dir = join(pref, GENDIR, lang) + await mkdirp(dir) + return writeFile(join(dir, `constants.${lang}`), constants, { + encoding: "utf-8", + }) }) - })) + ) // json specs { const dir = join(pref, GENDIR) @@ -528,13 +530,15 @@ export async function saveLibFiles( } export async function buildAll(options: BuildOptions) { - await Promise.all((await glob("src/main*.ts")).map((file) => { - log(`build ${file}`) - return build(file, { - ...options, - outDir: BINDIR + "/" + file.slice(8, -3), + await Promise.all( + (await glob("src/main*.ts")).map(file => { + log(`build ${file}`) + return build(file, { + ...options, + outDir: BINDIR + "/" + file.slice(8, -3), + }) }) - })) + ) } export async function build(file: string, options: BuildOptions) { diff --git a/cli/src/exitcodes.ts b/cli/src/exitcodes.ts index 14d9ad071c..342a07756d 100644 --- a/cli/src/exitcodes.ts +++ b/cli/src/exitcodes.ts @@ -1,2 +1,2 @@ export const EXIT_CODE_EADDRINUSE = 100 -export const EXIT_CODE_COMPILATION_ERROR = 101 \ No newline at end of file +export const EXIT_CODE_COMPILATION_ERROR = 101 diff --git a/cli/src/init.ts b/cli/src/init.ts index ee7eaea1eb..6732430b21 100644 --- a/cli/src/init.ts +++ b/cli/src/init.ts @@ -452,8 +452,7 @@ export async function init(dir: string | undefined, options: InitOptions) { const pkg = readJSON5Sync("package.json") as PackageManifest // name needed in worspace for install to work - if (!pkg.name) - pkg.name = dir || basename(process.cwd()) + if (!pkg.name) pkg.name = dir || basename(process.cwd()) // ensure cli is added addCliDependency(pkg) @@ -505,12 +504,12 @@ export async function init(dir: string | undefined, options: InitOptions) { return finishAdd( `Your DeviceScript project is initialized.\n` + - `To get more help, https://microsoft.github.io/devicescript/getting-started/`, + `To get more help, https://microsoft.github.io/devicescript/getting-started/`, ["package.json", MAIN] ) } -export interface AddSimOptions extends InitOptions { } +export interface AddSimOptions extends InitOptions {} export async function addSim(options: AddSimOptions) { log(`Adding simulator support`) @@ -569,7 +568,7 @@ export interface AddNpmOptions extends InitOptions { name?: string } -export interface AddSettingsOptions extends InitOptions { } +export interface AddSettingsOptions extends InitOptions {} export function execCmd(cmd: string) { try { @@ -729,7 +728,7 @@ export async function addTest(options: AddTestOptions) { ) } -export interface AddTestOptions extends InitOptions { } +export interface AddTestOptions extends InitOptions {} export function initAddCmds() { addReqHandler("addBoard", d => diff --git a/cli/src/run.ts b/cli/src/run.ts index c32f44bf88..058902ef63 100644 --- a/cli/src/run.ts +++ b/cli/src/run.ts @@ -81,13 +81,16 @@ export async function runTest( error(...data) process.exit(1) } - setTimeout(() => { - if (resolve) { - inst.devsStop() - console.log("timeout") - reject(new Error("timeout")) - } - }, parseInt(options.testTimeout) || 5000) + setTimeout( + () => { + if (resolve) { + inst.devsStop() + console.log("timeout") + reject(new Error("timeout")) + } + }, + parseInt(options.testTimeout) || 5000 + ) }) } diff --git a/cli/src/sidedata.ts b/cli/src/sidedata.ts index 43b54ed464..f69f3dfd4b 100644 --- a/cli/src/sidedata.ts +++ b/cli/src/sidedata.ts @@ -55,7 +55,7 @@ const msgHandlers: Record< export function addReqHandler< Req extends SideReq, - Resp extends SideResp = SideResp + Resp extends SideResp = SideResp, >( req: Req["req"], cb: (msg: Req, sender: DevToolsClient) => Promise diff --git a/compiler/src/boards.json b/compiler/src/boards.json index 57062d3714..a4dccf5c1f 100644 --- a/compiler/src/boards.json +++ b/compiler/src/boards.json @@ -1,1237 +1,1237 @@ { - "archs": { - "esp32": { - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32archconfig.schema.json", - "bareUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32-esp32_bare-0x1000.bin", - "binFlashOffset": "0x1000", - "binGenericFlashOffset": "0x10000", - "dcfgOffset": "0x9000", - "flashPageSize": 4096, - "fstorOffset": "0x1c0000", - "fstorPages": 64, - "id": "esp32", - "name": "ESP32", - "pins": { - "analogIn": "32-39", - "analogOut": "25,26", - "boot": "0,2,5,12,15", - "bootUart": "1,3", - "debug": "12-15", - "flash": "6-11", - "input": "io,34,35,36,37,38,39", - "io": "boot,4,13,14,18,19,21,22,23,25,26,27,32,33", - "psram": "16,17", - "touch": "0,2,4,12-15,27,32,33" - }, - "repoUrl": "https://github.com/microsoft/devicescript-esp32" - }, - "esp32c3": { - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32archconfig.schema.json", - "bareUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-esp32c3_bare-0x0.bin", - "binFlashOffset": 0, - "binGenericFlashOffset": "0x10000", - "dcfgOffset": "0x9000", - "flashPageSize": 4096, - "fstorOffset": "0x1c0000", - "fstorPages": 64, - "id": "esp32c3", - "name": "ESP32-C3", - "pins": { - "analogIn": "0-4", - "boot": "2,8,9", - "bootUart": "20,21", - "debug": "4-7", - "flash": "11-17", - "io": "0-10,bootUart", - "usb": "18,19" - }, - "repoUrl": "https://github.com/microsoft/devicescript-esp32" - }, - "esp32s2": { - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32archconfig.schema.json", - "bareUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-esp32s2_bare-0x1000.bin", - "binFlashOffset": "0x1000", - "binGenericFlashOffset": "0x10000", - "dcfgOffset": "0x9000", - "flashPageSize": 4096, - "fstorOffset": "0x1c0000", - "fstorPages": 64, - "id": "esp32s2", - "name": "ESP32-S2", - "pins": { - "analogIn": "1-10", - "analogOut": "17,18", - "boot": "0,45,46", - "debug": "39-42", - "flash": "26-32", - "input": "io,46", - "io": "0-18,21,33-45", - "usb": "19,20" - }, - "repoUrl": "https://github.com/microsoft/devicescript-esp32" - }, - "esp32s3": { - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32archconfig.schema.json", - "bareUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s3-esp32s3_bare-0x0.bin", - "binFlashOffset": "0x0", - "binGenericFlashOffset": "0x10000", - "dcfgOffset": "0x9000", - "flashPageSize": 4096, - "fstorOffset": "0x1c0000", - "fstorPages": 64, - "id": "esp32s3", - "name": "ESP32-S3", - "pins": { - "analogIn": "1-10", - "analogOut": "17,18", - "boot": "0,45,46", - "debug": "39-42", - "flash": "26-32,35-37", - "input": "io", - "io": "0-18,21,33-48", - "usb": "19,20" - }, - "repoUrl": "https://github.com/microsoft/devicescript-esp32" - }, - "rp2040": { - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040archconfig.schema.json", - "bareUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040-pico.uf2", - "dcfgOffset": "0x100dc000", - "flashPageSize": 4096, - "fstorOffset": "0x100e0000", - "fstorPages": 32, - "id": "rp2040", - "name": "RP2040", - "pins": { - "analogIn": "26-29", - "io": "0-29" - }, - "repoUrl": "https://github.com/microsoft/devicescript-pico", - "uf2Align": 4096 - }, - "rp2040w": { - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040archconfig.schema.json", - "bareUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040w-pico_w.uf2", - "dcfgOffset": "0x100dc000", - "flashPageSize": 4096, - "fstorOffset": "0x100e0000", - "fstorPages": 32, - "id": "rp2040w", - "name": "RP2040 + CYW43 WiFi", - "pins": { - "analogIn": "26-28", - "io": "0-22,analogIn", - "wifi": "23,24,25,29" - }, - "repoUrl": "https://github.com/microsoft/devicescript-pico", - "uf2Align": 4096 - } - }, - "boards": { - "adafruit_feather_esp32_s2": { - "$description": "A S2 Feather from Adafruit. (untested)", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-adafruit_feather_esp32_s2-0x1000.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "archId": "esp32s2", - "devName": "Adafruit Feather ESP32-S2", - "i2c": { - "$connector": "Qwiic", - "pinSCL": "SCL", - "pinSDA": "SDA" - }, - "id": "adafruit_feather_esp32_s2", - "led": { - "pin": 33, - "type": 1 - }, - "log": { - "pinTX": 43 - }, - "pins": { - "A0": 18, - "A1": 17, - "A2": 16, - "A3": 15, - "A4_D24": 14, - "A5_D25": 8, - "D10": 10, - "D11": 11, - "D12": 12, - "D13": 13, - "D5": 5, - "D6": 6, - "D9": 9, - "LED_PWR": 21, - "MISO": 37, - "MOSI": 35, - "PWR": 7, - "RX_D0": 38, - "SCK": 36, - "SCL": 4, - "SDA": 3, - "TX_D1": 39 - }, - "productId": "0x3c2ed99e", - "sPin": { - "LED_PWR": 1, - "PWR": 1 - }, - "url": "https://www.adafruit.com/product/5000" - }, - "adafruit_qt_py_c3": { - "$description": "A tiny ESP32-C3 board.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-adafruit_qt_py_c3-0x0.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "$services": [ - { - "name": "buttonBOOT", - "pin": 9, - "service": "button" - } - ], - "archId": "esp32c3", - "devName": "Adafruit QT Py ESP32-C3 WiFi", - "i2c": { - "$connector": "Qwiic", - "pinSCL": "SCL_D5", - "pinSDA": "SDA_D4" - }, - "id": "adafruit_qt_py_c3", - "led": { - "pin": 2, - "type": 1 - }, - "log": { - "pinTX": "TX_D6" - }, - "pins": { - "A0_D0": 4, - "A1_D1": 3, - "A2_D2": 1, - "A3_D3": 0, - "MISO_D9": 8, - "MOSI_D10": 7, - "RX_D7": 20, - "SCK_D8": 10, - "SCL_D5": 6, - "SDA_D4": 5, - "TX_D6": 21 - }, - "productId": "0x3693d40b", - "url": "https://www.adafruit.com/product/5405" - }, - "esp32_bare": { - "$description": "Bare ESP32 without any default functions for pins.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32-esp32_bare-0x1000.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "archId": "esp32", - "devName": "Espressif ESP32 (bare)", - "id": "esp32_bare", - "pins": { - "P13": 13, - "P14": 14, - "P18": 18, - "P19": 19, - "P21": 21, - "P22": 22, - "P23": 23, - "P25": 25, - "P26": 26, - "P27": 27, - "P32": 32, - "P33": 33, - "P34": 34, - "P35": 35, - "P36": 36, - "P39": 39, - "P4": 4 - }, - "productId": "0x3ff6ffeb", - "url": "https://www.espressif.com/en/products/socs/esp32" - }, - "esp32_c3fh4_rgb": { - "$description": "A tiny ESP32-C3 board with 5x5 LED array.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-esp32_c3fh4_rgb-0x0.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "$services": [ - { - "name": "buttonBOOT", - "pin": 9, - "service": "button" - } - ], - "archId": "esp32c3", - "devName": "ESP32-C3FH4-RGB", - "i2c": { - "$connector": "Qwiic", - "pinSCL": 1, - "pinSDA": 0 - }, - "id": "esp32_c3fh4_rgb", - "led": { - "isMono": true, - "pin": 10 - }, - "log": { - "pinTX": 21 - }, - "pins": { - "LEDS": 8, - "P2": 2, - "P20": 20, - "P3": 3, - "P4": 4, - "P5": 5, - "P6": 6, - "P7": 7 - }, - "productId": "0x3a90885c", - "url": "https://github.com/01Space/ESP32-C3FH4-RGB" - }, - "esp32_devkit_c": { - "$description": "There are currently issues with serial chip on these, best avoid. ESP32-DevKitC development board. This will also work with DOIT DevkitV1, NodeMCU ESP32, ... (search for 'esp32 devkit'). Some of these boards do not have the LED.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32-esp32_devkit_c-0x1000.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "$services": [ - { - "name": "buttonIO0", - "pin": 0, - "service": "button" - } - ], - "archId": "esp32", - "devName": "Espressif ESP32-DevKitC", - "id": "esp32_devkit_c", - "led": { - "pin": 2 - }, - "pins": { - "P13": 13, - "P14": 14, - "P18": 18, - "P19": 19, - "P21": 21, - "P22": 22, - "P23": 23, - "P25": 25, - "P26": 26, - "P27": 27, - "P32": 32, - "P33": 33, - "P34": 34, - "P35": 35, - "P4": 4, - "VN": 39, - "VP": 36 - }, - "productId": "0x3c507a05", - "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-devkitc.html" - }, - "esp32c3_bare": { - "$description": "A bare ESP32-C3 board without any pin functions.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-esp32c3_bare-0x0.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "$services": [ - { - "name": "buttonBOOT", - "pin": "P9", - "service": "button" - } - ], - "archId": "esp32c3", - "devName": "Espressif ESP32-C3 (bare)", - "id": "esp32c3_bare", - "log": { - "pinTX": "P21" - }, - "pins": { - "P0": 0, - "P1": 1, - "P10": 10, - "P2": 2, - "P20": 20, - "P21": 21, - "P3": 3, - "P4": 4, - "P5": 5, - "P6": 6, - "P7": 7, - "P8": 8, - "P9": 9 - }, - "productId": "0x3a1d89be", - "url": "https://www.espressif.com/en/products/socs/esp32-c3" - }, - "esp32c3_rust_devkit": { - "$description": "A ESP32-C3 dev-board from Espressif with IMU and Temp/Humidity sensor, originally for ESP32 Rust port.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-esp32c3_rust_devkit-0x0.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "$services": [ - { - "name": "buttonBOOT", - "pin": "P9", - "service": "button" - } - ], - "archId": "esp32c3", - "devName": "Espressif ESP32-C3-RUST-DevKit", - "i2c": { - "$connector": "Header", - "pinSCL": 8, - "pinSDA": 10 - }, - "id": "esp32c3_rust_devkit", - "led": { - "pin": 2, - "type": 1 - }, - "log": { - "pinTX": "P21" - }, - "pins": { - "LED": 7, - "P0": 0, - "P1": 1, - "P20": 20, - "P21": 21, - "P3": 3, - "P4": 4, - "P5": 5, - "P6": 6, - "P9": 9 - }, - "productId": "0x33f29c59", - "url": "https://github.com/esp-rs/esp-rust-board" - }, - "esp32c3_supermini": { - "$description": "A super tiny ESP32-C3 board.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-esp32c3_supermini-0x0.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "$services": [ - { - "name": "buttonBOOT", - "pin": 9, - "service": "button" - } - ], - "archId": "esp32c3", - "devName": "ESP32-C3 SuperMini", - "i2c": { - "pinSCL": 7, - "pinSDA": 6 - }, - "id": "esp32c3_supermini", - "led": { - "isMono": true, - "pin": 8 - }, - "log": { - "pinTX": 21 - }, - "pins": { - "P0": 0, - "P1": 1, - "P10": 10, - "P2": 2, - "P20": 20, - "P3": 3, - "P4": 4, - "P5": 5 - }, - "productId": "0x31606c1c", - "url": "https://banggood.com/ESP32-C3-Development-Board-ESP32-SuperMini-WiFi-Bluetooth-Mini-Module-p-1997449.html" - }, - "esp32s2_bare": { - "$description": "A bare ESP32-S2 board without any pin functions.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-esp32s2_bare-0x1000.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "archId": "esp32s2", - "devName": "Espressif ESP32-S2 (bare)", - "id": "esp32s2_bare", - "log": { - "pinTX": "P43" - }, - "pins": { - "P0": 0, - "P1": 1, - "P10": 10, - "P11": 11, - "P12": 12, - "P13": 13, - "P14": 14, - "P15": 15, - "P16": 16, - "P17": 17, - "P18": 18, - "P2": 2, - "P21": 21, - "P3": 3, - "P33": 33, - "P34": 34, - "P35": 35, - "P36": 36, - "P37": 37, - "P38": 38, - "P39": 39, - "P4": 4, - "P40": 40, - "P41": 41, - "P42": 42, - "P43": 43, - "P44": 44, - "P45": 45, - "P46": 46, - "P5": 5, - "P6": 6, - "P7": 7, - "P8": 8, - "P9": 9 - }, - "productId": "0x3f140dcc", - "url": "https://www.espressif.com/en/products/socs/esp32-s2" - }, - "esp32s3_bare": { - "$description": "A bare ESP32-S3 board without any pin functions.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s3-esp32s3_bare-0x0.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "archId": "esp32s3", - "devName": "Espressif ESP32-S3 (bare)", - "id": "esp32s3_bare", - "log": { - "pinTX": "P43" - }, - "pins": { - "#P35": 35, - "#P36": 36, - "#P37": 37, - "P0": 0, - "P1": 1, - "P10": 10, - "P11": 11, - "P12": 12, - "P13": 13, - "P14": 14, - "P15": 15, - "P16": 16, - "P17": 17, - "P18": 18, - "P2": 2, - "P21": 21, - "P3": 3, - "P33": 33, - "P34": 34, - "P38": 38, - "P39": 39, - "P4": 4, - "P40": 40, - "P41": 41, - "P42": 42, - "P43": 43, - "P44": 44, - "P45": 45, - "P46": 46, - "P47": 47, - "P48": 48, - "P5": 5, - "P6": 6, - "P7": 7, - "P8": 8, - "P9": 9 - }, - "productId": "0x3e121501", - "url": "https://www.espressif.com/en/products/socs/esp32-s3" - }, - "esp32s3_devkit_m": { - "$description": "ESP32-S3 DevKitM development board. Should also work for DevKitC.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s3-esp32s3_devkit_m-0x0.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "archId": "esp32s3", - "devName": "Espressif ESP32-S3 DevKitM", - "id": "esp32s3_devkit_m", - "led": { - "pin": "P48", - "type": 1 - }, - "log": { - "pinTX": "P43" - }, - "pins": { - "P0": 0, - "P1": 1, - "P10": 10, - "P11": 11, - "P12": 12, - "P13": 13, - "P14": 14, - "P15": 15, - "P16": 16, - "P17": 17, - "P18": 18, - "P2": 2, - "P21": 21, - "P3": 3, - "P33": 33, - "P34": 34, - "P38": 38, - "P39": 39, - "P4": 4, - "P40": 40, - "P41": 41, - "P42": 42, - "P43": 43, - "P45": 45, - "P46": 46, - "P47": 47, - "P48": 48, - "P5": 5, - "P6": 6, - "P7": 7, - "P8": 8, - "P9": 9 - }, - "productId": "0x3574d277", - "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitm-1.html" - }, - "feather_s2": { - "$description": "ESP32-S2 based development board in a Feather format.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-feather_s2-0x1000.bin", - "$pins": { - "P1": "D9", - "P10": "D12", - "P11": "D13", - "P12": "A3", - "P14": "A2", - "P17": "A0", - "P18": "A1", - "P3": "D10", - "P33": "D5", - "P38": "D6", - "P5": "A5_D25", - "P6": "A4_D24", - "P7": "D11", - "SDI": "MISO", - "SDO": "MOSI" - }, - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "$services": [ - { - "name": "buttonBOOT", - "pin": 0, - "service": "button" + "archs": { + "esp32": { + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32archconfig.schema.json", + "bareUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32-esp32_bare-0x1000.bin", + "binFlashOffset": "0x1000", + "binGenericFlashOffset": "0x10000", + "dcfgOffset": "0x9000", + "flashPageSize": 4096, + "fstorOffset": "0x1c0000", + "fstorPages": 64, + "id": "esp32", + "name": "ESP32", + "pins": { + "analogIn": "32-39", + "analogOut": "25,26", + "boot": "0,2,5,12,15", + "bootUart": "1,3", + "debug": "12-15", + "flash": "6-11", + "input": "io,34,35,36,37,38,39", + "io": "boot,4,13,14,18,19,21,22,23,25,26,27,32,33", + "psram": "16,17", + "touch": "0,2,4,12-15,27,32,33" + }, + "repoUrl": "https://github.com/microsoft/devicescript-esp32" }, - { - "name": "ambientLight", - "pin": 4, - "service": "analog:lightLevel" - } - ], - "archId": "esp32s2", - "devName": "Unexpected Maker FeatherS2 ESP32-S2", - "i2c": { - "$connector": "Qwiic", - "pinSCL": "SCL", - "pinSDA": "SDA" - }, - "id": "feather_s2", - "led": { - "pin": 40, - "pinCLK": 45, - "type": 2 - }, - "log": { - "pinTX": "TX_D1" - }, - "pins": { - "A0": 17, - "A1": 18, - "A2": 14, - "A3": 12, - "A4_D24": 6, - "A5_D25": 5, - "D10": 3, - "D11": 7, - "D12": 10, - "D13": 11, - "D5": 33, - "D6": 38, - "D9": 1, - "LED0": 13, - "LED_PWR": 21, - "MISO": 37, - "MOSI": 35, - "RX_D0": 44, - "SCK": 36, - "SCL": 9, - "SDA": 8, - "TX_D1": 43 - }, - "productId": "0x3126f707", - "sPin": { - "LED_PWR": 1 - }, - "url": "https://unexpectedmaker.com/shop/feathers2-esp32-s2" - }, - "kittenbot_grapebit_esp32c3": { - "$description": "A round board packed with IMU, buzzer, motor control, 4 RGB LEDs, and Jacdac.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-kittenbot_grapebit_esp32c3-0x0.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "$services": [ - { - "name": "buttonA", - "pin": 21, - "service": "button" + "esp32c3": { + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32archconfig.schema.json", + "bareUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-esp32c3_bare-0x0.bin", + "binFlashOffset": 0, + "binGenericFlashOffset": "0x10000", + "dcfgOffset": "0x9000", + "flashPageSize": 4096, + "fstorOffset": "0x1c0000", + "fstorPages": 64, + "id": "esp32c3", + "name": "ESP32-C3", + "pins": { + "analogIn": "0-4", + "boot": "2,8,9", + "bootUart": "20,21", + "debug": "4-7", + "flash": "11-17", + "io": "0-10,bootUart", + "usb": "18,19" + }, + "repoUrl": "https://github.com/microsoft/devicescript-esp32" }, - { - "name": "buttonB", - "pin": 9, - "service": "button" + "esp32s2": { + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32archconfig.schema.json", + "bareUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-esp32s2_bare-0x1000.bin", + "binFlashOffset": "0x1000", + "binGenericFlashOffset": "0x10000", + "dcfgOffset": "0x9000", + "flashPageSize": 4096, + "fstorOffset": "0x1c0000", + "fstorPages": 64, + "id": "esp32s2", + "name": "ESP32-S2", + "pins": { + "analogIn": "1-10", + "analogOut": "17,18", + "boot": "0,45,46", + "debug": "39-42", + "flash": "26-32", + "input": "io,46", + "io": "0-18,21,33-45", + "usb": "19,20" + }, + "repoUrl": "https://github.com/microsoft/devicescript-esp32" }, - { - "name": "music", - "pin": 3, - "service": "buzzer" + "esp32s3": { + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32archconfig.schema.json", + "bareUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s3-esp32s3_bare-0x0.bin", + "binFlashOffset": "0x0", + "binGenericFlashOffset": "0x10000", + "dcfgOffset": "0x9000", + "flashPageSize": 4096, + "fstorOffset": "0x1c0000", + "fstorPages": 64, + "id": "esp32s3", + "name": "ESP32-S3", + "pins": { + "analogIn": "1-10", + "analogOut": "17,18", + "boot": "0,45,46", + "debug": "39-42", + "flash": "26-32,35-37", + "input": "io", + "io": "0-18,21,33-48", + "usb": "19,20" + }, + "repoUrl": "https://github.com/microsoft/devicescript-esp32" }, - { - "dir": -1, - "en": -1, - "name": "M1", - "pwm": 1, - "service": "motor" + "rp2040": { + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040archconfig.schema.json", + "bareUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040-pico.uf2", + "dcfgOffset": "0x100dc000", + "flashPageSize": 4096, + "fstorOffset": "0x100e0000", + "fstorPages": 32, + "id": "rp2040", + "name": "RP2040", + "pins": { + "analogIn": "26-29", + "io": "0-29" + }, + "repoUrl": "https://github.com/microsoft/devicescript-pico", + "uf2Align": 4096 }, - { - "dir": -1, - "en": -1, - "name": "M2", - "pwm": 4, - "service": "motor" - } - ], - "archId": "esp32c3", - "devName": "KittenBot Grape:Bit ESP32-C3", - "i2c": { - "pinSCL": 7, - "pinSDA": 6 - }, - "id": "kittenbot_grapebit_esp32c3", - "jacdac": { - "$connector": "Jacdac", - "pin": 5 - }, - "led": { - "num": 4, - "pin": 10, - "type": 1 - }, - "pins": { - "P1": 2, - "P2": 0 - }, - "productId": "0x38ccab8d", - "url": "https://www.kittenbot.cc/products/kittenbot-grapebit" - }, - "kittenbot_nanoscript": { - "$description": "A RP2040 board featuring a Jacdac connector, compatible with SMT-mounting.", - "$fwUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040-kittenbot_nanoscript.uf2", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040deviceconfig.schema.json", - "archId": "rp2040", - "devName": "KittenBot NanoScript 1.0", - "id": "kittenbot_nanoscript", - "jacdac": { - "$connector": "Jacdac", - "pin": 9 - }, - "led": { - "rgb": [ - { - "mult": 250, - "pin": 16 - }, - { - "mult": 60, - "pin": 14 - }, - { - "mult": 150, - "pin": 15 - } - ] - }, - "log": { - "baud": 115200, - "pinTX": 0 - }, - "pins": { - "@HILIM": 18, - "P1": 1, - "P10": 10, - "P2": 2, - "P24": 24, - "P25": 25, - "P26": 26, - "P27": 27, - "P28": 28, - "P29": 29, - "P3": 3, - "P4": 4, - "P5": 5, - "P6": 6, - "P7": 7 - }, - "productId": "0x37c2fcc5", - "sPin": { - "#": "enable high power limiter mode", - "@HILIM": 0 - }, - "services": [ - { - "faultIgnoreMs": 1000, - "mode": 3, - "name": "power", - "pinEn": 22, - "pinFault": 12, - "pinLedPulse": 13, - "pinPulse": 8, - "pinUsbDetect": 11, - "service": "power" - } - ], - "url": "https://www.kittenbot.cc/products/devicescript-enhanced-development-board-with-rp2040" - }, - "msr124": { - "$description": "Prototype board", - "$fwUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040-msr124.uf2", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040deviceconfig.schema.json", - "archId": "rp2040", - "devName": "MSR RP2040 Brain 124 v0.1", - "id": "msr124", - "jacdac": { - "$connector": "Jacdac", - "pin": 9 - }, - "led": { - "rgb": [ - { - "mult": 250, - "pin": 16 - }, - { - "mult": 60, - "pin": 14 - }, - { - "mult": 150, - "pin": 15 - } - ] - }, - "log": { - "baud": 115200, - "pinTX": 0 - }, - "pins": { - "@HILIM": 18, - "P1": 1, - "P10": 10, - "P2": 2, - "P24": 24, - "P25": 25, - "P26": 26, - "P27": 27, - "P28": 28, - "P29": 29, - "P3": 3, - "P4": 4, - "P5": 5, - "P6": 6, - "P7": 7 - }, - "productId": "0x3875e80d", - "sPin": { - "#": "enable high power limiter mode", - "@HILIM": 0 - }, - "services": [ - { - "faultIgnoreMs": 1000, - "mode": 3, - "name": "power", - "pinEn": 22, - "pinFault": 12, - "pinLedPulse": 13, - "pinPulse": 8, - "pinUsbDetect": 11, - "service": "power" - } - ] - }, - "msr207_v42": { - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-msr207_v42-0x1000.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "archId": "esp32s2", - "devName": "MSR JM Brain S2-mini 207 v4.2", - "id": "msr207_v42", - "jacdac": { - "$connector": "Jacdac", - "pin": 17 - }, - "led": { - "rgb": [ - { - "mult": 250, - "pin": 8 - }, - { - "mult": 60, - "pin": 7 - }, - { - "mult": 150, - "pin": 6 - } - ] - }, - "log": { - "pinTX": 43 - }, - "pins": { - "P33": 33, - "P34": 34 - }, - "productId": "0x322e0e64", - "sd": { - "pinCS": 38, - "pinMISO": 37, - "pinMOSI": 35, - "pinSCK": 36 - }, - "services": [ - { - "faultIgnoreMs": 100, - "mode": 0, - "name": "power", - "pinEn": 2, - "pinFault": 13, - "service": "power" + "rp2040w": { + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040archconfig.schema.json", + "bareUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040w-pico_w.uf2", + "dcfgOffset": "0x100dc000", + "flashPageSize": 4096, + "fstorOffset": "0x100e0000", + "fstorPages": 32, + "id": "rp2040w", + "name": "RP2040 + CYW43 WiFi", + "pins": { + "analogIn": "26-28", + "io": "0-22,analogIn", + "wifi": "23,24,25,29" + }, + "repoUrl": "https://github.com/microsoft/devicescript-pico", + "uf2Align": 4096 } - ] }, - "msr207_v43": { - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-msr207_v43-0x1000.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "archId": "esp32s2", - "devName": "MSR JM Brain S2-mini 207 v4.3", - "id": "msr207_v43", - "jacdac": { - "$connector": "Jacdac", - "pin": 17 - }, - "led": { - "rgb": [ - { - "mult": 250, - "pin": 8 - }, - { - "mult": 60, - "pin": 7 - }, - { - "mult": 150, - "pin": 6 - } - ] - }, - "log": { - "pinTX": 43 - }, - "pins": { - "P33": 33, - "P34": 34 - }, - "productId": "0x322e0e64", - "sd": { - "pinCS": 38, - "pinMISO": 37, - "pinMOSI": 35, - "pinSCK": 36 - }, - "services": [ - { - "faultIgnoreMs": 100, - "mode": 1, - "name": "power", - "pinEn": 2, - "pinFault": 13, - "service": "power" - } - ] - }, - "msr48": { - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-msr48-0x1000.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "archId": "esp32s2", - "devName": "MSR JacdacIoT 48 v0.2", - "i2c": { - "$connector": "Qwiic", - "pinSCL": 10, - "pinSDA": 9 - }, - "id": "msr48", - "jacdac": { - "$connector": "Jacdac", - "pin": 17 - }, - "led": { - "rgb": [ - { - "mult": 250, - "pin": 8 - }, - { - "mult": 60, - "pin": 7 - }, - { - "mult": 150, - "pin": 6 - } - ] - }, - "log": { - "pinTX": 43 - }, - "pins": { - "P33": 33, - "P34": 34, - "P35": 35, - "P36": 36, - "RX": 38, - "TX": 37 - }, - "productId": "0x3de1398b", - "services": [ - { - "faultIgnoreMs": 100, - "mode": 0, - "name": "power", - "pinEn": 2, - "pinFault": 13, - "service": "power" - } - ] - }, - "msr59": { - "$description": "Prototype board", - "$fwUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040-msr59.uf2", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040deviceconfig.schema.json", - "archId": "rp2040", - "devName": "MSR Brain RP2040 59 v0.1", - "id": "msr59", - "jacdac": { - "$connector": "Jacdac", - "pin": 9 - }, - "led": { - "rgb": [ - { - "mult": 250, - "pin": 11 - }, - { - "mult": 60, - "pin": 13 - }, - { - "mult": 150, - "pin": 15 - } - ] - }, - "log": { - "baud": 115200, - "pinTX": 2 - }, - "pins": { - "P26": 26, - "P27": 27, - "P3": 3, - "P4": 4, - "P5": 5, - "P6": 6 - }, - "productId": "0x35a678a3", - "services": [ - { - "faultIgnoreMs": 100, - "mode": 2, - "name": "power", - "pinEn": 19, - "pinFault": 25, - "service": "power" - } - ] - }, - "pico": { - "$description": "RP2040 board from Raspberry Pi.", - "$fwUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040-pico.uf2", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040deviceconfig.schema.json", - "archId": "rp2040", - "devName": "Raspberry Pi Pico", - "id": "pico", - "led": { - "#": "type=100 - special handling for Pico LED", - "pin": 25, - "type": 100 - }, - "pins": { - "GP0": 0, - "GP1": 1, - "GP10": 10, - "GP11": 11, - "GP12": 12, - "GP13": 13, - "GP14": 14, - "GP15": 15, - "GP16": 16, - "GP17": 17, - "GP18": 18, - "GP19": 19, - "GP2": 2, - "GP20": 20, - "GP21": 21, - "GP22": 22, - "GP26": 26, - "GP27": 27, - "GP28": 28, - "GP3": 3, - "GP4": 4, - "GP5": 5, - "GP6": 6, - "GP7": 7, - "GP8": 8, - "GP9": 9 - }, - "productId": "0x3f6e1f0c", - "url": "https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html" - }, - "pico_w": { - "$description": "RP2040 board from Raspberry Pi with a WiFi chip.", - "$fwUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040w-pico_w.uf2", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040deviceconfig.schema.json", - "archId": "rp2040w", - "devName": "Raspberry Pi Pico W", - "id": "pico_w", - "led": { - "#": "type=100 - special handling for Pico LED", - "pin": 25, - "type": 100 - }, - "pins": { - "GP0": 0, - "GP1": 1, - "GP10": 10, - "GP11": 11, - "GP12": 12, - "GP13": 13, - "GP14": 14, - "GP15": 15, - "GP16": 16, - "GP17": 17, - "GP18": 18, - "GP19": 19, - "GP2": 2, - "GP20": 20, - "GP21": 21, - "GP22": 22, - "GP26": 26, - "GP27": 27, - "GP28": 28, - "GP3": 3, - "GP4": 4, - "GP5": 5, - "GP6": 6, - "GP7": 7, - "GP8": 8, - "GP9": 9 - }, - "productId": "0x3a513204", - "url": "https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html" - }, - "seeed_xiao_esp32c3": { - "$description": "A tiny ESP32-C3 board.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-seeed_xiao_esp32c3-0x0.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "$services": [ - { - "name": "buttonBOOT", - "pin": "MISO_D9", - "service": "button" + "boards": { + "adafruit_feather_esp32_s2": { + "$description": "A S2 Feather from Adafruit. (untested)", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-adafruit_feather_esp32_s2-0x1000.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "archId": "esp32s2", + "devName": "Adafruit Feather ESP32-S2", + "i2c": { + "$connector": "Qwiic", + "pinSCL": "SCL", + "pinSDA": "SDA" + }, + "id": "adafruit_feather_esp32_s2", + "led": { + "pin": 33, + "type": 1 + }, + "log": { + "pinTX": 43 + }, + "pins": { + "A0": 18, + "A1": 17, + "A2": 16, + "A3": 15, + "A4_D24": 14, + "A5_D25": 8, + "D10": 10, + "D11": 11, + "D12": 12, + "D13": 13, + "D5": 5, + "D6": 6, + "D9": 9, + "LED_PWR": 21, + "MISO": 37, + "MOSI": 35, + "PWR": 7, + "RX_D0": 38, + "SCK": 36, + "SCL": 4, + "SDA": 3, + "TX_D1": 39 + }, + "productId": "0x3c2ed99e", + "sPin": { + "LED_PWR": 1, + "PWR": 1 + }, + "url": "https://www.adafruit.com/product/5000" + }, + "adafruit_qt_py_c3": { + "$description": "A tiny ESP32-C3 board.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-adafruit_qt_py_c3-0x0.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "$services": [ + { + "name": "buttonBOOT", + "pin": 9, + "service": "button" + } + ], + "archId": "esp32c3", + "devName": "Adafruit QT Py ESP32-C3 WiFi", + "i2c": { + "$connector": "Qwiic", + "pinSCL": "SCL_D5", + "pinSDA": "SDA_D4" + }, + "id": "adafruit_qt_py_c3", + "led": { + "pin": 2, + "type": 1 + }, + "log": { + "pinTX": "TX_D6" + }, + "pins": { + "A0_D0": 4, + "A1_D1": 3, + "A2_D2": 1, + "A3_D3": 0, + "MISO_D9": 8, + "MOSI_D10": 7, + "RX_D7": 20, + "SCK_D8": 10, + "SCL_D5": 6, + "SDA_D4": 5, + "TX_D6": 21 + }, + "productId": "0x3693d40b", + "url": "https://www.adafruit.com/product/5405" + }, + "esp32_bare": { + "$description": "Bare ESP32 without any default functions for pins.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32-esp32_bare-0x1000.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "archId": "esp32", + "devName": "Espressif ESP32 (bare)", + "id": "esp32_bare", + "pins": { + "P13": 13, + "P14": 14, + "P18": 18, + "P19": 19, + "P21": 21, + "P22": 22, + "P23": 23, + "P25": 25, + "P26": 26, + "P27": 27, + "P32": 32, + "P33": 33, + "P34": 34, + "P35": 35, + "P36": 36, + "P39": 39, + "P4": 4 + }, + "productId": "0x3ff6ffeb", + "url": "https://www.espressif.com/en/products/socs/esp32" + }, + "esp32_c3fh4_rgb": { + "$description": "A tiny ESP32-C3 board with 5x5 LED array.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-esp32_c3fh4_rgb-0x0.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "$services": [ + { + "name": "buttonBOOT", + "pin": 9, + "service": "button" + } + ], + "archId": "esp32c3", + "devName": "ESP32-C3FH4-RGB", + "i2c": { + "$connector": "Qwiic", + "pinSCL": 1, + "pinSDA": 0 + }, + "id": "esp32_c3fh4_rgb", + "led": { + "isMono": true, + "pin": 10 + }, + "log": { + "pinTX": 21 + }, + "pins": { + "LEDS": 8, + "P2": 2, + "P20": 20, + "P3": 3, + "P4": 4, + "P5": 5, + "P6": 6, + "P7": 7 + }, + "productId": "0x3a90885c", + "url": "https://github.com/01Space/ESP32-C3FH4-RGB" + }, + "esp32_devkit_c": { + "$description": "There are currently issues with serial chip on these, best avoid. ESP32-DevKitC development board. This will also work with DOIT DevkitV1, NodeMCU ESP32, ... (search for 'esp32 devkit'). Some of these boards do not have the LED.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32-esp32_devkit_c-0x1000.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "$services": [ + { + "name": "buttonIO0", + "pin": 0, + "service": "button" + } + ], + "archId": "esp32", + "devName": "Espressif ESP32-DevKitC", + "id": "esp32_devkit_c", + "led": { + "pin": 2 + }, + "pins": { + "P13": 13, + "P14": 14, + "P18": 18, + "P19": 19, + "P21": 21, + "P22": 22, + "P23": 23, + "P25": 25, + "P26": 26, + "P27": 27, + "P32": 32, + "P33": 33, + "P34": 34, + "P35": 35, + "P4": 4, + "VN": 39, + "VP": 36 + }, + "productId": "0x3c507a05", + "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-devkitc.html" + }, + "esp32c3_bare": { + "$description": "A bare ESP32-C3 board without any pin functions.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-esp32c3_bare-0x0.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "$services": [ + { + "name": "buttonBOOT", + "pin": "P9", + "service": "button" + } + ], + "archId": "esp32c3", + "devName": "Espressif ESP32-C3 (bare)", + "id": "esp32c3_bare", + "log": { + "pinTX": "P21" + }, + "pins": { + "P0": 0, + "P1": 1, + "P10": 10, + "P2": 2, + "P20": 20, + "P21": 21, + "P3": 3, + "P4": 4, + "P5": 5, + "P6": 6, + "P7": 7, + "P8": 8, + "P9": 9 + }, + "productId": "0x3a1d89be", + "url": "https://www.espressif.com/en/products/socs/esp32-c3" + }, + "esp32c3_rust_devkit": { + "$description": "A ESP32-C3 dev-board from Espressif with IMU and Temp/Humidity sensor, originally for ESP32 Rust port.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-esp32c3_rust_devkit-0x0.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "$services": [ + { + "name": "buttonBOOT", + "pin": "P9", + "service": "button" + } + ], + "archId": "esp32c3", + "devName": "Espressif ESP32-C3-RUST-DevKit", + "i2c": { + "$connector": "Header", + "pinSCL": 8, + "pinSDA": 10 + }, + "id": "esp32c3_rust_devkit", + "led": { + "pin": 2, + "type": 1 + }, + "log": { + "pinTX": "P21" + }, + "pins": { + "LED": 7, + "P0": 0, + "P1": 1, + "P20": 20, + "P21": 21, + "P3": 3, + "P4": 4, + "P5": 5, + "P6": 6, + "P9": 9 + }, + "productId": "0x33f29c59", + "url": "https://github.com/esp-rs/esp-rust-board" + }, + "esp32c3_supermini": { + "$description": "A super tiny ESP32-C3 board.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-esp32c3_supermini-0x0.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "$services": [ + { + "name": "buttonBOOT", + "pin": 9, + "service": "button" + } + ], + "archId": "esp32c3", + "devName": "ESP32-C3 SuperMini", + "i2c": { + "pinSCL": 7, + "pinSDA": 6 + }, + "id": "esp32c3_supermini", + "led": { + "isMono": true, + "pin": 8 + }, + "log": { + "pinTX": 21 + }, + "pins": { + "P0": 0, + "P1": 1, + "P10": 10, + "P2": 2, + "P20": 20, + "P3": 3, + "P4": 4, + "P5": 5 + }, + "productId": "0x31606c1c", + "url": "https://banggood.com/ESP32-C3-Development-Board-ESP32-SuperMini-WiFi-Bluetooth-Mini-Module-p-1997449.html" + }, + "esp32s2_bare": { + "$description": "A bare ESP32-S2 board without any pin functions.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-esp32s2_bare-0x1000.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "archId": "esp32s2", + "devName": "Espressif ESP32-S2 (bare)", + "id": "esp32s2_bare", + "log": { + "pinTX": "P43" + }, + "pins": { + "P0": 0, + "P1": 1, + "P10": 10, + "P11": 11, + "P12": 12, + "P13": 13, + "P14": 14, + "P15": 15, + "P16": 16, + "P17": 17, + "P18": 18, + "P2": 2, + "P21": 21, + "P3": 3, + "P33": 33, + "P34": 34, + "P35": 35, + "P36": 36, + "P37": 37, + "P38": 38, + "P39": 39, + "P4": 4, + "P40": 40, + "P41": 41, + "P42": 42, + "P43": 43, + "P44": 44, + "P45": 45, + "P46": 46, + "P5": 5, + "P6": 6, + "P7": 7, + "P8": 8, + "P9": 9 + }, + "productId": "0x3f140dcc", + "url": "https://www.espressif.com/en/products/socs/esp32-s2" + }, + "esp32s3_bare": { + "$description": "A bare ESP32-S3 board without any pin functions.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s3-esp32s3_bare-0x0.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "archId": "esp32s3", + "devName": "Espressif ESP32-S3 (bare)", + "id": "esp32s3_bare", + "log": { + "pinTX": "P43" + }, + "pins": { + "#P35": 35, + "#P36": 36, + "#P37": 37, + "P0": 0, + "P1": 1, + "P10": 10, + "P11": 11, + "P12": 12, + "P13": 13, + "P14": 14, + "P15": 15, + "P16": 16, + "P17": 17, + "P18": 18, + "P2": 2, + "P21": 21, + "P3": 3, + "P33": 33, + "P34": 34, + "P38": 38, + "P39": 39, + "P4": 4, + "P40": 40, + "P41": 41, + "P42": 42, + "P43": 43, + "P44": 44, + "P45": 45, + "P46": 46, + "P47": 47, + "P48": 48, + "P5": 5, + "P6": 6, + "P7": 7, + "P8": 8, + "P9": 9 + }, + "productId": "0x3e121501", + "url": "https://www.espressif.com/en/products/socs/esp32-s3" + }, + "esp32s3_devkit_m": { + "$description": "ESP32-S3 DevKitM development board. Should also work for DevKitC.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s3-esp32s3_devkit_m-0x0.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "archId": "esp32s3", + "devName": "Espressif ESP32-S3 DevKitM", + "id": "esp32s3_devkit_m", + "led": { + "pin": "P48", + "type": 1 + }, + "log": { + "pinTX": "P43" + }, + "pins": { + "P0": 0, + "P1": 1, + "P10": 10, + "P11": 11, + "P12": 12, + "P13": 13, + "P14": 14, + "P15": 15, + "P16": 16, + "P17": 17, + "P18": 18, + "P2": 2, + "P21": 21, + "P3": 3, + "P33": 33, + "P34": 34, + "P38": 38, + "P39": 39, + "P4": 4, + "P40": 40, + "P41": 41, + "P42": 42, + "P43": 43, + "P45": 45, + "P46": 46, + "P47": 47, + "P48": 48, + "P5": 5, + "P6": 6, + "P7": 7, + "P8": 8, + "P9": 9 + }, + "productId": "0x3574d277", + "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitm-1.html" + }, + "feather_s2": { + "$description": "ESP32-S2 based development board in a Feather format.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-feather_s2-0x1000.bin", + "$pins": { + "P1": "D9", + "P10": "D12", + "P11": "D13", + "P12": "A3", + "P14": "A2", + "P17": "A0", + "P18": "A1", + "P3": "D10", + "P33": "D5", + "P38": "D6", + "P5": "A5_D25", + "P6": "A4_D24", + "P7": "D11", + "SDI": "MISO", + "SDO": "MOSI" + }, + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "$services": [ + { + "name": "buttonBOOT", + "pin": 0, + "service": "button" + }, + { + "name": "ambientLight", + "pin": 4, + "service": "analog:lightLevel" + } + ], + "archId": "esp32s2", + "devName": "Unexpected Maker FeatherS2 ESP32-S2", + "i2c": { + "$connector": "Qwiic", + "pinSCL": "SCL", + "pinSDA": "SDA" + }, + "id": "feather_s2", + "led": { + "pin": 40, + "pinCLK": 45, + "type": 2 + }, + "log": { + "pinTX": "TX_D1" + }, + "pins": { + "A0": 17, + "A1": 18, + "A2": 14, + "A3": 12, + "A4_D24": 6, + "A5_D25": 5, + "D10": 3, + "D11": 7, + "D12": 10, + "D13": 11, + "D5": 33, + "D6": 38, + "D9": 1, + "LED0": 13, + "LED_PWR": 21, + "MISO": 37, + "MOSI": 35, + "RX_D0": 44, + "SCK": 36, + "SCL": 9, + "SDA": 8, + "TX_D1": 43 + }, + "productId": "0x3126f707", + "sPin": { + "LED_PWR": 1 + }, + "url": "https://unexpectedmaker.com/shop/feathers2-esp32-s2" + }, + "kittenbot_grapebit_esp32c3": { + "$description": "A round board packed with IMU, buzzer, motor control, 4 RGB LEDs, and Jacdac.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-kittenbot_grapebit_esp32c3-0x0.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "$services": [ + { + "name": "buttonA", + "pin": 21, + "service": "button" + }, + { + "name": "buttonB", + "pin": 9, + "service": "button" + }, + { + "name": "music", + "pin": 3, + "service": "buzzer" + }, + { + "dir": -1, + "en": -1, + "name": "M1", + "pwm": 1, + "service": "motor" + }, + { + "dir": -1, + "en": -1, + "name": "M2", + "pwm": 4, + "service": "motor" + } + ], + "archId": "esp32c3", + "devName": "KittenBot Grape:Bit ESP32-C3", + "i2c": { + "pinSCL": 7, + "pinSDA": 6 + }, + "id": "kittenbot_grapebit_esp32c3", + "jacdac": { + "$connector": "Jacdac", + "pin": 5 + }, + "led": { + "num": 4, + "pin": 10, + "type": 1 + }, + "pins": { + "P1": 2, + "P2": 0 + }, + "productId": "0x38ccab8d", + "url": "https://www.kittenbot.cc/products/kittenbot-grapebit" + }, + "kittenbot_nanoscript": { + "$description": "A RP2040 board featuring a Jacdac connector, compatible with SMT-mounting.", + "$fwUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040-kittenbot_nanoscript.uf2", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040deviceconfig.schema.json", + "archId": "rp2040", + "devName": "KittenBot NanoScript 1.0", + "id": "kittenbot_nanoscript", + "jacdac": { + "$connector": "Jacdac", + "pin": 9 + }, + "led": { + "rgb": [ + { + "mult": 250, + "pin": 16 + }, + { + "mult": 60, + "pin": 14 + }, + { + "mult": 150, + "pin": 15 + } + ] + }, + "log": { + "baud": 115200, + "pinTX": 0 + }, + "pins": { + "@HILIM": 18, + "P1": 1, + "P10": 10, + "P2": 2, + "P24": 24, + "P25": 25, + "P26": 26, + "P27": 27, + "P28": 28, + "P29": 29, + "P3": 3, + "P4": 4, + "P5": 5, + "P6": 6, + "P7": 7 + }, + "productId": "0x37c2fcc5", + "sPin": { + "#": "enable high power limiter mode", + "@HILIM": 0 + }, + "services": [ + { + "faultIgnoreMs": 1000, + "mode": 3, + "name": "power", + "pinEn": 22, + "pinFault": 12, + "pinLedPulse": 13, + "pinPulse": 8, + "pinUsbDetect": 11, + "service": "power" + } + ], + "url": "https://www.kittenbot.cc/products/devicescript-enhanced-development-board-with-rp2040" + }, + "msr124": { + "$description": "Prototype board", + "$fwUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040-msr124.uf2", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040deviceconfig.schema.json", + "archId": "rp2040", + "devName": "MSR RP2040 Brain 124 v0.1", + "id": "msr124", + "jacdac": { + "$connector": "Jacdac", + "pin": 9 + }, + "led": { + "rgb": [ + { + "mult": 250, + "pin": 16 + }, + { + "mult": 60, + "pin": 14 + }, + { + "mult": 150, + "pin": 15 + } + ] + }, + "log": { + "baud": 115200, + "pinTX": 0 + }, + "pins": { + "@HILIM": 18, + "P1": 1, + "P10": 10, + "P2": 2, + "P24": 24, + "P25": 25, + "P26": 26, + "P27": 27, + "P28": 28, + "P29": 29, + "P3": 3, + "P4": 4, + "P5": 5, + "P6": 6, + "P7": 7 + }, + "productId": "0x3875e80d", + "sPin": { + "#": "enable high power limiter mode", + "@HILIM": 0 + }, + "services": [ + { + "faultIgnoreMs": 1000, + "mode": 3, + "name": "power", + "pinEn": 22, + "pinFault": 12, + "pinLedPulse": 13, + "pinPulse": 8, + "pinUsbDetect": 11, + "service": "power" + } + ] + }, + "msr207_v42": { + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-msr207_v42-0x1000.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "archId": "esp32s2", + "devName": "MSR JM Brain S2-mini 207 v4.2", + "id": "msr207_v42", + "jacdac": { + "$connector": "Jacdac", + "pin": 17 + }, + "led": { + "rgb": [ + { + "mult": 250, + "pin": 8 + }, + { + "mult": 60, + "pin": 7 + }, + { + "mult": 150, + "pin": 6 + } + ] + }, + "log": { + "pinTX": 43 + }, + "pins": { + "P33": 33, + "P34": 34 + }, + "productId": "0x322e0e64", + "sd": { + "pinCS": 38, + "pinMISO": 37, + "pinMOSI": 35, + "pinSCK": 36 + }, + "services": [ + { + "faultIgnoreMs": 100, + "mode": 0, + "name": "power", + "pinEn": 2, + "pinFault": 13, + "service": "power" + } + ] + }, + "msr207_v43": { + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-msr207_v43-0x1000.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "archId": "esp32s2", + "devName": "MSR JM Brain S2-mini 207 v4.3", + "id": "msr207_v43", + "jacdac": { + "$connector": "Jacdac", + "pin": 17 + }, + "led": { + "rgb": [ + { + "mult": 250, + "pin": 8 + }, + { + "mult": 60, + "pin": 7 + }, + { + "mult": 150, + "pin": 6 + } + ] + }, + "log": { + "pinTX": 43 + }, + "pins": { + "P33": 33, + "P34": 34 + }, + "productId": "0x322e0e64", + "sd": { + "pinCS": 38, + "pinMISO": 37, + "pinMOSI": 35, + "pinSCK": 36 + }, + "services": [ + { + "faultIgnoreMs": 100, + "mode": 1, + "name": "power", + "pinEn": 2, + "pinFault": 13, + "service": "power" + } + ] + }, + "msr48": { + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32s2-msr48-0x1000.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "archId": "esp32s2", + "devName": "MSR JacdacIoT 48 v0.2", + "i2c": { + "$connector": "Qwiic", + "pinSCL": 10, + "pinSDA": 9 + }, + "id": "msr48", + "jacdac": { + "$connector": "Jacdac", + "pin": 17 + }, + "led": { + "rgb": [ + { + "mult": 250, + "pin": 8 + }, + { + "mult": 60, + "pin": 7 + }, + { + "mult": 150, + "pin": 6 + } + ] + }, + "log": { + "pinTX": 43 + }, + "pins": { + "P33": 33, + "P34": 34, + "P35": 35, + "P36": 36, + "RX": 38, + "TX": 37 + }, + "productId": "0x3de1398b", + "services": [ + { + "faultIgnoreMs": 100, + "mode": 0, + "name": "power", + "pinEn": 2, + "pinFault": 13, + "service": "power" + } + ] + }, + "msr59": { + "$description": "Prototype board", + "$fwUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040-msr59.uf2", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040deviceconfig.schema.json", + "archId": "rp2040", + "devName": "MSR Brain RP2040 59 v0.1", + "id": "msr59", + "jacdac": { + "$connector": "Jacdac", + "pin": 9 + }, + "led": { + "rgb": [ + { + "mult": 250, + "pin": 11 + }, + { + "mult": 60, + "pin": 13 + }, + { + "mult": 150, + "pin": 15 + } + ] + }, + "log": { + "baud": 115200, + "pinTX": 2 + }, + "pins": { + "P26": 26, + "P27": 27, + "P3": 3, + "P4": 4, + "P5": 5, + "P6": 6 + }, + "productId": "0x35a678a3", + "services": [ + { + "faultIgnoreMs": 100, + "mode": 2, + "name": "power", + "pinEn": 19, + "pinFault": 25, + "service": "power" + } + ] + }, + "pico": { + "$description": "RP2040 board from Raspberry Pi.", + "$fwUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040-pico.uf2", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040deviceconfig.schema.json", + "archId": "rp2040", + "devName": "Raspberry Pi Pico", + "id": "pico", + "led": { + "#": "type=100 - special handling for Pico LED", + "pin": 25, + "type": 100 + }, + "pins": { + "GP0": 0, + "GP1": 1, + "GP10": 10, + "GP11": 11, + "GP12": 12, + "GP13": 13, + "GP14": 14, + "GP15": 15, + "GP16": 16, + "GP17": 17, + "GP18": 18, + "GP19": 19, + "GP2": 2, + "GP20": 20, + "GP21": 21, + "GP22": 22, + "GP26": 26, + "GP27": 27, + "GP28": 28, + "GP3": 3, + "GP4": 4, + "GP5": 5, + "GP6": 6, + "GP7": 7, + "GP8": 8, + "GP9": 9 + }, + "productId": "0x3f6e1f0c", + "url": "https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html" + }, + "pico_w": { + "$description": "RP2040 board from Raspberry Pi with a WiFi chip.", + "$fwUrl": "https://github.com/microsoft/devicescript-pico/releases/latest/download/devicescript-rp2040w-pico_w.uf2", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-pico/main/boards/rp2040deviceconfig.schema.json", + "archId": "rp2040w", + "devName": "Raspberry Pi Pico W", + "id": "pico_w", + "led": { + "#": "type=100 - special handling for Pico LED", + "pin": 25, + "type": 100 + }, + "pins": { + "GP0": 0, + "GP1": 1, + "GP10": 10, + "GP11": 11, + "GP12": 12, + "GP13": 13, + "GP14": 14, + "GP15": 15, + "GP16": 16, + "GP17": 17, + "GP18": 18, + "GP19": 19, + "GP2": 2, + "GP20": 20, + "GP21": 21, + "GP22": 22, + "GP26": 26, + "GP27": 27, + "GP28": 28, + "GP3": 3, + "GP4": 4, + "GP5": 5, + "GP6": 6, + "GP7": 7, + "GP8": 8, + "GP9": 9 + }, + "productId": "0x3a513204", + "url": "https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html" + }, + "seeed_xiao_esp32c3": { + "$description": "A tiny ESP32-C3 board.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-seeed_xiao_esp32c3-0x0.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "$services": [ + { + "name": "buttonBOOT", + "pin": "MISO_D9", + "service": "button" + } + ], + "archId": "esp32c3", + "devName": "Seeed Studio XIAO ESP32C3", + "id": "seeed_xiao_esp32c3", + "log": { + "pinTX": "TX_D6" + }, + "pins": { + "A0_D0": 2, + "A1_D1": 3, + "A2_D2": 4, + "A3_D3": 5, + "MISO_D9": 9, + "MOSI_D10": 10, + "RX_D7": 20, + "SCK_D8": 8, + "SCL_D5": 7, + "SDA_D4": 6, + "TX_D6": 21 + }, + "productId": "0x3eff6b51", + "url": "https://www.seeedstudio.com/Seeed-XIAO-ESP32C3-p-5431.html" + }, + "seeed_xiao_esp32c3_msr218": { + "$description": "A tiny ESP32-C3 board mounted on base with Jacdac, Qwiic and Grove connectors.", + "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-seeed_xiao_esp32c3_msr218-0x0.bin", + "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", + "$services": [], + "archId": "esp32c3", + "devName": "Seeed Studio XIAO ESP32C3 with MSR218 base", + "i2c": { + "$connector": "Qwiic", + "pinSCL": "SCL", + "pinSDA": "SDA" + }, + "id": "seeed_xiao_esp32c3_msr218", + "jacdac": { + "$connector": "Jacdac", + "pin": "JD" + }, + "led": { + "pin": "LED", + "type": 1 + }, + "log": { + "pinTX": "TX" + }, + "pins": { + "A0": 2, + "A1": 3, + "A2": 4, + "D9": 9, + "JD": 5, + "LED": 10, + "LED_PWR": 8, + "RX": 20, + "SCL": 7, + "SDA": 6, + "TX": 21 + }, + "productId": "0x36b64827", + "sPin": { + "LED_PWR": 1 + }, + "url": "https://www.seeedstudio.com/Seeed-XIAO-ESP32C3-p-5431.html" } - ], - "archId": "esp32c3", - "devName": "Seeed Studio XIAO ESP32C3", - "id": "seeed_xiao_esp32c3", - "log": { - "pinTX": "TX_D6" - }, - "pins": { - "A0_D0": 2, - "A1_D1": 3, - "A2_D2": 4, - "A3_D3": 5, - "MISO_D9": 9, - "MOSI_D10": 10, - "RX_D7": 20, - "SCK_D8": 8, - "SCL_D5": 7, - "SDA_D4": 6, - "TX_D6": 21 - }, - "productId": "0x3eff6b51", - "url": "https://www.seeedstudio.com/Seeed-XIAO-ESP32C3-p-5431.html" - }, - "seeed_xiao_esp32c3_msr218": { - "$description": "A tiny ESP32-C3 board mounted on base with Jacdac, Qwiic and Grove connectors.", - "$fwUrl": "https://github.com/microsoft/devicescript-esp32/releases/latest/download/devicescript-esp32c3-seeed_xiao_esp32c3_msr218-0x0.bin", - "$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json", - "$services": [], - "archId": "esp32c3", - "devName": "Seeed Studio XIAO ESP32C3 with MSR218 base", - "i2c": { - "$connector": "Qwiic", - "pinSCL": "SCL", - "pinSDA": "SDA" - }, - "id": "seeed_xiao_esp32c3_msr218", - "jacdac": { - "$connector": "Jacdac", - "pin": "JD" - }, - "led": { - "pin": "LED", - "type": 1 - }, - "log": { - "pinTX": "TX" - }, - "pins": { - "A0": 2, - "A1": 3, - "A2": 4, - "D9": 9, - "JD": 5, - "LED": 10, - "LED_PWR": 8, - "RX": 20, - "SCL": 7, - "SDA": 6, - "TX": 21 - }, - "productId": "0x36b64827", - "sPin": { - "LED_PWR": 1 - }, - "url": "https://www.seeedstudio.com/Seeed-XIAO-ESP32C3-p-5431.html" } - } -} \ No newline at end of file +} diff --git a/compiler/src/logparser.ts b/compiler/src/logparser.ts index 4183effb58..782a567605 100644 --- a/compiler/src/logparser.ts +++ b/compiler/src/logparser.ts @@ -113,7 +113,10 @@ export class GenerationInfo { return this.lastBlock - this.firstBlock + 1 } - constructor(public parent: LogInfo, public index: number) {} + constructor( + public parent: LogInfo, + public index: number + ) {} toString() { return `gen ${this.index}, ${bytes( diff --git a/compiler/src/magic.ts b/compiler/src/magic.ts index 36dca694eb..15355870a7 100644 --- a/compiler/src/magic.ts +++ b/compiler/src/magic.ts @@ -12,7 +12,6 @@ function read32(buf: Uint8Array, pos: number) { ) } - export function checkMagic(img: Uint8Array) { return read32(img, 0) === BinFmt.MAGIC0 && read32(img, 4) === BinFmt.MAGIC1 } diff --git a/compiler/src/opwriter.ts b/compiler/src/opwriter.ts index dffea0f7a2..b5ba1ceac9 100644 --- a/compiler/src/opwriter.ts +++ b/compiler/src/opwriter.ts @@ -112,7 +112,10 @@ export class Value { export class CachedValue { numRefs = 1 _longTerm = false - constructor(public parent: OpWriter, public index: number) {} + constructor( + public parent: OpWriter, + public index: number + ) {} get packedIndex() { return packVarIndex(VariableKind.Cached, this.index) } @@ -204,7 +207,10 @@ export function nonEmittable() { } class Comment { - constructor(public offset: number, public comment: string) {} + constructor( + public offset: number, + public comment: string + ) {} } export enum VariableKind { @@ -260,7 +266,10 @@ export class OpWriter { private lastReturnLocation = -1 private closureRefs: Record = {} - constructor(public prog: TopOpWriter, public name: string) { + constructor( + public prog: TopOpWriter, + public name: string + ) { this.top = this.mkLabel("top") this.emitLabel(this.top) this.binary = new Uint8Array(128) @@ -849,7 +858,10 @@ export class DelayedCodeSection { returnLabel: Label body: ((wr: OpWriter) => void)[] = [] - constructor(public name: string, public parent: OpWriter) {} + constructor( + public name: string, + public parent: OpWriter + ) {} empty() { return this.body.length == 0 diff --git a/compiler/src/specgen.ts b/compiler/src/specgen.ts index 5f2eedc5db..bb1e902ac4 100644 --- a/compiler/src/specgen.ts +++ b/compiler/src/specgen.ts @@ -115,7 +115,7 @@ function ignoreSpec(info: jdspec.ServiceSpec) { SRV_CODAL_MESSAGE_BUS, SRV_DEVS_DBG, SRV_TCP, - SRV_GPIO + SRV_GPIO, ].indexOf(info.classIdentifier) > -1 ) } @@ -190,8 +190,8 @@ export function specToDeviceScript(info: jdspec.ServiceSpec): string { info.shortId == "_base" ? "ServerInterface" : isSensor - ? "SensorServerSpec" - : "BaseServerSpec" + ? "SensorServerSpec" + : "BaseServerSpec" srv += `interface ${clname}ServerSpec extends ${ibase} {\n` lkp += `interface ${clname}LookupSpec extends ServiceSpec {\n` @@ -258,10 +258,10 @@ export function specToDeviceScript(info: jdspec.ServiceSpec): string { r += wrapComment( "devs", cmt.comment + - pkt.fields - .filter(f => !!f) - .map(f => `@param ${f.name} - ${f.unit ?? ""}`) - .join("\n") + pkt.fields + .filter(f => !!f) + .map(f => `@param ${f.name} - ${f.unit ?? ""}`) + .join("\n") ) r += ` ${commandSig(info, pkt).sig}\n` srv += ` ${commandSig(info, pkt, true).sig}\n` @@ -315,7 +315,13 @@ function boardFile(binfo: DeviceConfig, arch: ArchConfig) { /** * Pin mapping and built-in services for ${binfo.devName} * - * ${binfo.$custom || !binfo.archId || !binfo.id ? 'This is a custom board definition.' : `@see {@link https://microsoft.github.io/devicescript/devices/${architectureFamily(binfo.archId)}/${binfo.id.replace(/_/g, "-")}/ Catalog}`} + * ${ + binfo.$custom || !binfo.archId || !binfo.id + ? "This is a custom board definition." + : `@see {@link https://microsoft.github.io/devicescript/devices/${architectureFamily( + binfo.archId + )}/${binfo.id.replace(/_/g, "-")}/ Catalog}` + } * ${binfo.url ? `@see {@link ${binfo.url} Store}` : ``} */ declare module "@dsboard/${binfo.id}" {\n` @@ -569,7 +575,7 @@ ${varname}.${sig} !isNumber && !isBoolean && !isString ? undefined : pkt.kind === "rw" - ? `- read and write + ? `- read and write \`\`\`ts ${nobuild} import { ${clname} } from "@devicescript/core" @@ -579,7 +585,7 @@ const value = await ${varname}.${pname}.read() await ${varname}.${pname}.write(value) \`\`\` ` - : `- read only + : `- read only \`\`\`ts ${nobuild} import { ${clname} } from "@devicescript/core" diff --git a/dap/src/devsdbgclient.ts b/dap/src/devsdbgclient.ts index 578b551a73..d848cf2c31 100644 --- a/dap/src/devsdbgclient.ts +++ b/dap/src/devsdbgclient.ts @@ -208,7 +208,10 @@ export class DevsDbgClient extends JDServiceClient { values: DevsValue[] = [] private valueMap: Record - constructor(service: JDService, public img: Image) { + constructor( + service: JDService, + public img: Image + ) { super(service) assert(service.serviceClass == SRV_DEVS_DBG) diff --git a/dap/src/tsconfig.json b/dap/src/tsconfig.json index f255d98343..d56423c300 100644 --- a/dap/src/tsconfig.json +++ b/dap/src/tsconfig.json @@ -1,11 +1,9 @@ { - "extends": "../../tsconfig-base.json", - "compilerOptions": { - "declarationDir": "../built/types", - "outDir": "../built", - "types": [] - }, - "include": [ - "." - ] -} \ No newline at end of file + "extends": "../../tsconfig-base.json", + "compilerOptions": { + "declarationDir": "../built/types", + "outDir": "../built", + "types": [] + }, + "include": ["."] +} diff --git a/dcfg/archconfig.schema.json b/dcfg/archconfig.schema.json index c76e5fd4a3..898b357373 100644 --- a/dcfg/archconfig.schema.json +++ b/dcfg/archconfig.schema.json @@ -3,10 +3,7 @@ "additionalProperties": false, "definitions": { "HexInt": { - "type": [ - "string", - "integer" - ] + "type": ["string", "integer"] } }, "properties": { @@ -39,19 +36,12 @@ }, "id": { "description": "Short identification of architecture.", - "examples": [ - "rp2040", - "rp2040w", - "esp32c3" - ], + "examples": ["rp2040", "rp2040w", "esp32c3"], "type": "string" }, "name": { "description": "Full name of architecture.", - "examples": [ - "RP2040 + CYW43 WiFi", - "ESP32-C3" - ], + "examples": ["RP2040 + CYW43 WiFi", "ESP32-C3"], "type": "string" }, "pins": { @@ -111,9 +101,7 @@ "type": "string" } }, - "required": [ - "io" - ], + "required": ["io"], "type": "object" }, "repoUrl": { @@ -125,11 +113,6 @@ "description": "Force alignment of the last page in the patched UF2 file.\nSet to 4096 on RP2040 because wof RP2040-E14." } }, - "required": [ - "dcfgOffset", - "id", - "name" - ], + "required": ["dcfgOffset", "id", "name"], "type": "object" } - diff --git a/dcfg/deviceconfig.schema.json b/dcfg/deviceconfig.schema.json index d94478da24..df65ad6159 100644 --- a/dcfg/deviceconfig.schema.json +++ b/dcfg/deviceconfig.schema.json @@ -11,16 +11,11 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "service": { - "enum": [ - "accelerometer" - ], + "enum": ["accelerometer"], "type": "string" }, "trX": { @@ -43,10 +38,7 @@ "type": "integer" } }, - "required": [ - "name", - "service" - ], + "required": ["name", "service"], "type": "object" }, "ButtonConfig": { @@ -62,10 +54,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "pin": { @@ -76,9 +65,7 @@ "type": "integer" }, "service": { - "enum": [ - "button" - ], + "enum": ["button"], "type": "string" }, "variant": { @@ -86,11 +73,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "BuzzerConfig": { @@ -106,10 +89,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "pin": { @@ -117,9 +97,7 @@ "type": "integer" }, "service": { - "enum": [ - "buzzer" - ], + "enum": ["buzzer"], "type": "string" }, "variant": { @@ -127,11 +105,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "FlexConfig": { @@ -143,10 +117,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "pinH": { @@ -159,9 +130,7 @@ "type": "integer" }, "service": { - "enum": [ - "flex" - ], + "enum": ["flex"], "type": "string" }, "variant": { @@ -169,20 +138,11 @@ "type": "integer" } }, - "required": [ - "name", - "pinH", - "pinL", - "pinM", - "service" - ], + "required": ["name", "pinH", "pinL", "pinM", "service"], "type": "object" }, "HexInt": { - "type": [ - "string", - "integer" - ] + "type": ["string", "integer"] }, "HidJoystickConfig": { "additionalProperties": false, @@ -193,16 +153,11 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "service": { - "enum": [ - "hidJoystick" - ], + "enum": ["hidJoystick"], "type": "string" }, "variant": { @@ -210,10 +165,7 @@ "type": "integer" } }, - "required": [ - "name", - "service" - ], + "required": ["name", "service"], "type": "object" }, "HidKeyboardConfig": { @@ -225,16 +177,11 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "service": { - "enum": [ - "hidKeyboard" - ], + "enum": ["hidKeyboard"], "type": "string" }, "variant": { @@ -242,10 +189,7 @@ "type": "integer" } }, - "required": [ - "name", - "service" - ], + "required": ["name", "service"], "type": "object" }, "HidMouseConfig": { @@ -257,16 +201,11 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "service": { - "enum": [ - "hidMouse" - ], + "enum": ["hidMouse"], "type": "string" }, "variant": { @@ -274,10 +213,7 @@ "type": "integer" } }, - "required": [ - "name", - "service" - ], + "required": ["name", "service"], "type": "object" }, "I2CConfig": { @@ -289,11 +225,7 @@ }, "$connector": { "description": "How I2C devices are attached.", - "enum": [ - "Grove", - "Header", - "Qwiic" - ], + "enum": ["Grove", "Header", "Qwiic"], "type": "string" }, "inst": { @@ -312,10 +244,7 @@ "type": "integer" } }, - "required": [ - "pinSCL", - "pinSDA" - ], + "required": ["pinSCL", "pinSDA"], "type": "object" }, "JacdacConfig": { @@ -326,19 +255,14 @@ "type": "string" }, "$connector": { - "enum": [ - "Header", - "Jacdac" - ], + "enum": ["Header", "Jacdac"], "type": "string" }, "pin": { "type": "integer" } }, - "required": [ - "pin" - ], + "required": ["pin"], "type": "object" }, "LedChannel": { @@ -358,9 +282,7 @@ "type": "integer" } }, - "required": [ - "pin" - ], + "required": ["pin"], "type": "object" }, "LedConfig": { @@ -420,10 +342,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "pin": { @@ -431,9 +350,7 @@ "type": "integer" }, "service": { - "enum": [ - "lightBulb" - ], + "enum": ["lightBulb"], "type": "string" }, "variant": { @@ -441,11 +358,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "LightLevelConfig": { @@ -457,10 +370,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "offset": { @@ -496,9 +406,7 @@ "type": "integer" }, "service": { - "enum": [ - "analog:lightLevel" - ], + "enum": ["analog:lightLevel"], "type": "string" }, "streamingItv": { @@ -511,11 +419,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "LogConfig": { @@ -535,9 +439,7 @@ "type": "integer" } }, - "required": [ - "pinTX" - ], + "required": ["pinTX"], "type": "object" }, "MotionConfig": { @@ -563,10 +465,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "pin": { @@ -574,9 +473,7 @@ "type": "integer" }, "service": { - "enum": [ - "motion" - ], + "enum": ["motion"], "type": "string" }, "variant": { @@ -584,11 +481,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "PinLabels": { @@ -1059,10 +952,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "offset": { @@ -1098,9 +988,7 @@ "type": "integer" }, "service": { - "enum": [ - "analog:potentiometer" - ], + "enum": ["analog:potentiometer"], "type": "string" }, "streamingItv": { @@ -1113,11 +1001,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "PowerConfig": { @@ -1138,10 +1022,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "pinEn": { @@ -1164,9 +1045,7 @@ "type": "integer" }, "service": { - "enum": [ - "power" - ], + "enum": ["power"], "type": "string" }, "variant": { @@ -1197,10 +1076,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "offset": { @@ -1236,9 +1112,7 @@ "type": "integer" }, "service": { - "enum": [ - "analog:reflectedLight" - ], + "enum": ["analog:reflectedLight"], "type": "string" }, "streamingItv": { @@ -1251,11 +1125,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "RelayConfig": { @@ -1283,10 +1153,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "pin": { @@ -1302,9 +1169,7 @@ "type": "integer" }, "service": { - "enum": [ - "relay" - ], + "enum": ["relay"], "type": "string" }, "variant": { @@ -1312,11 +1177,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "RotaryEncoderConfig": { @@ -1341,10 +1202,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "pin0": { @@ -1354,9 +1212,7 @@ "type": "integer" }, "service": { - "enum": [ - "rotaryEncoder" - ], + "enum": ["rotaryEncoder"], "type": "string" }, "variant": { @@ -1364,12 +1220,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin0", - "pin1", - "service" - ], + "required": ["name", "pin0", "pin1", "service"], "type": "object" }, "ServiceConfig": { @@ -1469,10 +1320,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "pin": { @@ -1484,9 +1332,7 @@ "type": "integer" }, "service": { - "enum": [ - "servo" - ], + "enum": ["servo"], "type": "string" }, "variant": { @@ -1494,11 +1340,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "SoilMoistureConfig": { @@ -1510,10 +1352,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "offset": { @@ -1549,9 +1388,7 @@ "type": "integer" }, "service": { - "enum": [ - "analog:soilMoisture" - ], + "enum": ["analog:soilMoisture"], "type": "string" }, "streamingItv": { @@ -1564,11 +1401,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "SoundLevelConfig": { @@ -1580,10 +1413,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "offset": { @@ -1619,9 +1449,7 @@ "type": "integer" }, "service": { - "enum": [ - "analog:soundLevel" - ], + "enum": ["analog:soundLevel"], "type": "string" }, "streamingItv": { @@ -1634,11 +1462,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "SwitchConfig": { @@ -1650,19 +1474,14 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "pin": { "type": "integer" }, "service": { - "enum": [ - "switch" - ], + "enum": ["switch"], "type": "string" }, "variant": { @@ -1670,11 +1489,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" }, "WaterLevelConfig": { @@ -1686,10 +1501,7 @@ }, "name": { "description": "Instance/role name to be assigned to service.", - "examples": [ - "buttonA", - "activityLed" - ], + "examples": ["buttonA", "activityLed"], "type": "string" }, "offset": { @@ -1725,9 +1537,7 @@ "type": "integer" }, "service": { - "enum": [ - "analog:waterLevel" - ], + "enum": ["analog:waterLevel"], "type": "string" }, "streamingItv": { @@ -1740,11 +1550,7 @@ "type": "integer" } }, - "required": [ - "name", - "pin", - "service" - ], + "required": ["name", "pin", "service"], "type": "object" } }, @@ -1777,17 +1583,12 @@ }, "archId": { "description": "Architecture for the board.\nThis is auto-populated from arch.json file.", - "examples": [ - "esp32c3", - "rp2040w" - ], + "examples": ["esp32c3", "rp2040w"], "type": "string" }, "devName": { "description": "Name of the device.", - "examples": [ - "Acme Corp. SuperIoT v1.3" - ], + "examples": ["Acme Corp. SuperIoT v1.3"], "type": "string" }, "devNetwork": { @@ -1812,9 +1613,7 @@ "productId": { "$ref": "#/definitions/HexInt", "description": "Identifier for a particular firmware running on a particular device, typically given as a hex number starting with 0x3.", - "examples": [ - "0x379ea214" - ] + "examples": ["0x379ea214"] }, "sPin": { "$ref": "#/definitions/Record", @@ -1836,10 +1635,6 @@ "type": "string" } }, - "required": [ - "devName", - "productId" - ], + "required": ["devName", "productId"], "type": "object" } - diff --git a/devs/compiler-tests/redefinition.ts b/devs/compiler-tests/redefinition.ts index e7bbee75b8..82105bc66c 100644 --- a/devs/compiler-tests/redefinition.ts +++ b/devs/compiler-tests/redefinition.ts @@ -14,9 +14,9 @@ function foo() { } const qq = 1 //! Duplicate identifier -function qq() { } //! Duplicate identifier +function qq() {} //! Duplicate identifier -function baz() { } //! Duplicate function implementation -function baz() { } //! Duplicate function implementation +function baz() {} //! Duplicate function implementation +function baz() {} //! Duplicate function implementation -foo() \ No newline at end of file +foo() diff --git a/devs/run-tests/02numbers.ts b/devs/run-tests/02numbers.ts index a8c93e682d..278c59f1b9 100644 --- a/devs/run-tests/02numbers.ts +++ b/devs/run-tests/02numbers.ts @@ -247,5 +247,3 @@ testNums() testNaN() testUnaryPlus() testEnumToString() - - diff --git a/devs/run-tests/06numbercollections.ts b/devs/run-tests/06numbercollections.ts index 93ac9a1c8d..2304e80cb6 100644 --- a/devs/run-tests/06numbercollections.ts +++ b/devs/run-tests/06numbercollections.ts @@ -48,4 +48,3 @@ function testNumCollection(): void { testNumCollection() testArrIncr() - diff --git a/devs/run-tests/07stringcollections.ts b/devs/run-tests/07stringcollections.ts index 888e25b5e6..b48072e209 100644 --- a/devs/run-tests/07stringcollections.ts +++ b/devs/run-tests/07stringcollections.ts @@ -34,5 +34,3 @@ function testUnionIndexer(): void { testStringCollection() testUnionIndexer() - - diff --git a/devs/run-tests/09postprefix.ts b/devs/run-tests/09postprefix.ts index c4adba3158..ada12b0aa4 100644 --- a/devs/run-tests/09postprefix.ts +++ b/devs/run-tests/09postprefix.ts @@ -31,4 +31,3 @@ function postPreFix() { } postPreFix() - diff --git a/devs/run-tests/11equalsoperator.ts b/devs/run-tests/11equalsoperator.ts index 126475c899..b7897ac884 100644 --- a/devs/run-tests/11equalsoperator.ts +++ b/devs/run-tests/11equalsoperator.ts @@ -42,5 +42,3 @@ function eqG() { } eqG() - - diff --git a/devs/run-tests/12referencecollection.ts b/devs/run-tests/12referencecollection.ts index dfb5e8a75b..f7c07b30a7 100644 --- a/devs/run-tests/12referencecollection.ts +++ b/devs/run-tests/12referencecollection.ts @@ -29,4 +29,3 @@ function testReccoll(): void { } testReccoll() - diff --git a/devs/run-tests/14lazyoperations.ts b/devs/run-tests/14lazyoperations.ts index 0221c3ebd8..80fa4f4be1 100644 --- a/devs/run-tests/14lazyoperations.ts +++ b/devs/run-tests/14lazyoperations.ts @@ -122,5 +122,3 @@ function testBoolCasts() { testLazyOps() testBoolCasts() - - diff --git a/devs/run-tests/17classes.ts b/devs/run-tests/17classes.ts index 8a29cdbb8c..ed3b5882ad 100644 --- a/devs/run-tests/17classes.ts +++ b/devs/run-tests/17classes.ts @@ -62,10 +62,13 @@ const seven = 7 class FooInit { baz: number qux = seven - constructor(public foo: number, public bar: string) { + constructor( + public foo: number, + public bar: string + ) { this.baz = this.foo + 1 } - semicolonTest() {}; + semicolonTest() {} } function classInit() { @@ -233,5 +236,3 @@ function testAnon() { } testAnon() - - diff --git a/devs/run-tests/19forof.ts b/devs/run-tests/19forof.ts index 66ef5c1973..bfd2100278 100644 --- a/devs/run-tests/19forof.ts +++ b/devs/run-tests/19forof.ts @@ -11,14 +11,14 @@ function testForOf() { let sum = 0 for (let e of arr) { msg("FO:" + e) - sum += (e - 1) + sum += e - 1 } assert(sum === 13, "fo1") msg("loop1 done") // make sure we incr reference count of the array during the loop execution for (let q of [3, 4, 12]) { - sum += (q - 2) + sum += q - 2 } assert(sum === 26, "fo2") @@ -48,7 +48,12 @@ function testForOf() { } // array concatenation - let yss = [[1, 2, 3], [4, 5], [6, 7, 8], [9, 10]] + let yss = [ + [1, 2, 3], + [4, 5], + [6, 7, 8], + [9, 10], + ] let concat: number[] = [] for (let ys of yss) { for (let y of ys) { @@ -63,7 +68,6 @@ function testForOf() { } assert(sum === 55, "fo7") - /* TODO nested closures let f = [] glb1 = 0 diff --git a/devs/run-tests/24arraymap.ts b/devs/run-tests/24arraymap.ts index 23e0b9c3f6..eaca4e203a 100644 --- a/devs/run-tests/24arraymap.ts +++ b/devs/run-tests/24arraymap.ts @@ -47,15 +47,15 @@ function testArrayEvery() { } function testArrayFill() { - assert([1, 2, 3].fill(4).join() === '4,4,4') - assert([1, 2, 3].fill(4, 1).join() === '1,4,4') - assert([1, 2, 3].fill(4, 1, 2).join() === '1,4,3') - assert([1, 2, 3].fill(4, 1, 1).join() === '1,2,3') - assert([1, 2, 3].fill(4, 3, 3).join() === '1,2,3') - assert([1, 2, 3].fill(4, -3, -2).join() === '4,2,3') - assert([1, 2, 3].fill(4, NaN, NaN).join() === '1,2,3') - assert([1, 2, 3].fill(4, 3, 5).join() === '1,2,3') - assert(Array(3).fill(4).join() === '4,4,4') + assert([1, 2, 3].fill(4).join() === "4,4,4") + assert([1, 2, 3].fill(4, 1).join() === "1,4,4") + assert([1, 2, 3].fill(4, 1, 2).join() === "1,4,3") + assert([1, 2, 3].fill(4, 1, 1).join() === "1,2,3") + assert([1, 2, 3].fill(4, 3, 3).join() === "1,2,3") + assert([1, 2, 3].fill(4, -3, -2).join() === "4,2,3") + assert([1, 2, 3].fill(4, NaN, NaN).join() === "1,2,3") + assert([1, 2, 3].fill(4, 3, 5).join() === "1,2,3") + assert(Array(3).fill(4).join() === "4,4,4") } function testArrayIndexOf() { let str = [1, 2, 2, 3] diff --git a/devs/run-tests/33inheritance.ts b/devs/run-tests/33inheritance.ts index 2b85385ba5..927e874513 100644 --- a/devs/run-tests/33inheritance.ts +++ b/devs/run-tests/33inheritance.ts @@ -174,5 +174,3 @@ run() run1() run2() run3() - - diff --git a/devs/run-tests/37objectliterals.ts b/devs/run-tests/37objectliterals.ts index 3be25206b3..cbed309405 100644 --- a/devs/run-tests/37objectliterals.ts +++ b/devs/run-tests/37objectliterals.ts @@ -51,7 +51,7 @@ function computedPropNames() { msg("computedPropNames") const f = 10 let p1 = 1 - const o = { f, [ ds._id("c") + "x"]: 12, 1: "x", [p1 + 2]: "b123" } + const o = { f, [ds._id("c") + "x"]: 12, 1: "x", [p1 + 2]: "b123" } check(o, "f:10,cx:12,1:x,3:b123") } @@ -160,5 +160,3 @@ function testLam() { runObjLit() testLam() - - diff --git a/devs/run-tests/39objectdestructuring.ts b/devs/run-tests/39objectdestructuring.ts index 4fd6b88b0a..b4fb0686d6 100644 --- a/devs/run-tests/39objectdestructuring.ts +++ b/devs/run-tests/39objectdestructuring.ts @@ -39,7 +39,7 @@ function arrayAssignment() { assert(a === 1, "[]") assert(c === 3, "[]") assert(b === "foo", "[1]") - + /* TODO destructor assignments ;[a, c] = [c, a] assert(a === 3, "[2]") @@ -62,7 +62,10 @@ function arrayAssignment() { } class ObjF { - constructor(public x: number, public y: string) {} + constructor( + public x: number, + public y: string + ) {} } function objectAssignment() { @@ -129,5 +132,3 @@ function runObjDestruct() { } runObjDestruct() - - diff --git a/devs/run-tests/48instanceof.ts b/devs/run-tests/48instanceof.ts index 5674bf63c8..77eac9e8e4 100644 --- a/devs/run-tests/48instanceof.ts +++ b/devs/run-tests/48instanceof.ts @@ -42,5 +42,3 @@ function run() { } run() - - diff --git a/devs/run-tests/52errors.ts b/devs/run-tests/52errors.ts index 69d72492af..bf97ca5ed9 100644 --- a/devs/run-tests/52errors.ts +++ b/devs/run-tests/52errors.ts @@ -22,7 +22,7 @@ function expectExn(f: () => void, ex: Function) { } } -async function expectExnAsync(f: ds.Callback, ex: Function) { +async function expectExnAsync(f: ds.Callback, ex: Function) { try { await f() ds.assert(false, "missing exn") @@ -126,5 +126,3 @@ async function testExn() { } await testExn() - - diff --git a/devs/run-tests/53roles.ts b/devs/run-tests/53roles.ts index c46633d210..5bbc781e24 100644 --- a/devs/run-tests/53roles.ts +++ b/devs/run-tests/53roles.ts @@ -4,7 +4,7 @@ function expectError(t: any, f: () => void) { let ok = false try { f() - } catch (e:any) { + } catch (e: any) { ds.assert(e instanceof t) ok = true } diff --git a/devs/run-tests/54jsx.tsx b/devs/run-tests/54jsx.tsx index fd65b5a6d1..325f0fb640 100644 --- a/devs/run-tests/54jsx.tsx +++ b/devs/run-tests/54jsx.tsx @@ -2,27 +2,27 @@ import * as ds from "@devicescript/core" - export function Button(prop: { label: string }) { return {prop.label} } function mkButtons() { - return - - {" and "} - + {" and "} +