Skip to content

Commit

Permalink
rtc_master: Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MJoergen committed Jan 13, 2024
1 parent e8bfed6 commit ae5c109
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions M2M/vhdl/i2c/rtc_master.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ architecture synthesis of rtc_master is
end if;
end if;
else
-- Valid for R4 and R5
-- Valid for R4, R5, and R6
return arg(39 downto 32) & arg(63 downto 40) & arg(31 downto 0);
end if;
end function post_read;
Expand All @@ -192,7 +192,7 @@ architecture synthesis of rtc_master is
if board = "MEGA65_R3" then
return X"00" & arg(63 downto 8) & X"00";
else
-- Valid for R4 and R5
-- Valid for R4, R5, and R6
return arg(55 downto 32) & arg(63 downto 56) & arg(31 downto 0) & X"00";
end if;
end function pre_write;
Expand Down Expand Up @@ -342,6 +342,8 @@ begin
end if;

when VERIFY_ST =>
-- Occasionally, reading from RTC fails. To detect this, we check the DayOfMonth
-- MonthOfYear. If these two fields are zero, then the read from RTC has failed.
if rtc(47 downto 32) = X"0000" then
if count_down = 0 then
-- Reading from RTC did not work. Try again.
Expand Down

0 comments on commit ae5c109

Please sign in to comment.