Permalink
Browse files

Added DST Icon to indicate when it is daylight savings time.

  • Loading branch information...
1 parent 7913a78 commit 1f3a1343d8c5a2e58f70d91437810d1a18f00a58 @samckittrick committed Feb 2, 2012
Showing with 16 additions and 2 deletions.
  1. BIN Images/Images.ods
  2. BIN Images/qpdr2xyj.jpg
  3. +0 −1 firmware/AdvancedFeatures.c
  4. +15 −0 firmware/anim.c
  5. +1 −1 firmware/ratt.c
View
Binary file not shown.
View
Deleted file not rendered
@@ -581,7 +581,6 @@ uint32_t dstCalculate(uint8_t hour, uint8_t dotw_target, uint8_t n, uint8_t mont
}
//allow for nth occurance of target dow
dstDay += 7*(n-1);
-
uint32_t dstSeconds = secondsIntoYear(dstDay, month, year); //where in the year is it?
return dstSeconds += 3600*hour; //consider the time not just the day
}
View
@@ -81,6 +81,12 @@ uint8_t haveAlarmIcon;
uint8_t spaceStation[] = { 0x00, 0x6C, 0x10, 0x6C, 0x00 };
uint8_t stationLocation, oldStationLocation, lastStationTime;
+#ifdef AUTODST
+//DST Icon
+//11x7 icon. See images.ods
+uint8_t dstIcon[] = { 0xF8, 0x88, 0xF8, 0x00, 0x74, 0x54, 0x5C, 0x00, 0x20, 0x3F, 0x20 };
+#endif //#ifdef AUTODST
+
//Is it time to redraw the screen?
uint8_t redraw_time = 0;
uint8_t redraw_station = 0;
@@ -488,6 +494,15 @@ void draw(uint8_t inverted) {
glcdFillRectangle(43 + i, (GLCD_YPIXELS - 8) + j, 1, 1, !inverted);
}
+ #ifdef AUTODST
+ //draw dst icon
+ if(autodst_isDST)
+ for(uint8_t i = 0; i < 11; i++)
+ for(uint8_t j = 0; j < 8; j++)
+ if(dstIcon[i] & ((uint8_t)1 << (8 - j)))
+ glcdFillRectangle(52 + i, (GLCD_YPIXELS - 9) + j, 1, 1, !inverted);
+ #endif //#ifdef AUTODST
+
//write time
glcdSetAddress(GLCD_XPIXELS - 37, GLCD_TEXT_LINES-1);
if((hour12/10) == 0)
View
@@ -51,7 +51,7 @@ uint16_t snoozetimer = 0;
//Rules for autodst
//they are an array of 9 values
//{start_hour24, start_dotw, start_n, start_month, end_hour24, end_dotw, end_n, end_month, offset}
-uint8_t rule[] = {2, 0, 2, 3, 2, 0, 2, 11, 1};
+uint8_t rule[] = {2, 0, 2, 3, 2, 0, 1, 11, 1};
SIGNAL(TIMER1_OVF_vect) {
PIEZO_PORT ^= _BV(PIEZO);

0 comments on commit 1f3a134

Please sign in to comment.