34 #include "platform-conf.h"
35 #include "contiki-conf.h"
37 #include "stm32l1xx.h"
38 #include "stm32l1xx_hal_rcc.h"
39 #include "stm32l1xx_hal_cortex.h"
40 #include "stm32l1xx_hal.h"
43 #define RELOAD_VALUE ((F_CPU / CLOCK_CONF_SECOND) - 1)
45 static volatile unsigned long seconds = 0;
46 static volatile clock_time_t ticks;
47 void st_lib_sys_tick_handler(
void);
50 st_lib_sys_tick_handler(
void)
68 st_lib_hal_systick_clk_source_config(SYSTICK_CLKSOURCE_HCLK);
69 st_lib_hal_systick_config(RELOAD_VALUE);
95 for(j = 50; j > 0; j--) {
107 while(
clock_time() - start < (clock_time_t)t) ;
static void start(void)
Start measurement.
Header file for the STM32Cube HAL APIs.
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.
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.