diff --git a/lib/misc/gpio_wb.vhd b/lib/misc/gpio_wb.vhd index 4f358b1..851399c 100644 --- a/lib/misc/gpio_wb.vhd +++ b/lib/misc/gpio_wb.vhd @@ -160,10 +160,7 @@ tick_usec_timer: begin if rising_edge(CLK_I) then cnt_usec_en <= '0'; - if RST_I = '1' then - tick_usec <= 0; - cnt_usec_en <= '0'; - elsif tick_usec = tick_usec_t'high then + if tick_usec >= tick_usec_t'high then tick_usec <= 0; cnt_usec_en <= '1'; else @@ -177,13 +174,10 @@ cnt_usec_timer: begin if rising_edge(CLK_I) then cnt_sec_en <= '0'; - if RST_I = '1' then - cnt_usec <= (others => '0'); - cnt_sec_en <= '0'; - elsif cnt_usec_we = '1' then + if cnt_usec_we = '1' then cnt_usec <= cnt_usec_preset; elsif cnt_usec_en = '1' then - if cnt_usec = to_unsigned(1E6 - 1, 32) then + if cnt_usec >= to_unsigned(1E6 - 1, 32) then cnt_usec <= (others => '0'); cnt_sec_en <= '1'; else @@ -197,9 +191,7 @@ cnt_sec_timer: process(CLK_I) begin if rising_edge(CLK_I) then - if RST_I = '1' then - cnt_sec <= (others => '0'); - elsif cnt_sec_we = '1' then + if cnt_sec_we = '1' then cnt_sec <= cnt_sec_preset; elsif cnt_sec_en = '1' then cnt_sec <= cnt_sec + 1;