Skip to content

Add heltec_rcc6 board#11041

Draft
Quency-D wants to merge 3 commits into
meshtastic:developfrom
Quency-D:heltec-rcc6
Draft

Add heltec_rcc6 board#11041
Quency-D wants to merge 3 commits into
meshtastic:developfrom
Quency-D:heltec-rcc6

Conversation

@Quency-D

@Quency-D Quency-D commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added support for the Heltec RCC6 ESP32-C6 board.
    • Added board configuration for LoRa, Wi‑Fi, Bluetooth, battery monitoring, USB, and a 128×220 TFT display.
    • Added automatic display detection and board-specific screen rendering, brightness, power, and touch handling.
    • Registered the Heltec RCC6 hardware model and upload configuration.

@Quency-D
Quency-D marked this pull request as draft July 17, 2026 03:16
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e5c89c72-1e5d-4c42-ac10-330c76909f74

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds Heltec RCC6 ESP32-C6 board support, including build metadata, pin and feature definitions, hardware identification, Arduino_GFX NV3001B display handling, and runtime screen detection.

Changes

Heltec RCC6 support

Layer / File(s) Summary
Board target and hardware contracts
boards/heltec-rcc6.json, variants/esp32c6/heltec_rcc6/*, src/platform/esp32/architecture.h
Defines the RCC6 board metadata, PlatformIO environment, ESP32-C6 pin mappings, radio/display configuration, build flags, and hardware model mapping.
NV3001B display backend
src/graphics/TFTDisplay.cpp
Adds RCC6-specific Arduino_GFX/NV3001B initialization, bitmap rendering, rotation, display power control, and disabled generic brightness/touch paths.
NV3001B screen detection
src/mesh/NodeDB.cpp
Reads the NV3001B identifier through GPIO routines and disables screen configuration when the expected display ID is not detected.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PlatformIO
  participant TFTDisplay
  participant Arduino_NV3001B
  participant NodeDB
  participant NV3001B
  PlatformIO->>TFTDisplay: Build with HELTEC_RCC6
  TFTDisplay->>Arduino_NV3001B: Initialize over software SPI
  TFTDisplay->>Arduino_NV3001B: Render and control display
  NodeDB->>NV3001B: Read display identifier
  NV3001B-->>NodeDB: Return identifier
  NodeDB->>NodeDB: Set screen availability
Loading

Possibly related PRs

Suggested labels: hardware-support

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No description was provided, so the required template sections and attestations are missing. Replace the placeholder with the repository template and add testing, regression, and hardware-attestation details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: adding the heltec_rcc6 board.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
src/graphics/TFTDisplay.cpp (1)

1626-1635: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Return failure when the NV3001B cannot initialize.

A failed begin() is only logged; execution continues through rotation, drawing, and ultimately returns true, falsely reporting a connected display.

Proposed fix
-    if (beginStatus)
-        LOG_DEBUG("TFT Success!");
-    else
+    if (!beginStatus) {
         LOG_ERROR("TFT Fail!");
+        return false;
+    }
+    LOG_DEBUG("TFT Success!");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/graphics/TFTDisplay.cpp` around lines 1626 - 1635, Update the TFT
initialization flow around beginStatus so a failed tft->begin() immediately
returns false from the enclosing display initialization function after logging
the failure. Preserve the existing success log and subsequent rotation/drawing
logic only for successful initialization, ensuring the function cannot report
true when the display fails to initialize.
🧹 Nitpick comments (1)
src/mesh/NodeDB.cpp (1)

254-254: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Rename get_nv3001b_id to getNv3001bId.

As per coding guidelines, “Use camelCase for functions and members.”

Proposed rename
-uint32_t get_nv3001b_id(uint8_t cs, uint8_t sck, uint8_t mosi, uint8_t dc, uint8_t rst, uint8_t en, uint8_t bl)
+uint32_t getNv3001bId(uint8_t cs, uint8_t sck, uint8_t mosi, uint8_t dc, uint8_t rst, uint8_t en, uint8_t bl)
...
-    uint32_t nv3001b_id = get_nv3001b_id(TFT_CS, TFT_SCL, TFT_SDA, TFT_RS, TFT_RST, TFT_EN, TFT_BL);
+    uint32_t nv3001b_id = getNv3001bId(TFT_CS, TFT_SCL, TFT_SDA, TFT_RS, TFT_RST, TFT_EN, TFT_BL);

Also applies to: 1140-1140

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/mesh/NodeDB.cpp` at line 254, Rename the function get_nv3001b_id to
getNv3001bId and update every declaration, definition, and call site, including
the additional occurrence, while preserving its signature and behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/mesh/NodeDB.cpp`:
- Around line 1139-1144: Update the HELTEC_RCC6 display initialization flow so
the false value assigned to hasScreen after the NV3001B ID check prevents
TFTDisplay::connect() from starting when no panel is detected. Thread hasScreen
into the TFT startup path or gate the module connection, while preserving normal
initialization when the expected display is present.

---

Outside diff comments:
In `@src/graphics/TFTDisplay.cpp`:
- Around line 1626-1635: Update the TFT initialization flow around beginStatus
so a failed tft->begin() immediately returns false from the enclosing display
initialization function after logging the failure. Preserve the existing success
log and subsequent rotation/drawing logic only for successful initialization,
ensuring the function cannot report true when the display fails to initialize.

---

Nitpick comments:
In `@src/mesh/NodeDB.cpp`:
- Line 254: Rename the function get_nv3001b_id to getNv3001bId and update every
declaration, definition, and call site, including the additional occurrence,
while preserving its signature and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0debf068-32e4-4aca-8aab-623f5e419b07

📥 Commits

Reviewing files that changed from the base of the PR and between 8ebdae9 and c02f858.

📒 Files selected for processing (7)
  • boards/heltec-rcc6.json
  • src/graphics/TFTDisplay.cpp
  • src/mesh/NodeDB.cpp
  • src/platform/esp32/architecture.h
  • variants/esp32c6/heltec_rcc6/pins_arduino.h
  • variants/esp32c6/heltec_rcc6/platformio.ini
  • variants/esp32c6/heltec_rcc6/variant.h

Comment thread src/mesh/NodeDB.cpp
Comment on lines +1139 to +1144
#ifdef HELTEC_RCC6
uint32_t nv3001b_id = get_nv3001b_id(TFT_CS, TFT_SCL, TFT_SDA, TFT_RS, TFT_RST, TFT_EN, TFT_BL);
if (nv3001b_id != NV3001B_EXPECTED_ID) {
hasScreen = false;
}
#endif // HELTEC_RCC6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Propagate the absent-display state into TFT startup. hasScreen only affects Bluetooth pairing mode here; RCC6 still builds with HAS_SCREEN, so TFTDisplay::connect() can still initialize a panel that was just detected as absent and powered off. Thread that state into display startup or gate the module connection.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/mesh/NodeDB.cpp` around lines 1139 - 1144, Update the HELTEC_RCC6 display
initialization flow so the false value assigned to hasScreen after the NV3001B
ID check prevents TFTDisplay::connect() from starting when no panel is detected.
Thread hasScreen into the TFT startup path or gate the module connection, while
preserving normal initialization when the expected display is present.

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Try this PR in the Web Flasher

Note

Building this pull request… the flash button, badges and supported-board
list will appear here automatically once CI finishes.

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