Browse Source

drivers/jc42 fix temperature parameter signedness

pr/spi.typo
Koen Zandberg 6 years ago
parent
commit
03d0f138b4
  1. 2
      drivers/include/jc42.h
  2. 2
      drivers/jc42/jc42.c
  3. 2
      drivers/jc42/jc42_saul.c

2
drivers/include/jc42.h

@ -115,7 +115,7 @@ int jc42_set_config(jc42_t* dev, uint16_t data);
* @return 0 on success
* @return -1 on error
*/
int jc42_get_temperature(jc42_t* dev, uint16_t* temperature);
int jc42_get_temperature(jc42_t* dev, int16_t* temperature);
#ifdef __cplusplus
}

2
drivers/jc42/jc42.c

@ -63,7 +63,7 @@ int jc42_set_config(jc42_t* dev, uint16_t data)
return jc42_set_register(dev, JC42_REG_CONFIG, &data);
}
int jc42_get_temperature(jc42_t* dev, uint16_t* temperature)
int jc42_get_temperature(jc42_t* dev, int16_t* temperature)
{
struct { signed int x:12;} s;
uint16_t tmp;

2
drivers/jc42/jc42_saul.c

@ -27,7 +27,7 @@
static int read_temperature(void *dev, phydat_t *res)
{
uint16_t temperature;
int16_t temperature;
jc42_t *d = (jc42_t *)dev;
jc42_get_temperature(d, &temperature);

Loading…
Cancel
Save