Files
clawdmeter/firmware/platformio.ini
T
Jerome TayandClaude Opus 4.8 9375bd6d66 fix(c6): drive AMOLED-2.16 C6 panel as CO5300, side-USB orientation
platformio.ini and the board files labelled the Waveshare
ESP32-C6-Touch-AMOLED-2.16 as an SH8601 panel, when it actually uses a
CO5300 (per the official spec) -- the same controller as the S3
AMOLED-2.16. It still rendered because display.cpp grafted CO5300-style
manufacturer registers (a 0xFE page-switch writing the 0x19/0x1C
driving-voltage registers) onto the Arduino_SH8601 class, and both
controllers speak standard MIPI DCS for pixel writes.

Rebase onto Arduino_CO5300 (matching the S3 AMOLED-2.16 sibling) and keep
only the page-0x20 panel-driving registers (0x19/0x1C) the class init
omits; everything else (0xC4/0x36/0x53/0x51/0x63/0x29) is now covered by
Arduino_CO5300::begin().

Adopt the CO5300 rotation-0 default (MADCTL 0x00) instead of the old forced
0x30 transpose, orienting the board with the USB port on the side (the
preferred desk orientation). Touch axis mapping is re-derived and tap-tested
on hardware to match: swap=false, mirror=(false,false).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 21:37:34 +08:00

