Indented.
This commit is contained in:
@@ -41,30 +41,31 @@ volatile uint8_t Timer_Milliseconds = 0;
|
||||
static volatile uint16_t SilenceTime;
|
||||
|
||||
/* Configure the Timer */
|
||||
void Timer_Initialize(void)
|
||||
void Timer_Initialize(
|
||||
void)
|
||||
{
|
||||
/* Normal Operation */
|
||||
TCCR1A = 0;
|
||||
/* CSn2 CSn1 CSn0 Description
|
||||
---- ---- ---- -----------
|
||||
0 0 0 No Clock Source
|
||||
0 0 1 No prescaling
|
||||
0 1 0 CLKio/8
|
||||
0 1 1 CLKio/64
|
||||
1 0 0 CLKio/256
|
||||
1 0 1 CLKio/1024
|
||||
1 1 0 Falling Edge of T0 (external)
|
||||
1 1 1 Rising Edge of T0 (external)
|
||||
*/
|
||||
0 0 0 No Clock Source
|
||||
0 0 1 No prescaling
|
||||
0 1 0 CLKio/8
|
||||
0 1 1 CLKio/64
|
||||
1 0 0 CLKio/256
|
||||
1 0 1 CLKio/1024
|
||||
1 1 0 Falling Edge of T0 (external)
|
||||
1 1 1 Rising Edge of T0 (external)
|
||||
*/
|
||||
TCCR0B = _BV(CS01) | _BV(CS00);
|
||||
/* Clear any TOV1 Flag set when the timer overflowed */
|
||||
BIT_CLEAR(TIFR0,TOV0);
|
||||
BIT_CLEAR(TIFR0, TOV0);
|
||||
/* Initial value */
|
||||
TCNT0 = TIMER_COUNT;
|
||||
/* Enable the overflow interrupt */
|
||||
BIT_SET(TIMSK0,TOIE0);
|
||||
BIT_SET(TIMSK0, TOIE0);
|
||||
/* Clear the Power Reduction Timer/Counter0 */
|
||||
BIT_CLEAR(PRR,PRTIM0);
|
||||
BIT_CLEAR(PRR, PRTIM0);
|
||||
}
|
||||
|
||||
/* Timer interupt */
|
||||
@@ -77,13 +78,14 @@ ISR(TIMER0_OVF_vect)
|
||||
/* Overflow Flag is automatically cleared */
|
||||
/* Update the global timer */
|
||||
if (Timer_Milliseconds < 0xFF)
|
||||
Timer_Milliseconds++;
|
||||
Timer_Milliseconds++;
|
||||
if (SilenceTime < 0xFFFF)
|
||||
SilenceTime++;
|
||||
}
|
||||
|
||||
/* Public access to the Silence Timer */
|
||||
uint16_t Timer_Silence(void)
|
||||
uint16_t Timer_Silence(
|
||||
void)
|
||||
{
|
||||
uint16_t timer;
|
||||
uint8_t sreg;
|
||||
@@ -97,7 +99,8 @@ uint16_t Timer_Silence(void)
|
||||
}
|
||||
|
||||
/* Public reset of the Silence Timer */
|
||||
void Timer_Silence_Reset(void)
|
||||
void Timer_Silence_Reset(
|
||||
void)
|
||||
{
|
||||
uint8_t sreg;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user