Skip to content

Conversation

@bugadani
Copy link
Contributor

@bugadani bugadani commented Dec 15, 2025

cc #4502

Based on top of #4647

Copilot AI review requested due to automatic review settings December 15, 2025 12:57
@bugadani bugadani added the skip-changelog No changelog modification needed label Dec 15, 2025
/// [`ConfigError::Clock`] will be returned if the frequency passed in
/// `Config` is too low.
pub fn apply_config(&mut self, config: &Config) -> Result<(), ConfigError> {
let clocks = Clocks::get();
Copy link
Collaborator

Choose a reason for hiding this comment

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

unused now

Suggested change
let clocks = Clocks::get();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, CI will point these out, don't worry :)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the clock system to use a new clock tree API, primarily to support LCD_CAM peripherals and improve MCPWM clock management. The changes introduce unstable API features for advanced clock configuration while maintaining backward compatibility with existing APIs.

Key Changes

  • Introduces new clock tree API with ClockConfig and peripheral-specific function clocks for MCPWM
  • Refactors LCD_CAM drivers to query clock frequencies directly from the clock tree instead of the legacy Clocks struct
  • Marks clock configuration types as unstable and makes SoC clock modules unstable-gated
  • Removes deprecated clock fields from Clocks struct (pwm_clock, crypto_pwm_clock, crypto_clock)

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
esp-metadata/src/cfg/soc.rs Marks ClockConfig as unstable
esp-metadata/devices/*.toml Adds MCPWM function clock configurations for various ESP32 variants
esp-metadata-generated/src/generated*.rs Generated clock tree types and functions for MCPWM peripherals
esp-metadata-generated/src/_build_script_utils.rs Adds build script support for MCPWM clock node cfg flags
esp-hal/src/system.rs Implements Clone for PeripheralGuard to support multiple clock guards
esp-hal/src/soc/*/mod.rs Moves clock modules behind unstable feature flag
esp-hal/src/soc/*/clocks.rs Implements MCPWM function clock enable/configure functions and makes CpuClock public
esp-hal/src/mcpwm/*.rs Refactors MCPWM to use new clock API with PwmClockGuard
esp-hal/src/lcd_cam/*.rs Updates LCD_CAM to query frequencies from clock tree
esp-hal/src/clock/mod.rs Removes legacy clock types and fields, consolidates clock configuration
esp-hal/CHANGELOG.md Documents the addition of unstable clock configuration and removal of legacy clock fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings December 16, 2025 14:29
@bugadani bugadani marked this pull request as draft December 16, 2025 14:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

skip-changelog No changelog modification needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants