Skip to content

Add CYD-3248S035C Support#522

Open
NellowTCS wants to merge 2 commits intoTactilityProject:mainfrom
NellowTCS:cyd-3248s035c
Open

Add CYD-3248S035C Support#522
NellowTCS wants to merge 2 commits intoTactilityProject:mainfrom
NellowTCS:cyd-3248s035c

Conversation

@NellowTCS
Copy link
Copy Markdown
Contributor

@NellowTCS NellowTCS commented Apr 11, 2026

This pull request adds support for a new device, the CYD 3248S035C, to Tactility.

Summary by CodeRabbit

  • New Features

    • Added CYD 3248S035C device: 3.5" rectangular display (165 DPI), LVGL 16-bit color, integrated SD card support, ESP32 hardware target.
  • Chores

    • CI updated to include automated firmware builds for the CYD 3248S035C board.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d6e35f9-332b-4542-8f90-5ee9c14e3f4d

📥 Commits

Reviewing files that changed from the base of the PR and between e92c008 and deeecb6.

📒 Files selected for processing (1)
  • .github/workflows/build.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build.yml

📝 Walkthrough

Walkthrough

This pull request adds support for the CYD 3248S035C board. Changes: CI build matrix includes board id cyd-3248s035c (arch: esp32); new device folder Devices/cyd-3248s035c with CMakeLists, module, hardware Configuration, display and SD card factories, headers, and device sources; Device Tree cyd,3248s035c.dts declaring GPIO/I2C/SPI/UART nodes; device.properties and devicetree.yaml entries. The code targets an ST7796 display, GT911 touch, PWM backlight, and an SPI SD card.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add CYD-3248S035C Support' directly and clearly summarizes the primary change—adding support for a new device to the codebase.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown

@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: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f9569e53-cba1-4405-8ee9-bdeea7271f5d

📥 Commits

Reviewing files that changed from the base of the PR and between e64f4ff and e92c008.

📒 Files selected for processing (11)
  • .github/workflows/build.yml
  • Devices/cyd-3248s035c/CMakeLists.txt
  • Devices/cyd-3248s035c/Source/Configuration.cpp
  • Devices/cyd-3248s035c/Source/devices/Display.cpp
  • Devices/cyd-3248s035c/Source/devices/Display.h
  • Devices/cyd-3248s035c/Source/devices/SdCard.cpp
  • Devices/cyd-3248s035c/Source/devices/SdCard.h
  • Devices/cyd-3248s035c/Source/module.cpp
  • Devices/cyd-3248s035c/cyd,3248s035c.dts
  • Devices/cyd-3248s035c/device.properties
  • Devices/cyd-3248s035c/devicetree.yaml

Comment on lines +1 to +3
dependencies:
- Platforms/platform-esp32
dts: cyd,3248s035c.dts
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Normalize this YAML file to LF line endings.

yamllint reports invalid newline characters on this file. Please resave with \n (LF) to avoid CI lint failures.

🧰 Tools
🪛 YAMLlint (1.38.0)

[error] 1-1: wrong new line character: expected \n

(new-lines)

Comment on lines +34 to +35
auto display = std::make_shared<St7796Display>(std::move(configuration));
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify inheritance and cast sites for this display type.
rg -nP --type=cpp --type=h 'class\s+St7796Display\s*:\s*public\s+tt::hal::display::DisplayDevice'
rg -nP --type=cpp --type=h 'reinterpret_pointer_cast<tt::hal::display::DisplayDevice>|static_pointer_cast<tt::hal::display::DisplayDevice>'

Repository: TactilityProject/Tactility

Length of output: 1887


🏁 Script executed:

# Find St7796Display class definition
rg -nP --type=cpp --type=h 'class\s+St7796Display'

Repository: TactilityProject/Tactility

Length of output: 160


🏁 Script executed:

# Find DisplayDevice class definition to understand the hierarchy
rg -nP --type=cpp --type=h 'class\s+DisplayDevice' | head -20

Repository: TactilityProject/Tactility

Length of output: 166


🏁 Script executed:

# Look for the actual file containing St7796Display and examine its definition
fd -type f -name '*.h' -o -name '*.cpp' | xargs grep -l 'St7796Display' | head -10

Repository: TactilityProject/Tactility

Length of output: 240


🏁 Script executed:

# Find EspLcdDisplay class definition and its base class
rg -nP --type=cpp --type=h 'class\s+EspLcdDisplay'

Repository: TactilityProject/Tactility

Length of output: 414


🏁 Script executed:

# Check the Display.cpp file for the complete context around line 35
cat -n Devices/cyd-3248s035c/Source/devices/Display.cpp | sed -n '1,45p'

Repository: TactilityProject/Tactility

Length of output: 1389


Use static_pointer_cast instead of reinterpret_pointer_cast for upcasting.

Line 35 performs an unsafe cast for what should be a normal polymorphic upcast. St7796Display inherits from EspLcdDisplay, which inherits from tt::hal::display::DisplayDevice. The reinterpret_pointer_cast treats the pointer bits directly without adjustment, which is unsafe and can cause undefined behavior. Use static_pointer_cast for compile-time known polymorphic upcasts.

🛠️ Safe cast fix
-    return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
+    return std::static_pointer_cast<tt::hal::display::DisplayDevice>(display);

Comment on lines +3 to +6
#include "Display.h"

#include <Tactility/hal/display/DisplayDevice.h>
#include <memory>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify where DisplayDevice is declared and whether this include path exists.
fd -i 'DisplayDevice.h'
rg -n -C2 --iglob '*.{h,cpp}' 'Tactility/hal/display/DisplayDevice.h|class DisplayDevice|namespace tt::hal::display' Devices TactilityKernel Firmware Drivers

Repository: TactilityProject/Tactility

Length of output: 22049


Remove the self-include of Display.h.

Line 3 includes itself (#include "Display.h"), which is redundant and can mask include hygiene issues. The include path <Tactility/hal/display/DisplayDevice.h> is valid and widely used across the codebase (50+ device files use it successfully). No forward declaration is necessary; keep the existing include as-is and simply remove the self-include.

🧰 Tools
🪛 Clang (14.0.6)

[error] 5-5: 'Tactility/hal/display/DisplayDevice.h' file not found

(clang-diagnostic-error)

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