use esp_idf_hal::gpio::*;
use esp_idf_hal::peripherals::Peripherals;
use esp_idf_hal::prelude::*;
use esp_idf_hal::timer::config::Config;
use esp_idf_hal::timer::TimerDriver;
fn main() {
esp_idf_sys::link_patches();
let peripherals = Peripherals::take().unwrap();
let config = Config::new().auto_reload(true);
let mut timer1 = TimerDriver::new(peripherals.timer00, &config).unwrap();
let pin1 = PinDriver::input(peripherals.pins.gpio0).unwrap();
timer1.enable(false).unwrap();
println!("Counter Value Before Reset: {}", timer1.counter().unwrap());
timer1.set_counter(0_u64).unwrap();
println!("Counter Value after Reset: {}", timer1.counter().unwrap());
timer1.enable(true).unwrap();
println!("Counter Value after Enable: {}", timer1.counter().unwrap());
loop {
}
}