RTC Example 5LP kit 059 | Cypress Semiconductor
RTC Example 5LP kit 059
First timer here so please forgive my simple questions as new to C and Cypress, though have done a little C++ with Arduino.
Been working though the tutorials etc and have the RTC 5LP example running ok.
The first point, though cannot see anything in the RTC datasheet, wondered if there is any way the RTC can be programmed with the current time/date automatically taken from host PC at programming time ? a very handy feature found on the Arduino.
The other point is about my lack of C knowledge
Was amending the RTC main.c code to display on the LCD in different layouts etc, but then found that some changes had been totally ignored.
Found the cause to be that the same code was replicated in the RtcIntHandler.c and that was overriding the changes I made in main.c
So does C demand you duplicate code like this ? or was the code put in the main.c as well, just to make things clearer for the newbie to see hows it was done ?
part of the code in both main.c ---
/* Print current time */
tmpVar = RTC_ReadSecond();
PrintDecNumber(tmpVar, 0u, 11u); etc etc
/* Get and print current seconds */
temp = RTC_ReadSecond();
PrintDecNumber(temp, 0u, 11u);
/* Get status */
temp = RTC_ReadStatus(); etc etc