Skip to content

Commit 7256b42

Browse files
amcmahon01per1234
andauthored
Apply changes from review
Fix formatting, removes function prototypes from examples, removes unnecessary header info, fixes version number, adds missing "else" in RTCresetRemote(). Co-Authored-By: per1234 <accounts@perglass.com>
1 parent a8bec10 commit 7256b42

File tree

7 files changed

+15
-25
lines changed

7 files changed

+15
-25
lines changed

examples/Mode0_32-bit_Counter/Mode0_32-bit_Counter.ino

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
/* Create an rtc object */
1919
RTCZero rtc;
2020

21-
void countDone(void);
22-
2321
void setup()
2422
{
2523
Serial.begin(9600);
@@ -38,4 +36,4 @@ void loop()
3836
void countDone() // interrupt when compare value is reached
3937
{
4038
Serial.println("Reset!");
41-
}
39+
}

examples/Mode1_16-bit_Periodic_Counter/Mode1_16-bit_Periodic_Counter.ino

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
/* Create an rtc object */
1919
RTCZero rtc;
2020

21-
void countInt(void);
22-
2321
void setup()
2422
{
2523
Serial.begin(9600);
@@ -43,4 +41,4 @@ void countInt() // interrupt when compare value
4341

4442
if (source == rtc.INT_COMP0) Serial.println("Count = Compare 0!");
4543
if (source == rtc.INT_COMP1) Serial.println("Count = Compare 1!");
46-
}
44+
}

examples/Mode1_16-bit_Periodic_Counter_Overflow/Mode1_16-bit_Periodic_Counter_Overflow.ino

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
/* Create an rtc object */
2020
RTCZero rtc;
2121

22-
void countInt(void);
23-
2422
void setup()
2523
{
2624
Serial.begin(9600);
@@ -46,4 +44,4 @@ void countInt() // interrupt when compare value
4644
if (source == rtc.INT_COMP0) Serial.println("Count = Compare 0!");
4745
if (source == rtc.INT_COMP1) Serial.println("Count = Compare 1!");
4846
if (source == rtc.INT_OVERFLOW) Serial.println("Overflow!");
49-
}
47+
}

keywords.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ setAlarmTime KEYWORD2
5252
enableAlarm KEYWORD2
5353
disableAlarm KEYWORD2
5454

55-
enableCounter KEYWORD2
56-
disableCounter KEYWORD2
55+
enableCounter KEYWORD2
56+
disableCounter KEYWORD2
5757

58-
enableOverflow KEYWORD2
59-
disableOverflow KEYWORD2
58+
enableOverflow KEYWORD2
59+
disableOverflow KEYWORD2
6060

61-
getIntSource KEYWORD2
62-
getCount KEYWORD2
63-
getCompare KEYWORD2
61+
getIntSource KEYWORD2
62+
getCount KEYWORD2
63+
getCompare KEYWORD2
6464

65-
setCount KEYWORD2
66-
setPeriod KEYWORD2
65+
setCount KEYWORD2
66+
setPeriod KEYWORD2
6767

6868
standbyMode KEYWORD2
6969

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=RTCZero
2-
version=2.0.0
2+
version=1.7.0
33
author=Arduino
44
maintainer=Arduino <info@arduino.cc>
55
sentence=Allows to use the RTC functionalities. For Arduino Zero, MKRZero and MKR1000 only.

src/RTCZero.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20-
//Edited by A. McMahon 2/20/2020, Added Mode 0 and Mode 1
21-
2220
#include <time.h>
2321

2422
#include "RTCZero.h"
@@ -55,7 +53,7 @@ void RTCZero::begin(bool resetTime, uint8_t mode, bool clearOnMatch, Prescaler p
5553
config32kOSC();
5654

5755

58-
if (rtc_mode==0) {
56+
if (rtc_mode==0) {
5957
// If the RTC is in 32-bit counter mode and the reset was
6058
// not due to POR or BOD, preserve the clock time
6159
// POR causes a reset anyway, BOD behaviour is?
@@ -730,7 +728,7 @@ void RTCZero::RTCreset()
730728
void RTCZero::RTCresetRemove()
731729
{
732730
if (rtc_mode==0) RTC->MODE0.CTRL.reg &= ~RTC_MODE0_CTRL_SWRST; // software reset remove, Mode 0
733-
if (rtc_mode==1) RTC->MODE1.CTRL.reg &= ~RTC_MODE1_CTRL_SWRST; // software reset remove, Mode 1
731+
else if (rtc_mode==1) RTC->MODE1.CTRL.reg &= ~RTC_MODE1_CTRL_SWRST; // software reset remove, Mode 1
734732
else RTC->MODE2.CTRL.reg &= ~RTC_MODE2_CTRL_SWRST; // software reset remove, Mode 2
735733
while (RTCisSyncing())
736734
;

src/RTCZero.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20-
//Edited by A. McMahon 2/20/2020, Added Mode 0 and Mode 1
21-
2220
#ifndef RTC_ZERO_H
2321
#define RTC_ZERO_H
2422

0 commit comments

Comments
 (0)