Skip to content

Commit 5b97f68

Browse files
committed
Almost minor changes inside the examples
- minor changes inside the Examples - minor changes inside the Library on the function isDateAlreadySet - some cosmetic changes inside the keywords.txt
1 parent 253d3e8 commit 5b97f68

File tree

8 files changed

+36
-31
lines changed

8 files changed

+36
-31
lines changed

change.log

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2016/08/10 RTCDue Library v1.1
2+
3+
fixed
4+
- minor changes inside the Examples
5+
- minor changes inside the Library on the function isDateAlreadySet
6+
- some cosmetic changes inside the keywords.txt
7+
18
2016/07/22 RTCDue Library v1.0
29
Initial Release
310

examples/RTCDue_AlarmDate_Sample/RTCDue_AlarmDate_Sample.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ long previousMillis = 0; // will store last time LED was updated
1818
long interval = 250; // interval at which to blink (milliseconds)
1919

2020
// Select the Slowclock source
21-
//rtc rtc(RC);
21+
//RTCDue rtc(RC);
2222
RTCDue rtc(XTAL);
2323

2424
const char* daynames[]={"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};

examples/RTCDue_AlarmTime_Sample/RTCDue_AlarmTime_Sample.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ long previousMillis = 0; // will store last time LED was updated
1818
long interval = 250; // interval at which to blink (milliseconds)
1919

2020
// Select the Slowclock source
21-
//rtc rtc(RC);
21+
//RTCDue rtc(RC);
2222
RTCDue rtc(XTAL);
2323

2424
void setup() {

examples/RTCDue_NTP_ETHERNET_with_timezone/RTCDue_NTP_ETHERNET_with_timezone.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ byte packetBuffer[NTP_PACKET_SIZE]; // buffer to hold incoming and outgoing pa
3232
EthernetUDP Udp;
3333

3434
// Select the Slowclock source
35-
//RTC_clock rtc_clock(RC);
35+
//RTCDue rtc(RC);
3636
RTCDue rtc(XTAL);
3737

3838
const char* daynames[]={"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};

examples/RTCDue_NTP_WIFI_with_timezone/RTCDue_NTP_WIFI_with_timezone.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#include <RTCDue.h>
1818

1919
int status = WL_IDLE_STATUS;
20-
char ssid[] = "In Wartung"; // your network SSID (name)
21-
char pass[] = "74586047417299618119"; // your network password
20+
char ssid[] = "SSID"; // your network SSID (name)
21+
char pass[] = "password"; // your network password
2222
int keyIndex = 0; // your network key Index number (needed only for WEP)
2323

2424
unsigned int localPort = 2390; // local port to listen for UDP packets
@@ -33,7 +33,7 @@ byte packetBuffer[NTP_PACKET_SIZE]; // buffer to hold incoming and outgoing pa
3333
WiFiUDP Udp;
3434

3535
// Select the Slowclock source
36-
//RTC_clock rtc_clock(RC);
36+
//RTCDue rtc(RC);
3737
RTCDue rtc(XTAL);
3838

3939
const char* daynames[]={"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
@@ -142,7 +142,7 @@ void printTime(time_t t, const char *tz, const char *loc) {
142142
digitprint(minute(t), 2);
143143
Serial.print(":");
144144
digitprint(second(t), 2);
145-
Serial.print(" ");
145+
Serial.print(" ");
146146
Serial.print(dayShortStr(weekday(t)));
147147
Serial.print(": ");
148148
digitprint(day(t), 2);

keywords.txt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ setHours KEYWORD2
2323
setDay KEYWORD2
2424
setMonth KEYWORD2
2525
setYear KEYWORD2
26+
setClock KEYWORD2
2627
setAlarmTime KEYWORD2
2728
setAlarmDate KEYWORD2
2829

@@ -34,22 +35,19 @@ getDay KEYWORD2
3435
getDayofWeek KEYWORD2
3536
getMonth KEYWORD2
3637
getYear KEYWORD2
38+
getTime KEYWORD2
39+
getDate KEYWORD2
40+
getValidEntry KEYWORD2
41+
unixtime KEYWORD2
42+
43+
isSummertime KEYWORD2
44+
isDateAlreadySet KEYWORD2
3745

3846
attachAlarm KEYWORD2
3947
detachAlarm KEYWORD2
4048
disableAlarmTime KEYWORD2
4149
disableAlarmDate KEYWORD2
4250

43-
unixtime KEYWORD2
44-
getTime KEYWORD2
45-
getDate KEYWORD2
46-
getValidEntry KEYWORD2
47-
isSummertime KEYWORD2
48-
switch_years KEYWORD2
49-
timing KEYWORD2
50-
dateAlready_set KEYWORD2
51-
setClock KEYWORD2
52-
5351
#######################################
5452
# Instances (KEYWORD2)
5553
#######################################

src/RTCDue.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,19 @@ uint32_t RTCDue::currentTime ()
159159
return (dwTime);
160160
}
161161

162+
int RTCDue::isDateAlreadySet ()
163+
{
164+
uint32_t dateregister;
165+
166+
/* Get current RTC date */
167+
dateregister = currentDate ();
168+
169+
if ( RESET_VALUE != dateregister )
170+
return 1;
171+
else
172+
return 0;
173+
}
174+
162175
void RTCDue::getTime (int *hour, int *minute, int *second)
163176
{
164177
RTC_GetTime(RTC, (uint8_t*)hour, (uint8_t*)minute, (uint8_t*)second);
@@ -278,19 +291,6 @@ uint32_t RTCDue::currentDate ()
278291
return (dwTime);
279292
}
280293

281-
int RTCDue::dateAlreadyset ()
282-
{
283-
uint32_t dateregister;
284-
285-
/* Get current RTC date */
286-
dateregister = currentDate ();
287-
288-
if ( RESET_VALUE != dateregister )
289-
return 1;
290-
else
291-
return 0;
292-
}
293-
294294
void RTCDue::getDate (int *day_of_week, int *day, int *month, uint16_t *year)
295295
{
296296
RTC_GetDate(RTC, (uint16_t*)year, (uint8_t*)month, (uint8_t*)day, (uint8_t*)day_of_week);

src/RTCDue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class RTCDue
3333
void setClock (unsigned long timestamp);
3434
uint16_t getYear ();
3535
int getMonth ();
36-
int dateAlreadyset ();
3736
int getDay ();
3837
int getDayofWeek ();
3938
int calculateDayofWeek (uint16_t year, int month, int day);
@@ -58,6 +57,7 @@ class RTCDue
5857
void getDate (int *day_of_week, int *day, int *month, uint16_t *year);
5958
int getValidEntry ();
6059
int isSummertime (int select);
60+
int isDateAlreadySet ();
6161
uint32_t changeTime (uint32_t _now);
6262
uint32_t changeDate (uint32_t _now);
6363

0 commit comments

Comments
 (0)