mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-07 09:55:45 +00:00
use casts also for 16-bit values
This commit is contained in:
parent
b7d49065bd
commit
b9fa6cb54b
@ -15,7 +15,7 @@
|
||||
#include "bt_control.h"
|
||||
|
||||
// helper for BT little endian format
|
||||
#define READ_BT_16( buffer, pos) (buffer[pos] | (buffer[pos+1] << 8))
|
||||
#define READ_BT_16( buffer, pos) ( ((uint16_t) buffer[pos]) | (((uint16_t)buffer[pos+1]) << 8))
|
||||
#define READ_BT_24( buffer, pos) ( ((uint32_t) buffer[pos]) | (((uint32_t)buffer[pos+1]) << 8) | (((uint32_t)buffer[pos+2]) << 16))
|
||||
#define READ_BT_32( buffer, pos) ( ((uint32_t) buffer[pos]) | (((uint32_t)buffer[pos+1]) << 8) | (((uint32_t)buffer[pos+2]) << 16) | (((uint32_t) buffer[pos+3])) << 24)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user