/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/modes/digital_clock.cc

  • Committer: Tim Marston
  • Date: 2012-05-09 21:36:01 UTC
  • Revision ID: tim@ed.am-20120509213601-kk1tqa9yg4xk45y9
added info mode, a '/' to the fonts and cleaned up a couple of bits

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
        switch( _flavour )
38
38
        {
39
39
        case 0:
40
 
                Text::reset_message( 0, Text::MODE_TOP | Text::MODE_ALL,
41
 
                                Text::SCALE_FAT);
 
40
                Text::reset_message( 0, Text::MODE_TOP | Text::MODE_ALL );
 
41
                Text::reset_message( 1, Text::MODE_BOTTOM | Text::MODE_ONEQUARTER );
42
42
                break;
43
43
        case 1:
44
44
                Text::reset_message( 0, Text::MODE_HSCROLL | Text::MODE_TOP |
45
45
                                Text::MODE_THREEQUARTERS );
 
46
                Text::reset_message( 1, Text::MODE_BOTTOM | Text::MODE_ONEQUARTER );
46
47
                break;
47
48
        }
48
49
}
67
68
 
68
69
void digital_clock_draw_reset()
69
70
{
70
 
        PString str0( Text::_messages[ 0 ], MESSAGE_LEN * 4 );
 
71
        PString str0( Text::_messages[ 0 ], MESSAGE_LEN );
 
72
        PString str1( Text::_messages[ 1 ], MESSAGE_LEN );
71
73
        str0.begin();
 
74
        str1.begin();
72
75
 
73
76
        switch( _flavour )
74
77
        {
77
80
                        ::millis() % 1000 < 500? ':' : '.',
78
81
                        Time::get_minutes(),
79
82
                        Time::get_hours() >= 12? "pm" : "am" );
 
83
                str1.print( "- -" );
80
84
                break;
81
85
        case 1:
82
86
                str0.format( "%d%s %s, %d", Time::get_day(),
86
90
        }
87
91
 
88
92
        Text::set_message( 0, str0 );
 
93
        Text::set_message( 1, str1 );
89
94
}
90
95
 
91
96