1 Reply Latest reply on Dec 11, 2017 1:37 AM by JoMe_264151

    RTC data sheet global variable caution


      Why does the RTC data sheet caution "You should disable the component’s interrupts while calling functions that read or modify global variables."

      A sentence or two of why this caution is mentioned in the RTC datasheet would seem to be appropriate. Datasheets for other components, such as the Interrupt component  make no similar mention.

        • 1. Re: RTC data sheet global variable caution

          Accessing data which might get changed by an interrupt should always be done with interrup disabled.

          Since the access might not be atomic the interrupt might occur just within the data read, giving a time of 23:59 (before int) and a date of one day past (after the interrupt). You might use the CyEnterCriticalSection() and Cy_ExitCriticalSection() APIs (from System Reference Guide)