mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-23 00:39:51 +00:00
util: add read big endian 24
This commit is contained in:
parent
e93ab60652
commit
e57a25456e
@ -95,6 +95,10 @@ uint32_t big_endian_read_16( const uint8_t * buffer, int pos) {
|
||||
return ((uint16_t) buffer[(pos)+1]) | (((uint16_t)buffer[ pos ]) << 8);
|
||||
}
|
||||
|
||||
uint32_t big_endian_read_24( const uint8_t * buffer, int pos) {
|
||||
return ( ((uint32_t)buffer[(pos)+2]) | (((uint32_t)buffer[(pos)+1]) << 8) | (((uint32_t) buffer[pos]) << 16));
|
||||
}
|
||||
|
||||
uint32_t big_endian_read_32( const uint8_t * buffer, int pos) {
|
||||
return ((uint32_t) buffer[(pos)+3]) | (((uint32_t)buffer[(pos)+2]) << 8) | (((uint32_t)buffer[(pos)+1]) << 16) | (((uint32_t) buffer[pos]) << 24);
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ void little_endian_store_32(uint8_t *buffer, uint16_t position, uint32_t value);
|
||||
* @return value
|
||||
*/
|
||||
uint32_t big_endian_read_16( const uint8_t * buffer, int pos);
|
||||
uint32_t big_endian_read_24( const uint8_t * buffer, int pos);
|
||||
uint32_t big_endian_read_32( const uint8_t * buffer, int pos);
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user