36 #include <sys/clock.h>
41 #include "contiki-conf.h"
44 #include "contiki-conf.h"
46 #define MAX_TICKS (~((clock_time_t)0) / 2)
48 static volatile clock_time_t current_clock = 0;
50 volatile unsigned long seconds = 0;
77 *TMR0_CTRL = (COUNT_MODE<<13) | (PRIME_SRC<<9) | (SEC_SRC<<7) | (ONCE<<6) | (LEN<<5) | (DIR<<4) | (CO_INIT<<3) | (OUT_MODE);
85 if(bit_is_set(*TMR(0,CSCTRL),TCF1)) {
87 if((current_clock % CLOCK_CONF_SECOND) == 0) {
90 leds_toggle(LEDS_GREEN);
101 clear_bit(*TMR(0,SCTRL),TCF);
102 clear_bit(*TMR(0,CSCTRL),TCF1);
103 clear_bit(*TMR(0,CSCTRL),TCF2);
114 return current_clock;
129 for(i = 0; i< len; i++) {