C6/H2 Make higher LEDC frequencies work (#2520)

* ESP32-C6/H2: Make higher LEDC frequencies work

* FMT

* CHANGELOG.md
This commit is contained in:
Björn Quentin 2024-11-13 09:11:01 +01:00 committed by GitHub
parent 5d9cc1a588
commit 0b452f7933
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -72,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed some SysTimer race conditions and panics (#2451)
- TWAI: accept all messages by default (#2467)
- I8080: `set_byte_order()` now works correctly in 16-bit mode (#2487)
- ESP32-C6/ESP32-H2: Make higher LEDC frequencies work (#2520)
### Removed

View File

@ -369,6 +369,13 @@ impl<S: crate::ledc::timer::TimerSpeed> Channel<'_, S> {
unsafe { w.timer_sel().bits(timer_number) }
});
}
// this is needed to make low duty-resolutions / high frequencies work
#[cfg(any(esp32h2, esp32c6))]
self.ledc
.ch_gamma_wr_addr(self.number as usize)
.write(|w| unsafe { w.bits(0) });
self.start_duty_without_fading();
}