From de4699c03c384b69be0029a2d2605f8220015352 Mon Sep 17 00:00:00 2001 From: pelikhan Date: Fri, 29 Sep 2023 11:48:19 -0700 Subject: [PATCH] add room for optional files --- compiler/src/board.ts | 11 ++++++++--- .../docs/devices/esp32/adafruit-feather-esp32-s2.mdx | 2 ++ website/docs/devices/esp32/adafruit-qt-py-c3.mdx | 2 ++ website/docs/devices/esp32/esp32-bare.mdx | 2 ++ website/docs/devices/esp32/esp32-c3fh4-rgb.mdx | 2 ++ website/docs/devices/esp32/esp32-devkit-c.mdx | 2 ++ website/docs/devices/esp32/esp32c3-bare.mdx | 2 ++ website/docs/devices/esp32/esp32c3-rust-devkit.mdx | 2 ++ website/docs/devices/esp32/esp32s2-bare.mdx | 2 ++ website/docs/devices/esp32/esp32s3-bare.mdx | 2 ++ website/docs/devices/esp32/esp32s3-devkit-m.mdx | 2 ++ website/docs/devices/esp32/feather-s2.mdx | 2 ++ .../docs/devices/esp32/kittenbot-grapebit-esp32c3.mdx | 2 ++ website/docs/devices/esp32/msr207-v42.mdx | 2 ++ website/docs/devices/esp32/msr207-v43.mdx | 2 ++ website/docs/devices/esp32/msr48.mdx | 2 ++ .../docs/devices/esp32/seeed-xiao-esp32c3-msr218.mdx | 2 ++ website/docs/devices/esp32/seeed-xiao-esp32c3.mdx | 2 ++ website/docs/devices/rp2040/kittenbot-nanoscript.mdx | 2 ++ website/docs/devices/rp2040/msr124.mdx | 2 ++ website/docs/devices/rp2040/msr59.mdx | 2 ++ website/docs/devices/rp2040/pico-w.mdx | 2 ++ website/docs/devices/rp2040/pico.mdx | 2 ++ 23 files changed, 52 insertions(+), 3 deletions(-) diff --git a/compiler/src/board.ts b/compiler/src/board.ts index 76b8a9a1d1..3565dc7917 100644 --- a/compiler/src/board.ts +++ b/compiler/src/board.ts @@ -130,6 +130,7 @@ function deviceConfigToMarkdown( const { id } = spec || {} const boardJson = normalizeDeviceConfig(board, { ignoreFirmwareUrl: true }) const info = boardInfo(board, arch) + const fdevId = boardIdToFilename(devId) if (info.errors?.length) { console.error(`errors in ${board.id}:\n${info.errors.join("\n")}`) @@ -149,9 +150,9 @@ description: ${devName} : undefined, `\n## Features\n`, ...info.features.map(f => `- ${f}`), - `{@import optional ./${id}-features.mdp}`, + `{@import optional ./${fdevId}-features.mdp}`, ...info.services.map(f => `- Service: ${f}`), - `{@import optional ./${id}-services.mdp}`, + `{@import optional ./${fdevId}-services.mdp}`, !boardJson.i2c && ` :::caution @@ -212,6 +213,10 @@ ${JSON.stringify(boardJson, null, 4)} } } +function boardIdToFilename(boardid: string) { + return boardid.replace(/_/g, "-") +} + export function boardMarkdownFiles() { const buildConfig = resolveBuildConfig() const { boards, archs } = buildConfig @@ -225,7 +230,7 @@ export function boardMarkdownFiles() { const spec: jdspec.DeviceSpec = catalog.specificationFromProductIdentifier(parseAnyInt(productId)) const aid = architectureFamily(archId) - const pa = `${aid}/${boardid.replace(/_/g, "-")}` + const pa = `${aid}/${boardIdToFilename(boardid)}` r[`${pa}.mdx`] = deviceConfigToMarkdown( board, archs[board.archId], diff --git a/website/docs/devices/esp32/adafruit-feather-esp32-s2.mdx b/website/docs/devices/esp32/adafruit-feather-esp32-s2.mdx index c363ecfbfc..d0e8c3ab0b 100644 --- a/website/docs/devices/esp32/adafruit-feather-esp32-s2.mdx +++ b/website/docs/devices/esp32/adafruit-feather-esp32-s2.mdx @@ -12,6 +12,8 @@ A S2 Feather from Adafruit. (untested) - I2C on SDA/SCL using Qwiic connector - WS2812B RGB LED on pin 33 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin 43 at 115200 8N1 +{@import optional ./adafruit-feather-esp32-s2-features.mdp} +{@import optional ./adafruit-feather-esp32-s2-services.mdp} ## Stores diff --git a/website/docs/devices/esp32/adafruit-qt-py-c3.mdx b/website/docs/devices/esp32/adafruit-qt-py-c3.mdx index 9a2c307ed1..0221c3c2fb 100644 --- a/website/docs/devices/esp32/adafruit-qt-py-c3.mdx +++ b/website/docs/devices/esp32/adafruit-qt-py-c3.mdx @@ -14,7 +14,9 @@ A tiny ESP32-C3 board. - I2C on SDA_D4/SCL_D5 using Qwiic connector - WS2812B RGB LED on pin 2 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin TX_D6 at 115200 8N1 +{@import optional ./adafruit-qt-py-c3-features.mdp} - Service: buttonBOOT (button) +{@import optional ./adafruit-qt-py-c3-services.mdp} ## Stores diff --git a/website/docs/devices/esp32/esp32-bare.mdx b/website/docs/devices/esp32/esp32-bare.mdx index 3b75615d90..b753c70333 100644 --- a/website/docs/devices/esp32/esp32-bare.mdx +++ b/website/docs/devices/esp32/esp32-bare.mdx @@ -9,6 +9,8 @@ Bare ESP32 without any default functions for pins. ## Features +{@import optional ./esp32-bare-features.mdp} +{@import optional ./esp32-bare-services.mdp} :::caution diff --git a/website/docs/devices/esp32/esp32-c3fh4-rgb.mdx b/website/docs/devices/esp32/esp32-c3fh4-rgb.mdx index 8ba9c0b1a1..5f7c8a50b5 100644 --- a/website/docs/devices/esp32/esp32-c3fh4-rgb.mdx +++ b/website/docs/devices/esp32/esp32-c3fh4-rgb.mdx @@ -14,7 +14,9 @@ A tiny ESP32-C3 board with 5x5 LED array. - I2C on 0/1 using Qwiic connector - LED on pin 10 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin 21 at 115200 8N1 +{@import optional ./esp32-c3fh4-rgb-features.mdp} - Service: buttonBOOT (button) +{@import optional ./esp32-c3fh4-rgb-services.mdp} ## Stores diff --git a/website/docs/devices/esp32/esp32-devkit-c.mdx b/website/docs/devices/esp32/esp32-devkit-c.mdx index 5961be79d9..028eb23e94 100644 --- a/website/docs/devices/esp32/esp32-devkit-c.mdx +++ b/website/docs/devices/esp32/esp32-devkit-c.mdx @@ -12,7 +12,9 @@ There are currently issues with serial chip on these, best avoid. ESP32-DevKitC ## Features - LED on pin 2 (use [setStatusLight](/developer/status-light) to control) +{@import optional ./esp32-devkit-c-features.mdp} - Service: buttonIO0 (button) +{@import optional ./esp32-devkit-c-services.mdp} :::caution diff --git a/website/docs/devices/esp32/esp32c3-bare.mdx b/website/docs/devices/esp32/esp32c3-bare.mdx index c37699c5ea..bcf3cee33a 100644 --- a/website/docs/devices/esp32/esp32c3-bare.mdx +++ b/website/docs/devices/esp32/esp32c3-bare.mdx @@ -10,7 +10,9 @@ A bare ESP32-C3 board without any pin functions. ## Features - Serial logging on pin P21 at 115200 8N1 +{@import optional ./esp32c3-bare-features.mdp} - Service: buttonBOOT (button) +{@import optional ./esp32c3-bare-services.mdp} :::caution diff --git a/website/docs/devices/esp32/esp32c3-rust-devkit.mdx b/website/docs/devices/esp32/esp32c3-rust-devkit.mdx index 82ab5282a6..901e80675c 100644 --- a/website/docs/devices/esp32/esp32c3-rust-devkit.mdx +++ b/website/docs/devices/esp32/esp32c3-rust-devkit.mdx @@ -14,7 +14,9 @@ A ESP32-C3 dev-board from Espressif with IMU and Temp/Humidity sensor, originall - I2C on 10/8 using Header connector - WS2812B RGB LED on pin 2 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin P21 at 115200 8N1 +{@import optional ./esp32c3-rust-devkit-features.mdp} - Service: buttonBOOT (button) +{@import optional ./esp32c3-rust-devkit-services.mdp} ## Stores diff --git a/website/docs/devices/esp32/esp32s2-bare.mdx b/website/docs/devices/esp32/esp32s2-bare.mdx index 60cd08f3d7..126dcc22a8 100644 --- a/website/docs/devices/esp32/esp32s2-bare.mdx +++ b/website/docs/devices/esp32/esp32s2-bare.mdx @@ -10,6 +10,8 @@ A bare ESP32-S2 board without any pin functions. ## Features - Serial logging on pin P43 at 115200 8N1 +{@import optional ./esp32s2-bare-features.mdp} +{@import optional ./esp32s2-bare-services.mdp} :::caution diff --git a/website/docs/devices/esp32/esp32s3-bare.mdx b/website/docs/devices/esp32/esp32s3-bare.mdx index 4458be248c..0ea987e019 100644 --- a/website/docs/devices/esp32/esp32s3-bare.mdx +++ b/website/docs/devices/esp32/esp32s3-bare.mdx @@ -10,6 +10,8 @@ A bare ESP32-S3 board without any pin functions. ## Features - Serial logging on pin P43 at 115200 8N1 +{@import optional ./esp32s3-bare-features.mdp} +{@import optional ./esp32s3-bare-services.mdp} :::caution diff --git a/website/docs/devices/esp32/esp32s3-devkit-m.mdx b/website/docs/devices/esp32/esp32s3-devkit-m.mdx index 2b95b96dd1..5aae287859 100644 --- a/website/docs/devices/esp32/esp32s3-devkit-m.mdx +++ b/website/docs/devices/esp32/esp32s3-devkit-m.mdx @@ -13,6 +13,8 @@ ESP32-S3 DevKitM development board. Should also work for DevKitC. - WS2812B RGB LED on pin P48 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin P43 at 115200 8N1 +{@import optional ./esp32s3-devkit-m-features.mdp} +{@import optional ./esp32s3-devkit-m-services.mdp} :::caution diff --git a/website/docs/devices/esp32/feather-s2.mdx b/website/docs/devices/esp32/feather-s2.mdx index 1c29b4b51c..29ab0bb6c4 100644 --- a/website/docs/devices/esp32/feather-s2.mdx +++ b/website/docs/devices/esp32/feather-s2.mdx @@ -14,8 +14,10 @@ ESP32-S2 based development board in a Feather format. - I2C on SDA/SCL using Qwiic connector - LED on pin 40 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin TX_D1 at 115200 8N1 +{@import optional ./feather-s2-features.mdp} - Service: buttonBOOT (button) - Service: ambientLight (analog:lightLevel) +{@import optional ./feather-s2-services.mdp} ## Stores diff --git a/website/docs/devices/esp32/kittenbot-grapebit-esp32c3.mdx b/website/docs/devices/esp32/kittenbot-grapebit-esp32c3.mdx index 65865dc552..19c6463c65 100644 --- a/website/docs/devices/esp32/kittenbot-grapebit-esp32c3.mdx +++ b/website/docs/devices/esp32/kittenbot-grapebit-esp32c3.mdx @@ -12,11 +12,13 @@ A round board packed with IMU, buzzer, motor control, 4 RGB LEDs, and Jacdac. - Jacdac on pin 5 using Jacdac connector - I2C on 6/7 - WS2812B RGB LED on pin 10 (use [setStatusLight](/developer/status-light) to control) +{@import optional ./kittenbot-grapebit-esp32c3-features.mdp} - Service: buttonA (button) - Service: buttonB (button) - Service: music (buzzer) - Service: M1 (motor) - Service: M2 (motor) +{@import optional ./kittenbot-grapebit-esp32c3-services.mdp} ## Stores diff --git a/website/docs/devices/esp32/msr207-v42.mdx b/website/docs/devices/esp32/msr207-v42.mdx index 8613e8e37d..28e51e5be2 100644 --- a/website/docs/devices/esp32/msr207-v42.mdx +++ b/website/docs/devices/esp32/msr207-v42.mdx @@ -9,7 +9,9 @@ description: MSR JM Brain S2-mini 207 v4.2 - Jacdac on pin 17 using Jacdac connector - RGB LED on pins 8, 7, 6 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin 43 at 115200 8N1 +{@import optional ./msr207-v42-features.mdp} - Service: power (auto-start) +{@import optional ./msr207-v42-services.mdp} :::caution diff --git a/website/docs/devices/esp32/msr207-v43.mdx b/website/docs/devices/esp32/msr207-v43.mdx index ef82cde0e9..e48584fec7 100644 --- a/website/docs/devices/esp32/msr207-v43.mdx +++ b/website/docs/devices/esp32/msr207-v43.mdx @@ -9,7 +9,9 @@ description: MSR JM Brain S2-mini 207 v4.3 - Jacdac on pin 17 using Jacdac connector - RGB LED on pins 8, 7, 6 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin 43 at 115200 8N1 +{@import optional ./msr207-v43-features.mdp} - Service: power (auto-start) +{@import optional ./msr207-v43-services.mdp} :::caution diff --git a/website/docs/devices/esp32/msr48.mdx b/website/docs/devices/esp32/msr48.mdx index dfddf75acc..0ea9c66c26 100644 --- a/website/docs/devices/esp32/msr48.mdx +++ b/website/docs/devices/esp32/msr48.mdx @@ -12,7 +12,9 @@ description: MSR JacdacIoT 48 v0.2 - I2C on 9/10 using Qwiic connector - RGB LED on pins 8, 7, 6 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin 43 at 115200 8N1 +{@import optional ./msr48-features.mdp} - Service: power (auto-start) +{@import optional ./msr48-services.mdp} ## Stores diff --git a/website/docs/devices/esp32/seeed-xiao-esp32c3-msr218.mdx b/website/docs/devices/esp32/seeed-xiao-esp32c3-msr218.mdx index 4cad1ef7e7..37e49a7747 100644 --- a/website/docs/devices/esp32/seeed-xiao-esp32c3-msr218.mdx +++ b/website/docs/devices/esp32/seeed-xiao-esp32c3-msr218.mdx @@ -15,6 +15,8 @@ A tiny ESP32-C3 board mounted on base with Jacdac, Qwiic and Grove connectors. - I2C on SDA/SCL using Qwiic connector - WS2812B RGB LED on pin LED (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin TX at 115200 8N1 +{@import optional ./seeed-xiao-esp32c3-msr218-features.mdp} +{@import optional ./seeed-xiao-esp32c3-msr218-services.mdp} ## Stores diff --git a/website/docs/devices/esp32/seeed-xiao-esp32c3.mdx b/website/docs/devices/esp32/seeed-xiao-esp32c3.mdx index f47d3266b3..e68f857e27 100644 --- a/website/docs/devices/esp32/seeed-xiao-esp32c3.mdx +++ b/website/docs/devices/esp32/seeed-xiao-esp32c3.mdx @@ -12,7 +12,9 @@ A tiny ESP32-C3 board. ## Features - Serial logging on pin TX_D6 at 115200 8N1 +{@import optional ./seeed-xiao-esp32c3-features.mdp} - Service: buttonBOOT (button) +{@import optional ./seeed-xiao-esp32c3-services.mdp} :::caution diff --git a/website/docs/devices/rp2040/kittenbot-nanoscript.mdx b/website/docs/devices/rp2040/kittenbot-nanoscript.mdx index 07a7099c99..9004cc9fb5 100644 --- a/website/docs/devices/rp2040/kittenbot-nanoscript.mdx +++ b/website/docs/devices/rp2040/kittenbot-nanoscript.mdx @@ -14,7 +14,9 @@ A RP2040 board featuring a Jacdac connector, compatible with SMT-mounting. - Jacdac on pin 9 using Jacdac connector - RGB LED on pins 16, 14, 15 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin 0 at 115200 8N1 +{@import optional ./kittenbot-nanoscript-features.mdp} - Service: power (auto-start) +{@import optional ./kittenbot-nanoscript-services.mdp} :::caution diff --git a/website/docs/devices/rp2040/msr124.mdx b/website/docs/devices/rp2040/msr124.mdx index 3a435ac48e..885d0a93d9 100644 --- a/website/docs/devices/rp2040/msr124.mdx +++ b/website/docs/devices/rp2040/msr124.mdx @@ -12,7 +12,9 @@ Prototype board - Jacdac on pin 9 using Jacdac connector - RGB LED on pins 16, 14, 15 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin 0 at 115200 8N1 +{@import optional ./msr124-features.mdp} - Service: power (auto-start) +{@import optional ./msr124-services.mdp} :::caution diff --git a/website/docs/devices/rp2040/msr59.mdx b/website/docs/devices/rp2040/msr59.mdx index 5829f78e59..ced7a54124 100644 --- a/website/docs/devices/rp2040/msr59.mdx +++ b/website/docs/devices/rp2040/msr59.mdx @@ -14,7 +14,9 @@ Prototype board - Jacdac on pin 9 using Jacdac connector - RGB LED on pins 11, 13, 15 (use [setStatusLight](/developer/status-light) to control) - Serial logging on pin 2 at 115200 8N1 +{@import optional ./msr59-features.mdp} - Service: power (auto-start) +{@import optional ./msr59-services.mdp} :::caution diff --git a/website/docs/devices/rp2040/pico-w.mdx b/website/docs/devices/rp2040/pico-w.mdx index 7dfbf3db12..85bb161d5c 100644 --- a/website/docs/devices/rp2040/pico-w.mdx +++ b/website/docs/devices/rp2040/pico-w.mdx @@ -12,6 +12,8 @@ RP2040 board from Raspberry Pi with a WiFi chip. ## Features - custom LED (use [setStatusLight](/developer/status-light) to control) +{@import optional ./pico-w-features.mdp} +{@import optional ./pico-w-services.mdp} :::caution diff --git a/website/docs/devices/rp2040/pico.mdx b/website/docs/devices/rp2040/pico.mdx index aa74e8323b..b0ca18b297 100644 --- a/website/docs/devices/rp2040/pico.mdx +++ b/website/docs/devices/rp2040/pico.mdx @@ -12,6 +12,8 @@ RP2040 board from Raspberry Pi. ## Features - custom LED (use [setStatusLight](/developer/status-light) to control) +{@import optional ./pico-features.mdp} +{@import optional ./pico-services.mdp} :::caution