/elec/propeller-clock

To get this branch, use:
bzr branch http://bzr.ed.am/elec/propeller-clock

« back to all changes in this revision

Viewing changes to src/time.cc

  • Committer: Tim Marston
  • Date: 2012-05-23 23:02:50 UTC
  • Revision ID: tim@ed.am-20120523230250-3pls2u6zt3av0uam
fixed text glitch; extended all modes; added screen flip super-long press;
added button unpress debounde; moved interim button press ignoration to
settings mode; fixed left-over led issue; finished for demo!

Show diffs side-by-side

added added

removed removed

26
26
 
27
27
 
28
28
#define YEAR_MAX 2030
29
 
#define YEAR_MIN 2010
 
29
#define YEAR_MIN 2012
30
30
 
31
31
 
32
32
// year
78
78
        _seconds = rtc_data[ DS1307_SEC ];
79
79
 
80
80
        // make sure some numbers are in range
81
 
        if( _year < YEAR_MIN || _year > YEAR_MAX ) _year = 2010;
 
81
        if( _year < YEAR_MIN || _year > YEAR_MAX ) _year = YEAR_MIN;
82
82
        if( _month < 1 || _month > 12 ) _month = 1;
83
83
        if( _day < 1 || _day > days_in_month( _year, _month ) ) _day = 1;
84
84
}