/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: 2013-03-31 17:07:11 UTC
  • Revision ID: tim@ed.am-20130331170711-okfhn3wx9y0eo99a
updated the schematic to increase minimum font size

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
}