vhdl: only run encoders once all pixels are received

This commit is contained in:
Xiretza 2022-06-06 18:38:56 +02:00
parent 9ca64a7d4d
commit 70a7b0520a

View file

@ -40,6 +40,7 @@ architecture a of splink is
signal current_frame: unsigned(31 downto 0);
signal pixels_received: natural range 0 to MAX_STRAND_LEN-1;
signal run : std_logic;
signal clear_write_flags : std_logic;
signal all_strands_written : std_logic;
@ -69,6 +70,7 @@ begin
port map (
n_reset => not reset,
clk => clk,
run => run,
led_addr => led_data_arr(i).addr,
@ -119,10 +121,12 @@ begin
begin
if rising_edge(clk) then
clear_write_flags <= '0';
run <= '0';
if all_strands_written then
frame_number <= current_frame;
clear_write_flags <= '1';
run <= '1';
end if;
if reset then