From 2c14a2a1a247335d979d7b32fc037ce5353b39eb Mon Sep 17 00:00:00 2001 From: pca006132 Date: Tue, 16 Jun 2020 17:31:37 +0800 Subject: [PATCH] fixed global timer reset --- libboard_zynq/src/devc/mod.rs | 2 +- libboard_zynq/src/sdio/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libboard_zynq/src/devc/mod.rs b/libboard_zynq/src/devc/mod.rs index 1363525..41d1be4 100644 --- a/libboard_zynq/src/devc/mod.rs +++ b/libboard_zynq/src/devc/mod.rs @@ -76,7 +76,7 @@ impl DevC { DevC { regs: regs::RegisterBlock::devc(), enabled: false, - count_down: super::timer::GlobalTimer::start().countdown(), + count_down: unsafe { super::timer::GlobalTimer::get() }.countdown(), timeout_ms, } } diff --git a/libboard_zynq/src/sdio/mod.rs b/libboard_zynq/src/sdio/mod.rs index 8feb00a..4c2aa16 100644 --- a/libboard_zynq/src/sdio/mod.rs +++ b/libboard_zynq/src/sdio/mod.rs @@ -110,7 +110,7 @@ impl SDIO { let clocks = Clocks::get(); let mut self_ = SDIO { regs: regs::RegisterBlock::sdio0(), - count_down: super::timer::GlobalTimer::start().countdown(), + count_down: unsafe { super::timer::GlobalTimer::get() }.countdown(), input_clk_hz: clocks.sdio_ref_clk(), card_type: CardType::CardNone, card_detect,