Do not scroll in characters that are currently displayed

This commit is contained in:
2022-11-20 16:38:10 +01:00
parent 94f916d624
commit 6a76243fc0
4 changed files with 109 additions and 13 deletions

View File

@@ -10,7 +10,8 @@ entity scrolling_buffer is
buffer_write : in std_logic;
buffer_data : in std_logic_vector(4 downto 0);
next_char : in std_logic;
hex_char : out std_logic_vector(4 downto 0)
hex_char : out std_logic_vector(4 downto 0);
elements : out std_logic_vector(4 downto 0)
);
end entity scrolling_buffer;
@@ -34,12 +35,14 @@ begin
ptr_last <= -1;
ptr_write <= 0;
ring_buffer <= (others => (others => '0'));
elements <= (others => '0');
else
if buffer_write = '1' then
ring_buffer(ptr_write) <= buffer_data;
if ptr_last /= BUFFER_SIZE - 1 then
ptr_last <= ptr_write;
elements <= std_logic_vector(to_unsigned(ptr_write + 1, 5));
end if;
if ptr_write = BUFFER_SIZE - 1 then