libsigrok-internal.h: add helper macro to read 8 bits integer
matching the 16 and 32 bits one
This commit is contained in:
parent
6e94eb4142
commit
a4f9c35b23
|
@ -50,6 +50,13 @@
|
|||
#define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Read a 8 bits integer out of memory.
|
||||
* @param x a pointer to the input memory
|
||||
* @return the corresponding integer
|
||||
*/
|
||||
#define R8(x) ((unsigned)((const uint8_t*)(x))[0])
|
||||
|
||||
/**
|
||||
* Read a 16 bits big endian integer out of memory.
|
||||
* @param x a pointer to the input memory
|
||||
|
|
Loading…
Reference in New Issue