Skip to content

Commit

Permalink
Fixed a typo that broke the compatibility with Atmega644
Browse files Browse the repository at this point in the history
  • Loading branch information
leomil72 committed Feb 13, 2018
1 parent d649523 commit fdb0ec4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ It's based on an internal timer and it requires no external hardware.

VERSION HISTORY

2018/02/13 - v. 1.2.8: Fixed a typo that broke the compatibility with Atmega644
2017/01/27 - v. 1.2.7: added support for ATmega32U4 (thanks to Esteban Torre and piluex)
2016/05/21 - v. 1.2.6: fixed timestamp functions when we are in leap years (I hope definitely..)
2016/02/21 - v. 1.2.5: fixed a bug into the deltaT arithmetics that leads to double count the computation.
Expand Down Expand Up @@ -217,4 +218,4 @@ lesto - from <www.arduino.cc> forum

********************************************************************

Last document revision: 2017/01/27
Last document revision: 2018/02/13
3 changes: 1 addition & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name=swRTC
version=1.2.7
version=1.2.8
author=Leonardo Miliani, lesto
maintainer=Leonardo Miliani
sentence=Software implementation of a Real-Time Clock for Arduino boards and Atmel microcontrollers.
paragraph=
category=Communication
url=http://www.leonardomiliani.com
architectures=*

12 changes: 6 additions & 6 deletions swRTC.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define swRTC_H

//library version
#define swRTC_VERSION 127
#define swRTC_VERSION 128

//Library is compatible both with Arduino <=0023 and Arduino >=100
#if defined(ARDUINO) && (ARDUINO >= 100)
Expand Down Expand Up @@ -62,7 +62,7 @@
#error Sorry, microcontroller not supported!
#endif

//RTC module is preset in: ATMEGA8, ATMEGAx44, ATMEGAx8, ATMEGAx0
//RTC module is preset in: ATMEGA8, ATMEGAX4, ATMEGAx8, ATMEGAx0
//RTC is NOT in: ATTINYx4, ATTINYx5, ATTINYx313, ATMEGA32u4
#if defined (USE_INTERNAL_RTC)
#if defined (ATTINYx4) || defined (ATTINYx313) || defined (ATTINYx5) || defined(ATMEGAxU)
Expand Down Expand Up @@ -150,7 +150,7 @@ swRTC::swRTC(void) {
void swRTC::setTimer() {
float prescaler = 0.0;

#if defined (ATMEGAx8) || defined (ATMEGAx44) || defined (ATMEGAx0)
#if defined (ATMEGAx8) || defined (ATMEGA644) || defined (ATMEGAx0)
//during setup, disable all the interrupts based on timer
TIMSK2 &= ~(1<<TOIE2);
TIMSK2 &= ~((1<<OCIE2A) | (1<<OCIE2B));
Expand Down Expand Up @@ -516,7 +516,7 @@ unsigned long swRTC::getTimestamp(int yearT){
if (getMonth() <= 2 ) {
time -= 86400UL;
}
}
}
return (time - 86400UL); //because years start at day 0.0, not day 1.
}

Expand Down Expand Up @@ -623,7 +623,7 @@ byte swRTC::setClockWithTimestamp(unsigned long timeT, int yearRef) {
if (isLeapYear(year + 1)) {
yearT++;
}
};
};
//in leap years we have a day more but we also be careful if we are on feb., 28th
//because we must go to feb., 29th
if (isLeapYear(yearT)) {
Expand All @@ -636,7 +636,7 @@ byte swRTC::setClockWithTimestamp(unsigned long timeT, int yearRef) {
month = 1;
year++;
}
}
}
}
hours = hoursT;
minutes = minutesT;
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.7
1.2.8

0 comments on commit fdb0ec4

Please sign in to comment.