From: Jan Michel Date: Thu, 12 Jul 2018 16:06:55 +0000 (+0200) Subject: fix LED connections X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=bb06bb169359dc6eca7305413954018a79a485a7;p=padiwa.git fix LED connections --- diff --git a/amps2/padiwa_amps2.vhd b/amps2/padiwa_amps2.vhd index 4fabdd7..7a4a4a9 100644 --- a/amps2/padiwa_amps2.vhd +++ b/amps2/padiwa_amps2.vhd @@ -362,18 +362,20 @@ THE_PWM_GEN : entity work.pwm_generator -- wait until rising_edge(clk_i); wait until rising_edge(clk_66); for i in 1 to 8 loop - if (last_inp(i/2+1) xor inp_status(i/2+1)) = '1' and (led_timer(i)(23 downto 21) > 0) then + if (last_inp((i-1)*2) xor inp_status((i-1)*2) = '1' and (led_timer(i)(23 downto 21) > 0) then led_state(i) <= not led_state(i); led_timer(i) <= 0; elsif led_timer(i)(23) = '1' then - led_state(i) <= inp_status(i/2+1); + led_state(i) <= inp_status((i-1)*2); else led_timer(i) <= led_timer(i) + 1; end if; end loop; end process; - LED <= led_state; +gen_leds : for i in 1 to 8 generate + LED(i) <= not leds((i-1)*2) when led_status(8) = '1' else not led_status(i-1); +end generate; ---------------------------------------------------------------------------