mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-26 00:40:38 +00:00
btstack_util: btstack_time_delta provides delta between two timestamps
This commit is contained in:
parent
36d972ad05
commit
68af39674d
@ -166,6 +166,14 @@ uint32_t btstack_max(uint32_t a, uint32_t b){
|
||||
return a > b ? a : b;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Calculate delta between two points in time
|
||||
* @returns time_a - time_b - result > 0 if time_a is newer than time_b
|
||||
*/
|
||||
int32_t btstack_time_delta(uint32_t time_a, uint32_t time_b){
|
||||
return (int32_t)(time_a - time_b);
|
||||
}
|
||||
|
||||
static const char * char_to_nibble = "0123456789ABCDEF";
|
||||
|
||||
char char_for_nibble(int nibble){
|
||||
|
@ -90,7 +90,12 @@ uint32_t btstack_min(uint32_t a, uint32_t b);
|
||||
*/
|
||||
uint32_t btstack_max(uint32_t a, uint32_t b);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Calculate delta between two points in time
|
||||
* @returns time_a - time_b - result > 0 if time_a is newer than time_b
|
||||
*/
|
||||
int32_t btstack_time_delta(uint32_t time_a, uint32_t time_b);
|
||||
|
||||
/**
|
||||
* @brief Read 16/24/32 bit little endian value from buffer
|
||||
* @param buffer
|
||||
|
Loading…
x
Reference in New Issue
Block a user