180 lines
5.9 KiB
INI
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[env:waveshare_amoled_216]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.38-1/platform-espressif32.zip
board = esp32-s3-devkitc-1
framework = arduino
board_build.arduino.memory_type = qio_opi
upload_speed = 921600
monitor_speed = 115200
; Compile shared code + this board's per-board folder; exclude all other
; boards. New ports add a `+<boards/<name>/>` line in their own env block.
build_src_filter =
+<*>
-<boards/>
+<boards/waveshare_amoled_216/>
build_flags =
-DBOARD_AMOLED_216
-DARDUINO_USB_CDC_ON_BOOT=1
-DBOARD_HAS_PSRAM
; AXP2101 PMU
-DXPOWERS_CHIP_AXP2101
; NimBLE config — peripheral, 2 simultaneous connections so the OS can
; hold the HID link (Space key from BOOT button) while the daemon holds
; its own connection for the custom data service.
-DCONFIG_BT_NIMBLE_ROLE_BROADCASTER=1
-DCONFIG_BT_NIMBLE_ROLE_PERIPHERAL=1
-DCONFIG_BT_NIMBLE_ROLE_CENTRAL=0
-DCONFIG_BT_NIMBLE_ROLE_OBSERVER=0
-DCONFIG_BT_NIMBLE_MAX_CONNECTIONS=2
; LVGL config via build flags
-DLV_CONF_SKIP
-DLV_COLOR_DEPTH=16
-DLV_USE_LOG=0
-DLV_USE_BAR=1
-DLV_USE_LABEL=1
-DLV_USE_ARC=1
-DLV_USE_BTN=1
-DLV_USE_LINE=1
-DLV_USE_OBJ=1
-DLV_USE_IMG=1
-DLV_USE_IMAGE=1
-DLV_USE_ANIMIMG=0
-DLV_TICK_CUSTOM=1
-DLV_USE_SNAPSHOT=1
lib_deps =
moononournation/GFX Library for Arduino@^1.5.6
lewisxhe/SensorLib@^0.2.6
lewisxhe/XPowersLib@^0.2.7
lvgl/lvgl@^9.2.0
bblanchon/ArduinoJson@^7.0.0
h2zero/NimBLE-Arduino@^2.1.1
[env:waveshare_amoled_18]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.38-1/platform-espressif32.zip
board = esp32-s3-devkitc-1
framework = arduino
board_build.arduino.memory_type = qio_opi
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.partitions = default_16MB.csv
upload_speed = 921600
monitor_speed = 115200
; Compile shared code + this board's per-board folder; exclude all other
; boards. New ports add a `+<boards/<name>/>` line in their own env block.
build_src_filter =
+<*>
-<boards/>
+<boards/waveshare_amoled_18/>
build_flags =
-DBOARD_AMOLED_18
-DARDUINO_USB_CDC_ON_BOOT=1
-DBOARD_HAS_PSRAM
; AXP2101 PMU is present on the AMOLED-1.8 board too (battery is optional kit add-on)
-DXPOWERS_CHIP_AXP2101
; NimBLE config — peripheral, 2 simultaneous connections so the OS can
; hold the HID link (Space key from BOOT button) while the daemon holds
; its own connection for the custom data service.
-DCONFIG_BT_NIMBLE_ROLE_BROADCASTER=1
-DCONFIG_BT_NIMBLE_ROLE_PERIPHERAL=1
-DCONFIG_BT_NIMBLE_ROLE_CENTRAL=0
-DCONFIG_BT_NIMBLE_ROLE_OBSERVER=0
-DCONFIG_BT_NIMBLE_MAX_CONNECTIONS=2
; LVGL config via build flags
-DLV_CONF_SKIP
-DLV_COLOR_DEPTH=16
-DLV_USE_LOG=0
-DLV_USE_BAR=1
-DLV_USE_LABEL=1
-DLV_USE_ARC=1
-DLV_USE_BTN=1
-DLV_USE_LINE=1
-DLV_USE_OBJ=1
-DLV_USE_IMG=1
-DLV_USE_IMAGE=1
-DLV_USE_ANIMIMG=0
-DLV_TICK_CUSTOM=1
-DLV_USE_SNAPSHOT=1
lib_deps =
; 1.6.4+ ships Arduino_SH8601 in mainline
moononournation/GFX Library for Arduino@^1.6.4
; SensorLib still used for QMI8658 IMU on AMOLED-1.8
lewisxhe/SensorLib@^0.2.6
lewisxhe/XPowersLib@^0.2.7
lvgl/lvgl@^9.2.0
bblanchon/ArduinoJson@^7.0.0
h2zero/NimBLE-Arduino@^2.1.1
[env:waveshare_amoled_216_c6]
; C6 sibling of the AMOLED-2.16. Same panel/touch/PMU/IMU, no PSRAM,
; single-core RISC-V, BLE 5.3 only (no classic BT). If the build fails
; resolving the C6 board, bump pioarduino to a newer 55.x release that
; ships esp32-c6-devkitc-1.
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.38-1/platform-espressif32.zip
board = esp32-c6-devkitc-1
framework = arduino
upload_speed = 921600
monitor_speed = 115200
; Waveshare's C6-AMOLED-2.16 ships with 16 MB flash. The default 1.25 MB
; app partition can't hold this firmware (~1.43 MB) — switch to the
; 16 MB layout that gives the app ~6.5 MB, matching the AMOLED-1.8 env.
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.partitions = default_16MB.csv
build_src_filter =
+<*>
-<boards/>
+<boards/waveshare_amoled_216_c6/>
build_flags =
-DBOARD_AMOLED_216_C6
; C6 has only USB-Serial-JTAG (HWCDC), no native USB-OTG. The Arduino
; core maps Serial → HWCDCSerial only when BOTH flags below are set;
; CDC_ON_BOOT alone selects USBSerial (TinyUSB) which doesn't exist on
; C6 and breaks the build. Without either flag, Serial routes to UART0
; on physical pins and nothing reaches the USB host.
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1
; No -DBOARD_HAS_PSRAM — C6 has no external PSRAM. Shared code
; (main.cpp, splash.cpp) gates on this to pick MALLOC_CAP_INTERNAL
; and shrink LVGL buffers + splash canvas accordingly.
-DXPOWERS_CHIP_AXP2101
-DCONFIG_BT_NIMBLE_ROLE_BROADCASTER=1
-DCONFIG_BT_NIMBLE_ROLE_PERIPHERAL=1
-DCONFIG_BT_NIMBLE_ROLE_CENTRAL=0
-DCONFIG_BT_NIMBLE_ROLE_OBSERVER=0
-DCONFIG_BT_NIMBLE_MAX_CONNECTIONS=2
-DLV_CONF_SKIP
-DLV_COLOR_DEPTH=16
-DLV_USE_LOG=0
-DLV_USE_BAR=1
-DLV_USE_LABEL=1
-DLV_USE_ARC=1
-DLV_USE_BTN=1
-DLV_USE_LINE=1
-DLV_USE_OBJ=1
-DLV_USE_IMG=1
-DLV_USE_IMAGE=1
-DLV_USE_ANIMIMG=0
-DLV_TICK_CUSTOM=1
; Screenshot capture needs a full-frame RGB565 buffer (~460 KB on
; 480×480) which doesn't fit in C6 internal SRAM. send_screenshot
; prints SCREENSHOT_UNSUPPORTED on this board.
-DLV_USE_SNAPSHOT=0
lib_deps =
; this board uses the CO5300 (same controller as the S3 2.16); Arduino_CO5300
moononournation/GFX Library for Arduino@^1.6.4
lewisxhe/SensorLib@^0.2.6
lewisxhe/XPowersLib@^0.2.7
lvgl/lvgl@^9.2.0
bblanchon/ArduinoJson@^7.0.0
h2zero/NimBLE-Arduino@^2.1.1