Skip to content

Commit

Permalink
drivers/ccs811: fix build issues on ARM (#1)
Browse files Browse the repository at this point in the history
* drivers/ccs811: fix types in debug messages

* drivers/driver_ccs811_full: fix unused variable build error
  • Loading branch information
aabadie committed Dec 20, 2018
1 parent 4323d9c commit 8a7edeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/ccs811/ccs811.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ int ccs811_set_baseline(const ccs811_t *dev, uint16_t baseline)

static int _reg_read(const ccs811_t *dev, uint8_t reg, uint8_t *data, uint32_t len)
{
DEBUG_DEV("read %d bytes from sensor registers starting at addr %02x",
DEBUG_DEV("read %"PRIu32" bytes from sensor registers starting at addr %02x",
dev, len, reg);

int res = CCS811_OK;
Expand Down Expand Up @@ -529,7 +529,7 @@ static int _reg_read(const ccs811_t *dev, uint8_t reg, uint8_t *data, uint32_t l
}
}
else {
DEBUG_DEV("could not read %d bytes from sensor registers "
DEBUG_DEV("could not read %"PRIu32" bytes from sensor registers "
"starting at addr %02x, reason %d (%s)",
dev, len, reg, res, strerror(res * -1));
return -CCS811_ERROR_I2C;
Expand All @@ -540,7 +540,7 @@ static int _reg_read(const ccs811_t *dev, uint8_t reg, uint8_t *data, uint32_t l

static int _reg_write(const ccs811_t *dev, uint8_t reg, uint8_t *data, uint32_t len)
{
DEBUG_DEV("write %d bytes to sensor registers starting at addr %02x",
DEBUG_DEV("write %"PRIu32" bytes to sensor registers starting at addr %02x",
dev, len, reg);

int res = CCS811_OK;
Expand Down Expand Up @@ -586,8 +586,8 @@ static int _reg_write(const ccs811_t *dev, uint8_t reg, uint8_t *data, uint32_t
#endif

if (res != CCS811_OK) {
DEBUG_DEV("could not write %d bytes to sensor registers "
"starting at addr %02x, reason %d (%s)",
DEBUG_DEV("could not write %"PRIu32" bytes to sensor registers "
"starting at addr %02x, reason %i (%s)",
dev, len, reg, res, strerror(res * -1));
return -CCS811_ERROR_I2C;
}
Expand Down
1 change: 1 addition & 0 deletions tests/driver_ccs811_full/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ kernel_pid_t p_main;

static void ccs811_isr (void *arg)
{
(void)arg;
/* send a message to trigger main thread to handle the interrupt */
msg_t msg;
msg_send(&msg, p_main);
Expand Down

0 comments on commit 8a7edeb

Please sign in to comment.