alarm working, LED needs fix later on
This commit is contained in:
@@ -11,6 +11,7 @@ entity top_modul is
|
||||
SW_ALARM_SET : in STD_LOGIC; -- '0' = Display Clock, '1' = Set Alarm
|
||||
SW_DIN : in STD_LOGIC_VECTOR (3 downto 0); -- Value to set
|
||||
BTN_LOAD : in STD_LOGIC_VECTOR (3 downto 0); -- Which digit to set
|
||||
RST_B : in STD_LOGIC;
|
||||
SEGMENTS : out STD_LOGIC_VECTOR (7 downto 0);
|
||||
ANODS : out STD_LOGIC_VECTOR (3 downto 0);
|
||||
ALARM_LED : out STD_LOGIC -- LED lights up when alarm triggers
|
||||
@@ -101,20 +102,19 @@ begin
|
||||
);
|
||||
|
||||
-- Comparator Logic for alarm LED to be ON or OFF
|
||||
-- TODO BUG proste niekedy na zaciatku ledka svieti aj ked ma byt zhasnuta
|
||||
process(CLK)
|
||||
begin
|
||||
if rising_edge(CLK) then
|
||||
if RST = '1' or RST_B = '1' then
|
||||
ALARM_LED <= '0';
|
||||
-- Match condition (HH:MM)
|
||||
if (sig_h_tens = alrm_h_tens and sig_h_units = alrm_h_units and
|
||||
elsif (START = '1' and
|
||||
sig_h_tens = alrm_h_tens and sig_h_units = alrm_h_units and
|
||||
sig_m_tens = alrm_m_tens and sig_m_units = alrm_m_units and
|
||||
sig_s_tens = "0000" and sig_s_units = "0000") then
|
||||
ALARM_LED <= '1';
|
||||
end if;
|
||||
|
||||
-- Reset turns the alarm LED off
|
||||
if RST = '1' then
|
||||
ALARM_LED <= '0';
|
||||
end if;
|
||||
end if;
|
||||
end process;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user