diff options
Diffstat (limited to 'main.c')
| -rwxr-xr-x | main.c | 23 | 
1 files changed, 11 insertions, 12 deletions
| @@ -396,7 +396,6 @@ void edit_Date_Time(void) {                      Lcd_Set_Cursor(1, 1);
                      display_Digit(hour);
                  }
 -                updateRTC |= (hour_org == hour);
                  break;
 @@ -424,8 +423,7 @@ void edit_Date_Time(void) {                      Lcd_Set_Cursor(1, 4);
                      display_Digit(min);
                  }
 -                updateRTC |= (min_org == min);
 -                
 +
                  break;
              case 3: //Seconds
 @@ -458,8 +456,7 @@ void edit_Date_Time(void) {                          updateRTC = 1;
                      }
                  }
 -                updateRTC |= (sec_org == sec);
 -                
 +
                  break;
              case 6: //Date
 @@ -492,8 +489,7 @@ void edit_Date_Time(void) {                      Lcd_Set_Cursor(2, 6);
                      display_Digit(date);
                  }
 -                updateRTC |= (date_org == date);
 -                
 +
                  break;
              case 5: //Month
 @@ -520,8 +516,7 @@ void edit_Date_Time(void) {                      Lcd_Set_Cursor(2, 9);
                      display_Digit(month);
                  }
 -                updateRTC |= (month_org == month);
 -                
 +
                  break;
              case 4: //Year
 @@ -548,8 +543,7 @@ void edit_Date_Time(void) {                      Lcd_Set_Cursor(2, 14);
                      display_Digit(year);
                  }
 -                updateRTC |= (year_org == year);
 -                
 +
                  break;
                  //TODO Maybe add a case to edit century on display
 @@ -576,7 +570,12 @@ void edit_Date_Time(void) {          Lcd_Write_String(" ");
          edit_datetime = 0;
 -        if(updateRTC) {
 +        /*
 +         * If any date/time field was changed, clear updateRTC field and
 +         * update RTC.
 +        */
 +        if(hour_org != hour || min_org != min || sec_org != sec
 +                || year_org != year || month_org != month || date_org != date) {
              updateRTC = 0;
              Set_Time();
              Set_DayOfWeek(Get_DayOfWeek(year, month, date));
 | 
