Skip to content

Commit

Permalink
fix dst bug
Browse files Browse the repository at this point in the history
fix filenames to be all upper case for compatibility with latest
sdfat library which is now case sensitive.
  • Loading branch information
d0ughb0y committed Jul 9, 2016
1 parent cd4aaf3 commit 219545e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions Network.ino
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,13 @@ void updateRTC(){
void autoDST(time_t t) {
if (IsDST(t)==isDst) return;
isDst = !isDst;
if (isDst)
if (isDst) {
RTC.set(t+SECS_PER_HOUR);
else
tz = STDTZOFFSET+1;
} else {
RTC.set(t-SECS_PER_HOUR);
tz = STDTZOFFSET;
}
setTime(RTC.get());
logMessage(F("Auto adjusted DST time."));
char buf[20];
Expand Down
10 changes: 5 additions & 5 deletions Utils.ino
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void logOutlet() {
if (lhead != ltail) {
char buffer[20];
boolean inoutlog = false;
if (logSetup(ts, buffer, "OUT","txt")) {
if (logSetup(ts, buffer, "OUT","TXT")) {
time_t currtime = ts;
while (lhead != ltail) {
fileout_ << F("<record><date>") << buffer << F("</date><name>");
Expand Down Expand Up @@ -469,7 +469,7 @@ void logOutlet() {

void logSensors() {
char buffer[20];
if (logSetup(now2(),buffer,"SEN","txt")) {
if (logSetup(now2(),buffer,"SEN","TXT")) {
fileout_ << F("<record><date>") << buffer << F("</date>");
#ifdef _TEMP
for (int i=0;i<MAXTEMP;i++) {
Expand Down Expand Up @@ -501,7 +501,7 @@ void logSensors() {

void logMessage(const __FlashStringHelper *msg,const char* str) {
char buffer[20];
if (logSetup(now2(),buffer, "LOG","log")) {
if (logSetup(now2(),buffer, "LOG","LOG")) {
fileout_ << buffer << F(" ") << msg << F(" ") << str << F("\n");
fileout_.close();
}
Expand All @@ -522,7 +522,7 @@ void logMessage(const __FlashStringHelper *msg, int n) {

void logMessage(uint8_t ip[], const char* msg) {
char buffer[20];
if (logSetup(now2(), buffer, "LOG", "log")) {
if (logSetup(now2(), buffer, "LOG", "LOG")) {
fileout_ << buffer << F(" ") << (int)ip[0] << F(".") << (int)ip[1] << F(".") << (int)ip[2];
fileout_ << F(".") << (int)ip[3] << F(" ") << msg << F("\n");
fileout_.close();
Expand All @@ -531,7 +531,7 @@ void logMessage(uint8_t ip[], const char* msg) {

void logAlarm() {
char buffer[20];
if (logSetup(now2(), buffer, "LOG", "log")) {
if (logSetup(now2(), buffer, "LOG", "LOG")) {
fileout_ << buffer << F(" Alarm Event: ");
#ifdef _TEMP
for (uint8_t i=0;i<MAXTEMP;i++) {
Expand Down

0 comments on commit 219545e

Please sign in to comment.