Skip to content

Conversation

@kaidegit
Copy link
Collaborator

@kaidegit kaidegit commented Mar 25, 2025

Summary by CodeRabbit

  • New Features

    • Introduced direct LED color control functions for enhanced lighting customization.
    • Rolled out a modern settings management interface with JSON support.
  • Improvements

    • Streamlined the build process and enhanced optimization for robust performance.
    • Integrated updated third-party components and refined memory layout for improved stability.
  • Refactor

    • Transitioned from EEPROM-based to flash database–driven configuration.
    • Updated power settings terminology to better reflect voltage reference.

@coderabbitai
Copy link

coderabbitai bot commented Mar 25, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request updates several build configurations, linker scripts, and source files across the HSLinkPro project. It modifies CMake workflows, integrates new third‐party components via submodules, and replaces EEPROM-based settings with flash database and JSON‐based settings management. Memory layout adjustments for the bootloader and flash abstraction layer changes are included, along with updates to LED control (WS2812) timing and power voltage renaming. Various board initialization functions and logging configurations have been updated to reflect these design shifts.

Changes

File(s) Summary
.github/workflows/HSLinkPro-build.yml
projects/HSLink-Pro/src/CMakeLists.txt
projects/HSLink-Pro/src/third_party_components/CMakeLists.txt
projects/HSLink-Pro/bootloader/third_party_components/CMakeLists.txt
Updated build scripts: cosmetic reformatting of cmake commands, changed source file (setting.c → setting.cpp), updated compile options (from -g to -O2), and unconditionally included new components (EasyLogger, FAL, FlashDB).
.gitmodules
projects/HSLink-Pro/third_party_components/fal/fal
projects/HSLink-Pro/third_party_components/flashdb/FlashDB
Added new submodules for the FAL and FlashDB components with specific subproject commit references.
projects/HSLink-Pro/bootloader/CMakeLists.txt
projects/HSLink-Pro/bootloader/flash_xip.ld
Modified bootloader configuration: removed EEPROM emulation, added -O2 optimization, adjusted flash memory layout, and introduced a new .fal_tabel section.
projects/HSLink-Pro/common/fal/fal_cfg.h
.../fal/fal_hpm_internal_port.c
.../fal/fal_parts.c
Introduced Flash Abstraction Layer updates: new FAL configuration, flash read/write/erase operations, partition table declarations, and initialization logic.
projects/HSLink-Pro/common/flashdb/fdb_cfg.h Added a new configuration template for the FlashDB, defining features and storage modes.
projects/HSLink-Pro/common/easylogger/elog_cfg.h
projects/HSLink-Pro/common/easylogger/elog_port.c
Increased log buffer size and added explicit type casting in the log time function.
projects/HSLink-Pro/common/hslinkpro/board.c
projects/HSLink-Pro/common/hslinkpro/board.h
projects/HSLink-Pro/common/hslinkpro/pinmux.c
Revised board initialization: replaced EEPROM logic with flash database initialization, updated variable types and function formatting, and altered pin multiplexing (disabled GPTMR1 pin configuration).
projects/HSLink-Pro/bootloader/third_party_components/port/neopixel/ws2812.cpp
projects/HSLink-Pro/src/HID_COMM/hid_comm.cpp
projects/HSLink-Pro/src/HSLink_Pro_expansion.cpp
projects/HSLink-Pro/src/setting.h
Adjusted WS2812 LED configuration: increased timing parameters, renamed power voltage field to vref, and added new API functions for direct LED color control.
projects/HSLink-Pro/src/setting.c
projects/HSLink-Pro/src/setting.cpp
Replaced the C-based settings management with a new C++ implementation that uses JSON for serialization, supports settings initialization, saving, and hardware version management.
projects/HSLink-Pro/third_party_components/fal/CMakeLists.txt
projects/HSLink-Pro/third_party_components/flashdb/CMakeLists.txt
Added new CMake configuration files for building the FAL and FlashDB components with respective source and header file inclusions and compile definitions.

