mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-10-02 14:44:42 +00:00
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:
parent
172d2b8777
commit
b0bb0ab1ce
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user