]> jspc29.x-matter.uni-frankfurt.de Git - padiwa.git/commitdiff
fix LED connections
authorJan Michel <j.michel@gsi.de>
Thu, 12 Jul 2018 16:06:55 +0000 (18:06 +0200)
committerJan Michel <j.michel@gsi.de>
Thu, 12 Jul 2018 16:06:55 +0000 (18:06 +0200)
amps2/padiwa_amps2.vhd

index 4fabdd78970c5ab338e2e69e8c313e74bd62c0fa..7a4a4a93da8742b641bb8699624f72e4a7a6ffaa 100644 (file)
@@ -362,18 +362,20 @@ THE_PWM_GEN : entity work.pwm_generator
 --    wait until rising_edge(clk_i);\r
     wait until rising_edge(clk_66);\r
     for i in 1 to 8 loop\r
-      if (last_inp(i/2+1) xor inp_status(i/2+1)) = '1' and (led_timer(i)(23 downto 21) > 0) then\r
+      if (last_inp((i-1)*2) xor inp_status((i-1)*2) = '1' and (led_timer(i)(23 downto 21) > 0) then\r
         led_state(i) <= not led_state(i);\r
         led_timer(i) <= 0;\r
       elsif led_timer(i)(23) = '1' then\r
-        led_state(i) <= inp_status(i/2+1);\r
+        led_state(i) <= inp_status((i-1)*2);\r
       else\r
         led_timer(i) <= led_timer(i) + 1;\r
       end if;\r
     end loop;\r
   end process;  \r
 \r
-  LED <= led_state;\r
+gen_leds : for i in 1 to 8 generate\r
+  LED(i) <= not leds((i-1)*2) when led_status(8) = '1' else not led_status(i-1);\r
+end generate;\r
 \r
   \r
 ---------------------------------------------------------------------------\r