/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/text_renderer.cc

  • Committer: edam
  • Date: 2012-03-23 15:56:07 UTC
  • Revision ID: tim@ed.am-20120323155607-6h8pc0c6o35nl179
switch button to no interim presses during settings mode; added NVRAM support

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "Arduino.h"
26
26
#include <avr/pgmspace.h>
27
27
#include "common.h"
 
28
#include "nvram.h"
28
29
 
29
30
 
30
31
// cached glyph
350
351
}
351
352
 
352
353
 
 
354
void TextRenderer::init()
 
355
{
 
356
        Nvram::load( Nvram::NVRAM_FONT, _font );
 
357
        if( _font < 0 || _font >= 4 ) _font = 0;
 
358
}
 
359
 
 
360
 
353
361
int TextRenderer::get_width( int message_len )
354
362
{
355
363
        return message_len * 8 * TEXT_SCALE;
427
435
{
428
436
        if( ++_font >= 4 )
429
437
                _font = 0;
 
438
        Nvram::save( Nvram::NVRAM_FONT, _font );
430
439
}