Skip to content

Commit a2aadb4

Browse files
committed
ibid bugfix
1 parent 5f700ea commit a2aadb4

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

arduino-nixie/arduino-nixie.ino

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,17 +1585,27 @@ void updateDisplay(){
15851585

15861586
} //end updateDisplay()
15871587

1588+
// void serialPrintDate(int y, byte m, byte d){
1589+
// Serial.print(y,DEC); Serial.print(F("-"));
1590+
// if(m<10) Serial.print(F("0")); Serial.print(m,DEC); Serial.print(F("-"));
1591+
// if(d<10) Serial.print(F("0")); Serial.print(d,DEC);
1592+
// }
1593+
// void serialPrintTime(int todMins){
1594+
// if(todMins/60<10) Serial.print(F("0")); Serial.print(todMins/60,DEC); Serial.print(F(":"));
1595+
// if(todMins%60<10) Serial.print(F("0")); Serial.print(todMins%60,DEC);
1596+
// }
1597+
15881598
//A snapshot of sun times, in minutes past midnight, calculated at clean time and when the date or time is changed.
15891599
//Need to capture this many, as we could be displaying these values at least through end of tomorrow depending on when cleaning happens.
1590-
1600+
#if ENABLE_DATE_RISESET
15911601
byte sunDate = 0; //date of month when calculated ("today")
15921602
int sunSet0 = -1; //yesterday's set
15931603
int sunRise1 = -1; //today rise
15941604
int sunSet1 = -1; //today set
15951605
int sunRise2 = -1; //tomorrow rise
15961606
int sunSet2 = -1; //tomorrow set
15971607
int sunRise3 = -1; //day after tomorrow rise
1598-
void calcSun(int y, byte m, byte d){ if(ENABLE_DATE_RISESET){
1608+
void calcSun(int y, byte m, byte d){
15991609
//Calculates sun times and stores them in the values above
16001610
blankDisplay(0,5,false); //immediately blank display so we can fade in from it elegantly
16011611
Dusk2Dawn here(readEEPROM(10,true)/10, readEEPROM(12,true)/10, (float(readEEPROM(14,false))-100)/4);
@@ -1624,17 +1634,7 @@ void calcSun(int y, byte m, byte d){ if(ENABLE_DATE_RISESET){
16241634
sunRise3 = here.sunrise(y,m,d,isDST(y,m,d));
16251635
// serialPrintDate(y,m,d);
16261636
// Serial.print(F(" Rise ")); serialPrintTime(sunRise3); Serial.println();
1627-
}} //end calcSun()
1628-
// void serialPrintDate(int y, byte m, byte d){
1629-
// Serial.print(y,DEC); Serial.print(F("-"));
1630-
// if(m<10) Serial.print(F("0")); Serial.print(m,DEC); Serial.print(F("-"));
1631-
// if(d<10) Serial.print(F("0")); Serial.print(d,DEC);
1632-
// }
1633-
// void serialPrintTime(int todMins){
1634-
// if(todMins/60<10) Serial.print(F("0")); Serial.print(todMins/60,DEC); Serial.print(F(":"));
1635-
// if(todMins%60<10) Serial.print(F("0")); Serial.print(todMins%60,DEC);
1636-
// }
1637-
1637+
} //end calcSun()
16381638
void displaySun(byte which, int d, int tod){
16391639
//Displays sun times from previously calculated values
16401640
//Old code to calculate sun at display time, with test serial output, is in commit 163ca33
@@ -1668,6 +1668,11 @@ void displaySun(byte which, int d, int tod){
16681668
blankDisplay(4, 4, true);
16691669
editDisplay(evtIsRise, 5, 5, false, true);
16701670
}
1671+
#else
1672+
//to give other fns something empty to call, when rise/set isn't enabled
1673+
void calcSun(int y, byte m, byte d){}
1674+
void displaySun(byte which, int d, int tod){}
1675+
#endif
16711676

16721677
void displayWeather(byte which){
16731678
//shows high/low temp (for day/night respectively) on main tubes, and precipitation info on seconds tubes

0 commit comments

Comments
 (0)