@@ -1585,17 +1585,27 @@ void updateDisplay(){
1585
1585
1586
1586
} // end updateDisplay()
1587
1587
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
+
1588
1598
// A snapshot of sun times, in minutes past midnight, calculated at clean time and when the date or time is changed.
1589
1599
// 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
1591
1601
byte sunDate = 0 ; // date of month when calculated ("today")
1592
1602
int sunSet0 = -1 ; // yesterday's set
1593
1603
int sunRise1 = -1 ; // today rise
1594
1604
int sunSet1 = -1 ; // today set
1595
1605
int sunRise2 = -1 ; // tomorrow rise
1596
1606
int sunSet2 = -1 ; // tomorrow set
1597
1607
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){
1599
1609
// Calculates sun times and stores them in the values above
1600
1610
blankDisplay (0 ,5 ,false ); // immediately blank display so we can fade in from it elegantly
1601
1611
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){
1624
1634
sunRise3 = here.sunrise (y,m,d,isDST (y,m,d));
1625
1635
// serialPrintDate(y,m,d);
1626
1636
// 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()
1638
1638
void displaySun (byte which, int d, int tod){
1639
1639
// Displays sun times from previously calculated values
1640
1640
// 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){
1668
1668
blankDisplay (4 , 4 , true );
1669
1669
editDisplay (evtIsRise, 5 , 5 , false , true );
1670
1670
}
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
1671
1676
1672
1677
void displayWeather (byte which){
1673
1678
// shows high/low temp (for day/night respectively) on main tubes, and precipitation info on seconds tubes
0 commit comments