Skip to content

Apply upstream PR #2197: Add M5Stack CoreInk support and e‑ink optimizations#30

Open
bmorcelli wants to merge 1 commit intodevfrom
codex/apply-changes-from-upstream-pr-2197
Open

Apply upstream PR #2197: Add M5Stack CoreInk support and e‑ink optimizations#30
bmorcelli wants to merge 1 commit intodevfrom
codex/apply-changes-from-upstream-pr-2197

Conversation

@bmorcelli
Copy link
Copy Markdown
Owner

Motivation

  • Bring the upstream CoreInk branch changes into the current work branch so the diff and review can be performed locally.
  • Add official board support for the M5Stack CoreInk device and adapt display/input/power behavior for e‑ink characteristics.
  • Keep project behavior coherent by cherry‑picking only the meaningful source and documentation changes while avoiding unrelated generated artifacts.

Description

  • Added board support for M5Stack CoreInk under boards/m5stack-coreink/ including interface.cpp, m5stack-coreink.ini, pins_arduino.h and boards/_boards_json/m5stack-coreink.json to enable building for the CoreInk device.
  • Implemented e‑ink specific display/input/power handling and helpers (rocker input, battery, charging, brightness no‑op, wake/sleep helpers) in the new interface.cpp and adjusted settings hooks such as _setBrightness and InputHandler.
  • Updated display and logging layers to better support e‑ink and M5Unified API changes: modified lib/HAL/display/m5gfx.*, include/tftLogger.h, and related display functions (color/uint16 handling, pushImage fallback, text/draw helpers).
  • Documented CoreInk support and e‑ink optimizations in README.md and added a boards/m5stack-coreink/readme.md with build instructions and notes.

Testing

  • Fetched upstream PR with git fetch https://github.com/BruceDevices/firmware pull/2197/head:pr2197 and inspected the PR ref; the fetch completed successfully. (succeeded)
  • Cherry‑picked implementation and documentation commits (94c6863a, 9fa00e65) onto branch work and resolved a modify/delete conflict for boards/m5stack-coreink/readme.md before continuing the cherry‑pick; the cherry‑pick and conflict resolution were completed and committed. (succeeded)
  • Verified repository state with git status --short --branch, git log --oneline -n 5 and git show --stat --oneline -n 2 to confirm the new commits and file changes are present; those checks succeeded. (succeeded)
  • Inspected added/modified files (boards/*, README.md, lib/HAL/display/*, include/tftLogger.h, etc.) using nl/file listing to confirm content was applied; inspection commands completed. (succeeded)

No build or runtime unit tests were executed in this session; only VCS operations and file inspections were run to apply and verify the upstream changes.


Codex Task

Co-authored-by: KuriGohan-Kamehameha <16231581+KuriGohan-Kamehameha@users.noreply.github.com>
(cherry picked from commit 10dffc8)
@bmorcelli bmorcelli changed the base branch from main to dev February 26, 2026 18:59
@bmorcelli bmorcelli marked this pull request as ready for review February 26, 2026 18:59
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8515dd1272

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 132 to 134
if (isScreenOff) {
isScreenOff = false;
dimmer = false;
getBrightness();
vTaskDelay(pdMS_TO_TICKS(200));
return true;
} else if (dimmer) {
dimmer = false;
getBrightness();
vTaskDelay(pdMS_TO_TICKS(200));
return true;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore brightness when waking a dimmed/off LCD

On non-eink boards, this wake path now only clears isScreenOff and returns, but no longer resets dimmer or reapplies configured brightness. After power-save fade-out, turnOffDisplay() has already set brightness to 0, so the first keypress is consumed by wakeUpScreen() and the display remains dark instead of waking visibly, which breaks normal interaction after idle timeout.

Useful? React with 👍 / 👎.

priColor = 0xFFFF;
secColor = 0xFFFF;
bgColor = 0x0000;
colorInverted = 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve e-ink invert setting loaded from config

This unconditionally forces colorInverted back to 0 during validation on HAS_EINK, overriding the value that was just read from setting["colorInverted"]. As a result, users can toggle B/W inversion in the menu and save it, but every reboot resets runtime behavior to non-inverted (e.g. begin_tft() will always apply normal polarity), so the setting is not persistent.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant