mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-12 12:40:52 +00:00
btstack_util: add btstack_time16_delta for 16-bit timers
This commit is contained in:
parent
c28332930a
commit
a9d566f789
@ -177,13 +177,20 @@ uint32_t btstack_max(uint32_t a, uint32_t b){
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Calculate delta between two points in time
|
* @brief Calculate delta between two uint32_t points in time
|
||||||
* @return time_a - time_b - result > 0 if time_a is newer than time_b
|
* @return 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){
|
int32_t btstack_time_delta(uint32_t time_a, uint32_t time_b){
|
||||||
return (int32_t)(time_a - time_b);
|
return (int32_t)(time_a - time_b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Calculate delta between two uint16_t points in time
|
||||||
|
* @return time_a - time_b - result > 0 if time_a is newer than time_b
|
||||||
|
*/
|
||||||
|
int16_t btstack_time16_delta(uint16_t time_a, uint16_t time_b){
|
||||||
|
return (int16_t)(time_a - time_b);
|
||||||
|
}
|
||||||
|
|
||||||
char char_for_nibble(int nibble){
|
char char_for_nibble(int nibble){
|
||||||
|
|
||||||
|
@ -88,11 +88,17 @@ uint32_t btstack_min(uint32_t a, uint32_t b);
|
|||||||
uint32_t btstack_max(uint32_t a, uint32_t b);
|
uint32_t btstack_max(uint32_t a, uint32_t b);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Calculate delta between two points in time
|
* @brief Calculate delta between two uint32_t points in time
|
||||||
* @return time_a - time_b - result > 0 if time_a is newer than time_b
|
* @return 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);
|
int32_t btstack_time_delta(uint32_t time_a, uint32_t time_b);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Calculate delta between two uint16_t points in time
|
||||||
|
* @return time_a - time_b - result > 0 if time_a is newer than time_b
|
||||||
|
*/
|
||||||
|
int16_t btstack_time16_delta(uint16_t time_a, uint16_t time_b);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Read 16/24/32 bit little endian value from buffer
|
* @brief Read 16/24/32 bit little endian value from buffer
|
||||||
* @param buffer
|
* @param buffer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user