/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/propeller-clock.cc

  • Committer: Tim Marston
  • Date: 2012-05-17 22:48:38 UTC
  • Revision ID: tim@ed.am-20120517224838-25hjd6umh35vmtwn
updated arduino.mk

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
#include "modes/digital_clock.h"
84
84
#include "modes/test_pattern.h"
85
85
#include "modes/settings_mode.h"
 
86
#include "modes/info_mode.h"
86
87
#include "text.h"
87
88
#include "text_renderer.h"
88
89
#include "common.h"
118
119
#define ANALOGUE_CLOCK_IDX 0
119
120
#define DIGITAL_CLOCK_IDX 1
120
121
#define TEST_PATTERN_IDX 2
 
122
#define INFO_MODE_IDX 3
121
123
 
122
124
//_____________________________________________________________________________
123
125
//                                                                         code
134
136
        switch( _minor_mode ) {
135
137
        case ANALOGUE_CLOCK_IDX: analogue_clock_activate(); break;
136
138
        case DIGITAL_CLOCK_IDX: digital_clock_activate(); break;
 
139
        case INFO_MODE_IDX: info_mode_activate(); break;
137
140
        }
138
141
}
139
142
 
171
174
                                switch( _minor_mode ) {
172
175
                                case ANALOGUE_CLOCK_IDX: analogue_clock_press(); break;
173
176
                                case DIGITAL_CLOCK_IDX: digital_clock_press(); break;
 
177
                                case INFO_MODE_IDX: info_mode_press(); break;
174
178
                                }
175
179
                                break;
176
180
                        case SETTINGS_MODE_IDX: settings_mode_press(); break;
222
226
                        switch( _minor_mode ) {
223
227
                        case ANALOGUE_CLOCK_IDX: analogue_clock_draw_reset(); break;
224
228
                        case DIGITAL_CLOCK_IDX: digital_clock_draw_reset(); break;
 
229
                        case INFO_MODE_IDX: info_mode_draw_reset(); break;
225
230
                        }
226
231
                        break;
227
232
                case SETTINGS_MODE_IDX: settings_mode_draw_reset(); break;
238
243
                case ANALOGUE_CLOCK_IDX: analogue_clock_draw( segment ); break;
239
244
                case DIGITAL_CLOCK_IDX: digital_clock_draw( segment ); break;
240
245
                case TEST_PATTERN_IDX: test_pattern_draw( segment ); break;
 
246
                case INFO_MODE_IDX: info_mode_draw( segment ); break;
241
247
                }
242
248
                break;
243
249
        case SETTINGS_MODE_IDX: settings_mode_draw( segment ); break;
298
304
}
299
305
 
300
306
 
301
 
// ISR to handle the pulses from the fan's tachiometer
 
307
// ISR to handle the pulses from the fan's tachometer
302
308
void fan_pulse_handler()
303
309
{
304
310
        // the fan actually sends two pulses per revolution. These pulses
318
324
// main setup
319
325
void setup()
320
326
{
321
 
        // set up an interrupt handler on pin 2 to nitice fan pulses
 
327
        // set up an interrupt handler on pin 2 to notice fan pulses
322
328
        attachInterrupt( 0, fan_pulse_handler, RISING );
323
329
        digitalWrite( 2, HIGH );
324
330