Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_tick.c
1 #include <bc_tick.h>
2 #include <bc_irq.h>
3 #include <stm32l0xx.h>
4 
5 static bc_tick_t _bc_tick_counter = 0;
6 
8 {
9  bc_tick_t tick;
10 
11  // Disable interrupts
13 
14  // Get current tick counter
15  tick = _bc_tick_counter;
16 
17  // Enable interrupts
18  bc_irq_enable();
19 
20  return tick;
21 }
22 
23 void bc_tick_inrement_irq(bc_tick_t delta)
24 {
25  _bc_tick_counter += delta;
26 }
uint64_t bc_tick_t
Timestamp data type.
Definition: bc_tick.h:16
void bc_irq_enable(void)
Enable interrupt requests globally (call can be nested)
Definition: bc_irq.c:21
bc_tick_t bc_tick_get(void)
Get absolute timestamp since start of program.
Definition: bc_tick.c:7
void bc_irq_disable(void)
Disable interrupt requests globally (call can be nested)
Definition: bc_irq.c:7