38 #include <aducrf101-contiki.h>
39 #include <sys/clock.h>
42 static volatile clock_time_t current_clock = 0;
43 static volatile unsigned long current_seconds = 0;
46 #define SAMPLE_STACK_POINTER
47 #ifdef SAMPLE_STACK_POINTER
48 volatile uint32_t *__min_sampled_sp = (uint32_t *)0xFFFFFFFF;
54 #ifdef SAMPLE_STACK_POINTER
60 uint32_t *sp = (uint32_t *)&sp;
61 if (sp < __min_sampled_sp)
62 __min_sampled_sp = sp;
69 if(--second_countdown == 0) {
90 return current_seconds;
97 int32_t remaining = (int32_t)usec *
F_CPU / 1000000;
99 while(remaining > 0) {
104 remaining -= (old -
new);
#define F_CPU
CPU core frequency resulting from the chosen divisors and multipliers.
void clock_delay_usec(uint16_t dt)
Delay a given number of microseconds.
__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
System Tick Configuration.
void clock_init(void)
Initialize the clock library.
CCIF clock_time_t clock_time(void)
Get the current clock time.
void etimer_request_poll(void)
Make the event timer aware that the clock has changed.
CCIF unsigned long clock_seconds(void)
Get the current value of the platform seconds.
int etimer_pending(void)
Check if there are any non-expired event timers.
#define CLOCK_SECOND
A second, measured in system clock time.