wait for timer value to be latched for esp32(c3/c6) (#1178)

* wait for timer value to be latched for esp32(c3/c6)

* update changelog to include timer fix
This commit is contained in:
Felix Richter 2024-02-19 09:16:49 +01:00 committed by GitHub
parent 172d2b8777
commit b0bb0ab1ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix docs.rs documentation builds (#1129)
- Fix circular DMA (#1144)
- Fix `hello_rgb` example for ESP32 (#1173)
- Fix timer `now` for esp32c3 and esp32c6
### Changed

View File

@ -420,8 +420,15 @@ where
fn now(&self) -> u64 {
let reg_block = unsafe { &*TG::register_block() };
#[cfg(not(any(esp32c3, esp32c6)))]
reg_block.t0update().write(|w| unsafe { w.bits(0) });
#[cfg(any(esp32c3, esp32c6))]
{
reg_block.t0update().write(|w| w.update().set_bit());
while reg_block.t0update().read().update().bit_is_set() {}
}
let value_lo = reg_block.t0lo().read().bits() as u64;
let value_hi = (reg_block.t0hi().read().bits() as u64) << 32;