heat control
r71
|
Go to the source code of this file.
Functions | |
void | TimerInit (void) |
initialize timer resource period: 32µs More... | |
ISR (TIMER0_COMPA_vect) | |
compare match interrupt service for OCR0A More... | |
BTN_CODE | DecodeButton (void) |
identify whether a (and which) button is pressed or not More... | |
UCHAR | GetTenthSec (void) |
interface to get the global tenth seconds More... | |
UCHAR | gMov () |
return minute overflow counter More... | |
void | sMov (UCHAR mov) |
set minute overflow counter More... | |
Variables | |
UINT volatile | g_debouncer = 0 |
UCHAR volatile | g_s100 = 0 |
UCHAR volatile | g_sec = 0 |
UINT volatile | g_min = 0 |
UCHAR volatile | g_mov = 0 |
CTRL_MODE volatile | g_ctm = CM_MEAS |
ENG_TIMER volatile | g_et |
BTN_CODE DecodeButton | ( | void | ) |
identify whether a (and which) button is pressed or not
btnOff | offset value, indicates the action which is active dependent on the press duration |
Definition at line 119 of file timer.c.
References BC_DN, BC_DNUP, BC_DNUP_L, BC_NONE, BC_UP, BTN_DN, BTN_UP, DEBOUNCED_L, DEBOUNCED_S, FALSE, g_debouncer, TRUE, UCHAR, and UINT.
Referenced by main().
UCHAR GetTenthSec | ( | void | ) |
interface to get the global tenth seconds
Definition at line 192 of file timer.c.
References g_s100.
Referenced by PrintPage().
UCHAR gMov | ( | void | ) |
ISR | ( | TIMER0_COMPA_vect | ) |
compare match interrupt service for OCR0A
TIMER0_COMPA_vect | desired compare match interrupt vector |
counter to count a tenth of a second
counter to count one second
Definition at line 72 of file timer.c.
References ENG_TIMER::allow, CM_MEAS, ENG_TIMER::cnt, ENG_TIMER::em, EM_STOP, ENG_STOP_CCW, ENG_STOP_CW, FALSE, g_ctm, g_debouncer, g_min, g_mov, g_s100, g_sec, IV_1S, NUM_MS, T0_INC20, UCHAR, and UINT.
void sMov | ( | UCHAR | mov | ) |
void TimerInit | ( | void | ) |
initialize timer resource
period: 32µs
TCCR0B <- Timer/Counter0 Control Register B
| - | - | - | TSM [0] | PSR0 [0] | CS02 [1] | CS01 [0] | CS00 [0] |
clock selection:
CS02:CS00, we need a clkio division of 256
enable compare match mode
T0 match value (to get 20ms period)
enable compare match A interrupt
no PLL used
Definition at line 38 of file timer.c.
References CTC0, T0_INC20, and TCC_R0.
Referenced by Init().
UINT volatile g_debouncer = 0 |
UINT volatile g_min = 0 |
UCHAR volatile g_mov = 0 |
UCHAR volatile g_s100 = 0 |
number of tenth seconds, range is [0-9]
Definition at line 11 of file timer.c.
Referenced by GetTenthSec(), and ISR().