Files
tactility/.claude/skills/tactility-firmware/references/battery-cleanup-lesson.md
T
Adolfo Reyna 12035f2f39 chore: move firmware skills in-repo + AGENTS.md
- Migrates tactility-firmware and tactility-bluetooth from
  ~/.hermes/skills/ into .claude/skills/ for repo co-location
- Adds AGENTS.md with local workstation context, board table,
  board-direct build rule, Hermes PYTHONPATH pitfall, common
  Tactility pitfalls, and in-repo skill index

Refs: personal Gitea mirror
2026-07-17 09:51:08 -04:00

2.4 KiB

Battery Cleanup Lesson — 2026-07-11

User intent evolution

  1. "Add option for screensaver to be disabled when charging. Check if possible with ESP32"
  2. "I want battery level shown on tab where WiFi icon is shown"
  3. "I see, I think the issue is firmware is not reading battery level. Debug this."
  4. "Let's remove any custom battery logic (not the board config). I have a micropython code with battery reading level on the projects folder. Look for it"
  5. "I don't need the battery level on the wifi, that makes no sense. I wanted on the overall status bar, but I deduced that the issue was that the power was not configured so tactility should have a native icon for battery"

What went wrong

  • Added battery_label to WifiManage View: wrong UX location. Statusbar already has native icon statusbar_set_battery_text + visibility. Should have checked Statusbar.cpp first.
  • Added custom Power.cpp to ES3C28P: violated later instruction "not the board config". Should keep board config pristine unless explicitly allowed.
  • MicroPython reference: Projects/MicroPython/test1/Screen/lib/battery_util.py BatteryMonitor(pin_num=9) ADC 11dB ATTN, 2x divider, 3.0-4.2V. Found via find Projects -name "*.py" | xargs grep battery avoiding venv. Pin 9 conflicts with RLCD I2S BCLK=9 — note before applying.

Correct pattern for future

  1. When user says "battery not shown where WiFi icon is" → interpret as statusbar (overall header bar where WiFi + BT icons live), not WifiManage app tab. Explain native statusbar exists, check if PowerDevice missing.
  2. When user says "remove any custom battery logic (not board config)" → delete Devices/*/Power.{h,cpp} you added, revert CMakeLists.txt and Configuration.cpp to HEAD. Keep only generic features using existing HAL API (DisplaySettings, DisplayIdle).
  3. When user provides external reference (micropython code) → locate it, read exact pin/divider, but don't auto-apply to board config if they said not to touch config. Offer as suggestion.

Files reverted in cleanup

  • Devices/es3c28p/Source/Configuration.cpp → only createDisplay()
  • Devices/es3c28p/CMakeLists.txt → remove EstimatedPower/esp_adc REQUIRES
  • Tactility/Private/Tactility/app/wifimanage/View.h and View.cpp → removed battery_label/updateBattery()
  • Kept: DisplaySettings.h disableScreensaverWhenCharging, DisplayIdle charging guard, Display.cpp toggle — these use native IsCharging API, no custom ADC