Sequence Diagram(s)

sequenceDiagram
    participant App as Application
    participant LED as WS2812 LED Controller
    App->>LED: HSP_WS2812_SetColor(r, g, b)
    LED->>LED: Check if neopixel is initialized
    alt Initialized
        LED-->>LED: Set color components and flush update
    else Not Initialized
        LED-->>App: (No action/log warning)
    end
Loading
sequenceDiagram
    participant User as User
    participant Settings as Setting Module
    participant KV as Key-Value Store
    participant HW as Hardware
    User->>Settings: Setting_Init()
    Settings->>KV: load_settings()
    alt Settings Found
        KV-->>Settings: Return settings
    else Not Found
        Settings-->>Settings: Use default settings
        Settings->>KV: store_settings(default)
    end
    Settings->>HW: update_settings()
    Note over Settings, HW: Hardware configuration updated
Loading

Possibly related PRs

  • hslink: add version upload #33: Modifications in CMake build configurations and versioning in bootloader and application settings align with similar changes in this PR.

Suggested reviewers

  • HalfSweet

Poem

I’m a rabbit who loves to hop,
Through code and change, I never stop.
New settings in JSON and LEDs that shine,
Flashdb and FAL now perfectly align.
With each update, I skip with glee—
Hop aboard, embrace the spree!
🐰✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c29a84 and 7f2275f.

📒 Files selected for processing (26)
  • .github/workflows/HSLinkPro-build.yml (2 hunks)
  • .gitmodules (1 hunks)
  • projects/HSLink-Pro/bootloader/CMakeLists.txt (1 hunks)
  • projects/HSLink-Pro/bootloader/flash_xip.ld (3 hunks)
  • projects/HSLink-Pro/bootloader/third_party_components/CMakeLists.txt (1 hunks)
  • projects/HSLink-Pro/bootloader/third_party_components/port/neopixel/ws2812.cpp (1 hunks)
  • projects/HSLink-Pro/common/easylogger/elog_cfg.h (1 hunks)
  • projects/HSLink-Pro/common/easylogger/elog_port.c (1 hunks)
  • projects/HSLink-Pro/common/fal/fal_cfg.h (1 hunks)
  • projects/HSLink-Pro/common/fal/fal_hpm_internal_port.c (1 hunks)
  • projects/HSLink-Pro/common/fal/fal_parts.c (1 hunks)
  • projects/HSLink-Pro/common/flashdb/fdb_cfg.h (1 hunks)
  • projects/HSLink-Pro/common/hslinkpro/board.c (19 hunks)
  • projects/HSLink-Pro/common/hslinkpro/board.h (2 hunks)
  • projects/HSLink-Pro/common/hslinkpro/pinmux.c (1 hunks)
  • projects/HSLink-Pro/src/CMakeLists.txt (3 hunks)
  • projects/HSLink-Pro/src/HID_COMM/hid_comm.cpp (2 hunks)
  • projects/HSLink-Pro/src/HSLink_Pro_expansion.cpp (3 hunks)
  • projects/HSLink-Pro/src/setting.c (0 hunks)
  • projects/HSLink-Pro/src/setting.cpp (1 hunks)
  • projects/HSLink-Pro/src/setting.h (1 hunks)
  • projects/HSLink-Pro/src/third_party_components/CMakeLists.txt (1 hunks)
  • projects/HSLink-Pro/third_party_components/fal/CMakeLists.txt (1 hunks)
  • projects/HSLink-Pro/third_party_components/fal/fal (1 hunks)
  • projects/HSLink-Pro/third_party_components/flashdb/CMakeLists.txt (1 hunks)
  • projects/HSLink-Pro/third_party_components/flashdb/FlashDB (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@HalfSweet HalfSweet merged commit b1b1054 into cherry-embedded:master Mar 25, 2025
2 of 3 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Apr 7, 2025
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