1 #include <stm32f10x_map.h>
8 static volatile clock_time_t current_clock = 0;
9 static volatile unsigned long current_seconds = 0;
19 SCB->ICSR = SCB_ICSR_PENDSTCLR;
26 if (--second_countdown == 0) {
36 NVIC_SET_SYSTICK_PRI(8);
38 SysTick->CTRL = SysTick_CTRL_ENABLE | SysTick_CTRL_TICKINT;
51 #define SPIN_COUNT (((MCK*SPIN_TIME/1000000)-5)/4)
53 #ifndef __MAKING_DEPS__
59 asm volatile(
"1: mov r1,%2\n2:\tsub r1,#1\n\tbne 2b\n\tsub %0,#1\n\tbne 1b\n":
"=l"(t):
"0"(t),
"l"(SPIN_COUNT));
61 #error Must be compiled in thumb mode
70 return current_seconds;
void __attribute__((interrupt))
This ISR handles most of the business interacting with the 1-wire bus.
Default definitions of C compiler quirk work-arounds.
void clock_init(void)
Initialize the clock library.
CCIF clock_time_t clock_time(void)
Get the current clock time.
clock_time_t etimer_next_expiration_time(void)
Get next event timer expiration 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.
void clock_delay(unsigned int delay)
Obsolete delay function but we implement it here since some code still uses it.
#define CLOCK_SECOND
A second, measured in system clock time.