mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2026-01-01 01:41:18 +01:00
drivers/sht2x: fix printf format for native
Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
This commit is contained in:
parent
7e45997001
commit
f8dc37dca0
@ -14,6 +14,8 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -37,7 +39,7 @@
|
||||
|
||||
#define DEBUG_DEV(m, d, ...) \
|
||||
DEBUG("[l3gxxxx] %s dev=%" PRIxPTR ": " m "\n", \
|
||||
__func__, (unsigned int)d, ## __VA_ARGS__)
|
||||
__func__, (uintptr_t)d, ## __VA_ARGS__)
|
||||
|
||||
#else /* ENABLE_DEBUG */
|
||||
|
||||
@ -1032,7 +1034,7 @@ static int _read(const l3gxxxx_t *dev, uint8_t reg, uint8_t *data, uint8_t len)
|
||||
|
||||
if (ENABLE_DEBUG) {
|
||||
printf("[l3gxxxx] %s dev=%" PRIxPTR ": read following bytes: ",
|
||||
__func__, (unsigned int)dev);
|
||||
__func__, (uintptr_t)dev);
|
||||
for (uint8_t i = 0; i < len; i++) {
|
||||
printf("%02x ", data[i]);
|
||||
}
|
||||
@ -1059,7 +1061,7 @@ static int _read(const l3gxxxx_t *dev, uint8_t reg, uint8_t *data, uint8_t len)
|
||||
|
||||
if (ENABLE_DEBUG) {
|
||||
printf("[l3gxxxx] %s dev=%" PRIxPTR ": read following bytes: ",
|
||||
__func__, (unsigned int)dev);
|
||||
__func__, (uintptr_t)dev);
|
||||
for (uint8_t i = 0; i < len; i++) {
|
||||
printf("%02x ", data[i]);
|
||||
}
|
||||
@ -1090,7 +1092,7 @@ static int _write(const l3gxxxx_t *dev,
|
||||
|
||||
if (ENABLE_DEBUG) {
|
||||
printf("[l3gxxxx] %s dev=%" PRIxPTR ": write following bytes: ",
|
||||
__func__, (unsigned int)dev);
|
||||
__func__, (uintptr_t)dev);
|
||||
for (uint8_t i = 0; i < len; i++) {
|
||||
printf("%02x ", data[i]);
|
||||
}
|
||||
@ -1112,7 +1114,7 @@ static int _write(const l3gxxxx_t *dev,
|
||||
|
||||
if (ENABLE_DEBUG) {
|
||||
printf("[l3gxxxx] %s dev=%" PRIxPTR ": write following bytes: ",
|
||||
__func__, (unsigned int)dev);
|
||||
__func__, (uintptr_t)dev);
|
||||
for (uint8_t i = 0; i < len; i++) {
|
||||
printf("%02x ", data[i]);
|
||||
}
|
||||
|
||||
@ -209,7 +209,7 @@ int sht2x_read_ident(const sht2x_t *dev, uint8_t * buffer, size_t buflen)
|
||||
DEBUG("[SHT2x] ident (1): %02x %02x %02x %02x\n", data1[4], data1[5], data1[6], data1[7]);
|
||||
for (size_t ix = 0; ix < sizeof(data1); ix += 2) {
|
||||
if (sht2x_checkcrc(&data1[ix], 1, data1[ix + 1]) != 0) {
|
||||
DEBUG("[SHT2x] checksum error first (ix=%d)\n", ix);
|
||||
DEBUG("[SHT2x] checksum error first (ix=%zu)\n", ix);
|
||||
return SHT2X_ERR_CRC;
|
||||
}
|
||||
}
|
||||
@ -225,7 +225,7 @@ int sht2x_read_ident(const sht2x_t *dev, uint8_t * buffer, size_t buflen)
|
||||
DEBUG("[SHT2x] ident (2): %02x %02x %02x\n", data2[3], data2[4], data2[5]);
|
||||
for (size_t ix = 0; ix < sizeof(data2); ix += 3) {
|
||||
if (sht2x_checkcrc(&data2[ix], 2, data2[ix + 2]) != 0) {
|
||||
DEBUG("[SHT2x] checksum error, second (ix=%d)\n", ix);
|
||||
DEBUG("[SHT2x] checksum error, second (ix=%zu)\n", ix);
|
||||
return SHT2X_ERR_CRC;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user