Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/RTCZero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/RTCZero.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down