1. **Added `active` parameter to hint animation** - `updateHint()` now accepts a boolean `active` parameter across both display drivers (TFT and GFX) - When `active=true`: faster pulse animation (500ms period) during active hold - When `active=false`: slower pulse animation (2000ms period) during idle state 2. **Improved animation calculations** - Replaced modulo operator with `fmodf()` for cleaner float calculations - Standardized to `static_cast<uint8_t>()` for type conversions - Fixed GFX driver to use `color565()` method instead of manual bit shifting 3. **Updated hint display logic** - Now differentiates between "holding" state (fast pulse) and "idle" state (slow pulse) - Hint draws at both states when `holdStartX >= 0` (touch position captured) 4. **Added code formatter task** - New `mise.toml` task for running clang-format across all source files - Users get **visual feedback differentiation**: fast pulsing during active hold vs. slow pulsing when idle - More intuitive UI that clearly indicates whether a long-press is in progress or just waiting - Cleaner, more maintainable code with standardized calculations and type conversions
156 lines
5.1 KiB
TOML
156 lines
5.1 KiB
TOML
# ═══════════════════════════════════════════════════════════
|
|
# Klubhaus Doorbell — Multi-Target Build Harness
|
|
# ═══════════════════════════════════════════════════════════
|
|
|
|
[tasks.install-libs-shared]
|
|
description = "Install shared (platform-independent) libraries"
|
|
run = """
|
|
arduino-cli lib install "ArduinoJson@7.4.1"
|
|
arduino-cli lib install "NTPClient@3.2.1"
|
|
echo "[OK] Shared libraries installed"
|
|
"""
|
|
|
|
[tasks.install-libs-32e]
|
|
description = "Vendor TFT_eSPI into vendor/esp32-32e"
|
|
run = """
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
if [ ! -d "vendor/esp32-32e/TFT_eSPI" ]; then
|
|
echo "Cloning TFT_eSPI..."
|
|
git clone --depth 1 --branch V2.5.43 \
|
|
https://github.com/Bodmer/TFT_eSPI.git \
|
|
vendor/esp32-32e/TFT_eSPI
|
|
fi
|
|
echo "Copying board-specific User_Setup.h..."
|
|
cp boards/esp32-32e/tft_user_setup.h vendor/esp32-32e/TFT_eSPI/User_Setup.h
|
|
echo "[OK] TFT_eSPI 2.5.43 vendored + configured"
|
|
"""
|
|
|
|
[tasks.install-libs-s3-43]
|
|
description = "Vendor LovyanGFX into vendor/esp32-s3-lcd-43"
|
|
run = """
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
LOVyanGFX_DIR="vendor/esp32-s3-lcd-43/LovyanGFX"
|
|
|
|
# Clone LovyanGFX (latest)
|
|
if [ ! -d "$LOVyanGFX_DIR" ]; then
|
|
echo "Cloning LovyanGFX..."
|
|
git clone --depth 1 \
|
|
https://github.com/lovyan03/LovyanGFX.git \
|
|
"$LOVyanGFX_DIR"
|
|
else
|
|
echo "LovyanGFX already exists, skipping"
|
|
fi
|
|
|
|
# Create library.properties that correctly points to source
|
|
cat > "$LOVyanGFX_DIR/library.properties" << 'EOF'
|
|
name=LovyanGFX
|
|
version=1.2.0
|
|
author=lovyan03
|
|
maintainer=lovyan03
|
|
sentence=Display and touch driver library for ESP32
|
|
paragraph=Universal graphics library for ESP32 with support for various displays and touch controllers
|
|
category=Display
|
|
url=https://github.com/lovyan03/LovyanGFX
|
|
architectures=esp32
|
|
includes=LovyanGFX.hpp
|
|
# This tells Arduino to build from src/
|
|
# Arduino will look in src/ for .cpp files
|
|
EOF
|
|
|
|
# Create a empty src to ensure sources are found
|
|
mkdir -p "$LOVyanGFX_DIR/src"
|
|
|
|
echo "[OK] LovyanGFX vendored"
|
|
"""
|
|
|
|
[tasks.install-libs]
|
|
description = "Install all libraries (shared + vendored)"
|
|
depends = ["install-libs-shared", "install-libs-32e", "install-libs-s3-43"]
|
|
|
|
# ── ESP32-32E ────────────────────────────────────────────
|
|
|
|
[tasks.compile-32e]
|
|
description = "Compile ESP32-32E sketch"
|
|
depends = ["install-libs"]
|
|
run = """
|
|
arduino-cli compile \
|
|
--fqbn "esp32:esp32@2.0.11:esp32:FlashSize=4M,PartitionScheme=default" \
|
|
--libraries ./libraries \
|
|
--libraries ./vendor/esp32-32e/TFT_eSPI \
|
|
--build-property "compiler.cpp.extra_flags=-DDEBUG_MODE -DBOARD_HAS_PSRAM" \
|
|
--warnings default \
|
|
./boards/esp32-32e
|
|
"""
|
|
|
|
[tasks.upload-32e]
|
|
description = "Upload to ESP32-32E"
|
|
run = """
|
|
arduino-cli upload \
|
|
--fqbn "esp32:esp32:esp32:FlashSize=4M,PartitionScheme=default" \
|
|
--port "${PORT:-/dev/ttyUSB0}" \
|
|
./boards/esp32-32e
|
|
"""
|
|
|
|
[tasks.monitor-32e]
|
|
description = "Serial monitor for ESP32-32E"
|
|
run = """
|
|
arduino-cli monitor --port "${PORT:-/dev/ttyUSB0}" --config baudrate=115200
|
|
"""
|
|
|
|
# ── ESP32-S3-LCD-4.3 ────────────────────────────────────
|
|
|
|
[tasks.compile-s3-43]
|
|
description = "Compile ESP32-S3-LCD-4.3 sketch (Core 2.x)"
|
|
depends = ["install-libs"]
|
|
run = """
|
|
arduino-cli compile \
|
|
--fqbn "esp32:esp32:waveshare_esp32_s3_touch_lcd_43:PSRAM=enabled,FlashSize=16M,USBMode=hwcdc,PartitionScheme=app3M_fat9M_16MB" \
|
|
--libraries ./libraries \
|
|
--library ./vendor/esp32-s3-lcd-43/LovyanGFX \
|
|
--build-property "compiler.cpp.extra_flags=-DDEBUG_MODE -DBOARD_HAS_PSRAM -DLGFX_USE_V1" \
|
|
--warnings default \
|
|
./boards/esp32-s3-lcd-43
|
|
"""
|
|
|
|
[tasks.upload-s3-43]
|
|
description = "Upload to ESP32-S3-LCD-4.3"
|
|
run = """
|
|
arduino-cli upload \
|
|
--fqbn "esp32:esp32:waveshare_esp32_s3_touch_lcd_43:PSRAM=enabled,FlashSize=16M,USBMode=hwcdc,PartitionScheme=app3M_fat9M_16MB" \
|
|
--port "${PORT:-/dev/ttyACM0}" \
|
|
./boards/esp32-s3-lcd-43
|
|
"""
|
|
|
|
[tasks.monitor-s3-43]
|
|
description = "Serial monitor for ESP32-S3-LCD-4.3"
|
|
run = """
|
|
arduino-cli monitor --port "${PORT:-/dev/ttyACM0}" --config baudrate=115200
|
|
"""
|
|
|
|
# ── Convenience ──────────────────────────────────────────
|
|
|
|
[tasks.clean]
|
|
description = "Remove build artifacts"
|
|
run = """
|
|
rm -rf boards/esp32-32e/build
|
|
rm -rf boards/esp32-s3-lcd-43/build
|
|
echo "[OK] Build artifacts cleaned"
|
|
"""
|
|
|
|
[tasks.format]
|
|
run = """
|
|
clang-format -i --style=file \
|
|
boards/esp32-32e/*.cpp \
|
|
boards/esp32-32e/*.h \
|
|
boards/esp32-32e/*.ino \
|
|
boards/esp32-s3-lcd-43/*.cpp \
|
|
boards/esp32-s3-lcd-43/*.h \
|
|
boards/esp32-s3-lcd-43/*.ino \
|
|
libraries/KlubhausCore/src/*.cpp \
|
|
libraries/KlubhausCore/src/*.h \
|
|
libraries/KlubhausCore/*.properties
|
|
"""
|