Time tick for SAM.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | TICK_US 1000 |
Functions | |
void | SysTick_Handler (void) |
Handler for Sytem Tick interrupt. More... | |
uint32_t | time_tick_calc_delay (uint32_t tick_start, uint32_t tick_end) |
Calculate the delay (ms) between two ticks. More... | |
uint32_t | time_tick_get (void) |
Get current time tick. More... | |
void | time_tick_init (void) |
Initialize for 1ms time tick. More... | |
Variables | |
volatile uint32_t | g_ms_ticks = 0 |
Counts for 1ms time ticks. More... | |
#define TICK_US 1000 |
Referenced by time_tick_calc_delay(), and time_tick_init().
void SysTick_Handler | ( | void | ) |
Handler for Sytem Tick interrupt.
Process System Tick Event Increments the g_ms_ticks counter.
References g_ms_ticks.
uint32_t time_tick_calc_delay | ( | uint32_t | tick_start, |
uint32_t | tick_end | ||
) |
Calculate the delay (ms) between two ticks.
tick_start | Start tick number. |
tick_end | End tick number. |
References TICK_US.
Referenced by main_test_memory().
uint32_t time_tick_get | ( | void | ) |
void time_tick_init | ( | void | ) |
Initialize for 1ms time tick.
true
if initialization is OK, else false
. References Assert, g_ms_ticks, sysclk_get_cpu_hz(), and TICK_US.
Referenced by main().
volatile uint32_t g_ms_ticks = 0 |
Counts for 1ms time ticks.
Referenced by SysTick_Handler(), time_tick_get(), and time_tick_init().