Skip to content

feat: Glass2 secondary OLED support for Cardputer ADV - #12

Open
Swissola wants to merge 1 commit into
geo-tp:mainfrom
Swissola:feat/glass2-cardputer-adv
Open

feat: Glass2 secondary OLED support for Cardputer ADV#12
Swissola wants to merge 1 commit into
geo-tp:mainfrom
Swissola:feat/glass2-cardputer-adv

Conversation

@Swissola

Copy link
Copy Markdown

Summary

Adds optional support for the M5Stack Glass2 transparent OLED (1.51", 128×64, SSD1309) connected to the Cardputer ADV Grove port (SDA=G2, SCL=G1).

  • Runtime detectionglass2Init() returns false if no Glass2 is connected; all subsequent calls become no-ops. The firmware works unchanged on standard Cardputer hardware.
  • No extra libraryM5UnitGLASS2 is already a transitive dependency via M5Cardputer → M5Unified → M5GFX.

What's shown on Glass2

Situation Line 1 Line 2
Menu navigation Current menu title
Scan: remote cycling Brand/menu context Remote name
Scan: command firing Brand/menu context Command name
Scan complete SCAN DONE
Loading LOADING...

Files changed

  • src/glass2.h — new; driver wrapper (init/show/clear)
  • src/Views/CardputerView.h — include glass2.h, add _g2_context static member
  • src/Views/CardputerView.cpp — glass2Init in initialise(); context + show calls in topBar(), displayScanRemote(), displayScanCommand(), displayScanOver(), displayLoading()

Hardware tested on

Awaiting physical Cardputer ADV unit — code compiles and the runtime detection pattern has been validated across several other firmware PRs using the same approach (Bruce, Nemo, Marauder, EvilPortal).

Adds optional Glass2 (1.51" SSD1309 128x64 OLED) on the Cardputer ADV
Grove port (SDA=G2, SCL=G1). Runtime-detected — no Glass2 connected is
a silent no-op, so the build works on both ADV and standard Cardputer.

- src/glass2.h: driver wrapper (glass2Init/Show/Clear) via M5UnitGLASS2
- CardputerView: initialise() calls glass2Init(); topBar() mirrors the
  active menu context to line 1; scan callbacks show brand+remote/command
  on line 1+2; displayScanOver and displayLoading push status strings.

No extra lib_deps required — M5UnitGLASS2 is already a transitive
dependency through M5Cardputer → M5Unified → M5GFX.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant