diff --git a/src/RTCZero.cpp b/src/RTCZero.cpp index 71bfd8d..7a97dd1 100644 --- a/src/RTCZero.cpp +++ b/src/RTCZero.cpp @@ -39,7 +39,7 @@ RTCZero::RTCZero() _configured = false; } -void RTCZero::begin(bool resetTime) +void RTCZero::begin(bool twelveHrsformat,bool resetTime) { uint16_t tmp_reg = 0; @@ -72,6 +72,10 @@ void RTCZero::begin(bool resetTime) //According to the datasheet RTC_MODE2_CTRL_CLKREP = 0 for 24h tmp_reg &= ~RTC_MODE2_CTRL_CLKREP; // 24h time representation + if(twelveHrsformat) + { + tmp_reg |= RTC_MODE2_CTRL_CLKREP; // 12h time representation + } RTC->MODE2.READREQ.reg &= ~RTC_READREQ_RCONT; // disable continuously mode diff --git a/src/RTCZero.h b/src/RTCZero.h index f74f091..73fa796 100644 --- a/src/RTCZero.h +++ b/src/RTCZero.h @@ -39,7 +39,7 @@ class RTCZero { }; RTCZero(); - void begin(bool resetTime = false); + void begin(bool twelveHrsformat = false,bool resetTime = false); void enableAlarm(Alarm_Match match); void disableAlarm();