34 #include "sys/clock.h"
38 #include <avr/interrupt.h>
40 static volatile clock_time_t
count, scount;
41 static volatile unsigned long seconds;
64 TIMSK &= ~( _BV(TOIE0) | _BV(OCIE0) );
78 TCCR0 = _BV(CS00) | _BV(CS01) | _BV(WGM01);
114 }
while(tmp !=
count);
126 for (j = 50; j > 0; j--)
157 }
while(tmp != seconds);
static void start(void)
Start measurement.
void etimer_request_poll(void)
Make the event timer aware that the clock has changed.
int etimer_pending(void)
Check if there are any non-expired event timers.
clock_time_t clock_time(void)
Get the current clock time.
void clock_init()
Initialize the clock library.
#define CLOCK_SECOND
A second, measured in system clock time.
static volatile clock_time_t count
These routines define the AVR-specific calls declared in /core/sys/clock.h CLOCK_SECOND is the number...
void clock_delay(unsigned int i)
Obsolete delay function but we implement it here since some code still uses it.
void clock_wait(clock_time_t i)
Wait for a given number of ticks.
unsigned long clock_seconds(void)
Get the current value of the platform seconds.
void clock_set_seconds(unsigned long sec)
Set the value of the platform seconds.