Skip to content

M5Stack PaperS3 Improvements#512

Merged
KenVanHoeylandt merged 7 commits intoTactilityProject:mainfrom
Shadowtrance:papers3-epdiy-improvements
Mar 6, 2026
Merged

M5Stack PaperS3 Improvements#512
KenVanHoeylandt merged 7 commits intoTactilityProject:mainfrom
Shadowtrance:papers3-epdiy-improvements

Conversation

@Shadowtrance
Copy link
Contributor

@Shadowtrance Shadowtrance commented Mar 5, 2026

M5Stack PaperS3

  • Switch to epdiy library - using my fork with papers3 implemented + some fixes.
  • Add Power capability
  • Changed font size to 24
  • Add (reasonably quiet) double beep when pressing the on-screen power button (not the physical power button)

Other Additions

  • App Hub Details - Handle line breaks "\n" (no quotes) in long app descriptions
  • Files App - Block the Cut, Copy, Rename, Delete long press context menu from /root (/data /sdcard)
  • WifiEsp / WebServerService (AP Mode) - (hopefully) fix random wifi related crashes
  • Some UI adjustments to help actually display things on epaper displays (launcher icons aren't invisible etc)
  • And of course some bonus symbols that aren't in the develop branch.

Still more styling to be fixed for paper displays like invisible checkbox's until turned on, borders around dropdown menus etc etc, just general visibility styling needs work.

The EpdiyDisplay driver and Power is mostly based on @fonix232's work with a fair few changes to it by me.

Summary by CodeRabbit

  • New Features

    • Full power management for M5Stack Paper S3 (battery, charging/USB detection, buzzer, controlled power‑off).
    • New EPDiy-based e‑ink display driver with LVGL integration and a factory helper for M5Paper S3.
  • Bug Fixes

    • App descriptions now render embedded newlines.
    • Fixed file deletion success handling and status bar icon color.
    • Improved Wi‑Fi/AP teardown to avoid teardown races.
  • Improvements

    • Device init sequence reordered to initialize power earlier and simplify display/touch setup.
    • Replaced FastEPD backend with EPDiy and adjusted build configuration.
    • LVGL symbol exports and mono theme config streamlined; added README for new driver.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR replaces the FastEpdDisplay driver with a new EpdiyDisplay implementation and helper, removes FastEpdDisplay sources/headers, and updates build files/manifests to use epdiy and the EPDiyDisplay component. It adds a PaperS3 power management subsystem (PaperS3Power, createPower(), ADC-based charge reading, buzzer, power-off) and an initBoot() implementation. Display creation was refactored so createDisplay() constructs touch internally. Other changes include LVGL symbol exports, Wi‑Fi default-driver cleanup, minor UI/file-operation fixes, device property tweak, and related CMake/README updates.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.81% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'M5Stack PaperS3 Improvements' is vague and does not convey specific information about the main changes in the changeset. Use a more descriptive title that highlights the primary change, such as 'Switch M5Stack PaperS3 to epdiy library with power management' or 'Add epdiy support and power management to M5Stack PaperS3'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
device.py (1)

225-230: ⚠️ Potential issue | 🟠 Major

Use valid LVGL symbols for DefaultLight theme selection.

Line 228 writes CONFIG_LV_THEME_DEFAULT_LIGHT=y, but that symbol does not exist in LVGL's lv_conf.h. The correct approach is to set LV_THEME_DEFAULT_DARK=0 for light mode and LV_THEME_DEFAULT_DARK=1 for dark mode.

Proposed fix
    if theme == "DefaultDark":
+       output_file.write("CONFIG_LV_USE_THEME_DEFAULT=y\n")
        output_file.write("CONFIG_LV_THEME_DEFAULT_DARK=y\n")
    elif theme == "DefaultLight":
-       output_file.write("CONFIG_LV_THEME_DEFAULT_LIGHT=y\n")
+       output_file.write("CONFIG_LV_USE_THEME_DEFAULT=y\n")
+       output_file.write("CONFIG_LV_THEME_DEFAULT_DARK=n\n")
    elif theme == "Mono":
        output_file.write("CONFIG_LV_USE_THEME_MONO=y\n")
🧹 Nitpick comments (2)
Drivers/EPDiyDisplay/README.md (1)

1-3: Consider expanding this README with setup/compatibility details.

A short section for supported panels, required dependencies, and init expectations would make integration/debugging easier.

Firmware/idf_component.yml (1)

59-61: Pin the forked epdiy dependency to a commit hash instead of a version tag for stronger reproducibility.

While the current version tag (2.0.1) is acceptable for ESP-IDF components, pinning directly to a commit hash is the preferred approach for git-sourced dependencies. This prevents unexpected changes if the tag is reused or moved in the fork. Additionally, consider committing a dependencies.lock file to lock all resolved versions across the dependency tree, ensuring consistent builds across machines and CI environments.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ddb2f3c8-9f1b-4598-b379-2a779c964d38

📥 Commits

Reviewing files that changed from the base of the PR and between 2426c38 and 89182f6.

📒 Files selected for processing (26)
  • Devices/m5stack-papers3/CMakeLists.txt
  • Devices/m5stack-papers3/Source/Configuration.cpp
  • Devices/m5stack-papers3/Source/Init.cpp
  • Devices/m5stack-papers3/Source/devices/Display.cpp
  • Devices/m5stack-papers3/Source/devices/Display.h
  • Devices/m5stack-papers3/Source/devices/Power.cpp
  • Devices/m5stack-papers3/Source/devices/Power.h
  • Devices/m5stack-papers3/device.properties
  • Drivers/EPDiyDisplay/CMakeLists.txt
  • Drivers/EPDiyDisplay/README.md
  • Drivers/EPDiyDisplay/Source/EpdiyDisplay.cpp
  • Drivers/EPDiyDisplay/Source/EpdiyDisplay.h
  • Drivers/EPDiyDisplay/Source/EpdiyDisplayHelper.h
  • Drivers/FastEpdDisplay/Source/FastEpdDisplay.cpp
  • Drivers/FastEpdDisplay/Source/FastEpdDisplay.h
  • Firmware/idf_component.yml
  • Modules/lvgl-module/source/symbols.c
  • Tactility/Source/app/apphubdetails/AppHubDetailsApp.cpp
  • Tactility/Source/app/files/View.cpp
  • Tactility/Source/app/launcher/Launcher.cpp
  • Tactility/Source/lvgl/Statusbar.cpp
  • Tactility/Source/service/webserver/WebServerService.cpp
  • Tactility/Source/service/wifi/WifiEsp.cpp
  • TactilityC/Source/symbols/freertos.cpp
  • TactilityC/Source/tt_init.cpp
  • device.py
💤 Files with no reviewable changes (2)
  • Drivers/FastEpdDisplay/Source/FastEpdDisplay.cpp
  • Drivers/FastEpdDisplay/Source/FastEpdDisplay.h

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c76e9eab-3680-4f57-97f0-cdb6ac277dad

📥 Commits

Reviewing files that changed from the base of the PR and between 89182f6 and edee799.

📒 Files selected for processing (7)
  • Devices/m5stack-papers3/Source/devices/Power.cpp
  • Drivers/EPDiyDisplay/Source/EpdiyDisplay.cpp
  • Drivers/EPDiyDisplay/Source/EpdiyDisplay.h
  • Tactility/Include/Tactility/hal/display/DisplayDevice.h
  • Tactility/Include/Tactility/hal/touch/TouchDevice.h
  • Tactility/Source/service/wifi/WifiEsp.cpp
  • TactilityCore/Include/Tactility/CoreDefines.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • Tactility/Source/service/wifi/WifiEsp.cpp

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
Devices/m5stack-papers3/Source/devices/Power.cpp (1)

111-116: Update the USB detect comment to match the current boot setup.

The implementation is fine, but the comment says initBoot() enables a pull-down. The current boot path only resets the pin and sets it to input, so this note will mislead the next person who revisits USB detection. Based on learnings: In Devices/m5stack-papers3/Source/Init.cpp, the USB_DETECT_PIN (GPIO_NUM_5) and CHARGE_STATUS_PIN (GPIO_NUM_4) are initialized with gpio_reset_pin() + gpio_set_direction() only, intentionally matching the M5Stack HAL user demo pattern. No explicit pull-mode configuration is set because USB detection is still a work in progress. Do not flag the missing pull-mode call as a defect until USB detection is resolved.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cf4109d7-84ba-456e-ad22-f6225c29f4a8

📥 Commits

Reviewing files that changed from the base of the PR and between edee799 and a7a654b.

📒 Files selected for processing (3)
  • Devices/m5stack-papers3/Source/devices/Power.cpp
  • Drivers/EstimatedPower/Source/ChargeFromAdcVoltage.cpp
  • Drivers/EstimatedPower/Source/ChargeFromAdcVoltage.h

@KenVanHoeylandt
Copy link
Contributor

Looks great, thanks a lot!

@KenVanHoeylandt KenVanHoeylandt merged commit 2de35b2 into TactilityProject:main Mar 6, 2026
54 checks passed
@Shadowtrance Shadowtrance deleted the papers3-epdiy-improvements branch March 6, 2026 20:54
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.

2 participants