/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-18 18:29:50 UTC
  • Revision ID: tim@ed.am-20120518182950-t85bn9a21n72uzm8
text messages are now individually enabled and draw()n automatically

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 2012
 
29
#define YEAR_MIN 2010
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 = YEAR_MIN;
 
81
        if( _year < YEAR_MIN || _year > YEAR_MAX ) _year = 2010;
82
82
        if( _month < 1 || _month > 12 ) _month = 1;
83
83
        if( _day < 1 || _day > days_in_month( _year, _month ) ) _day = 1;
84
84
}