aboutsummaryrefslogtreecommitdiff
path: root/Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.c
diff options
context:
space:
mode:
Diffstat (limited to 'Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.c')
-rw-r--r--Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.c b/Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.c
index c3e281ebdd..8363d96e08 100644
--- a/Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.c
+++ b/Projects/Incomplete/Webserver/Lib/uip/conf/clock-arch.c
@@ -12,7 +12,7 @@
volatile clock_time_t clock_datetime = 0;
//Overflow interrupt
-ISR(TIMER0_OVF_vect)
+ISR(TIMER1_COMPA_vect)
{
clock_datetime += 1;
}
@@ -20,14 +20,10 @@ ISR(TIMER0_OVF_vect)
//Initialise the clock
void clock_init()
{
- //Activate overflow interrupt for timer0
- TIMSK0 |= (1<<TOIE0);
-
- //Use prescaler 1024
- TCCR0B |= ((1<<CS12)|(1<<CS10));
-
- //Activate interrupts
- sei();
+ OCR1A = ((F_CPU / 1024) / 100);
+ TCCR1A = (1 << WGM12);
+ TCCR1B = ((1 << CS12) | (1 << CS10));
+ TIMSK1 = (1 << OCIE1A);
}
//Return time