From 03d0f138b4d03f2d1db16b0f086d30ae0a58c749 Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Fri, 13 Jan 2017 20:28:58 +0100 Subject: [PATCH] drivers/jc42 fix temperature parameter signedness --- drivers/include/jc42.h | 2 +- drivers/jc42/jc42.c | 2 +- drivers/jc42/jc42_saul.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/include/jc42.h b/drivers/include/jc42.h index b4f6f487b5..a11384b3a9 100644 --- a/drivers/include/jc42.h +++ b/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 } diff --git a/drivers/jc42/jc42.c b/drivers/jc42/jc42.c index 67b64d326d..92b61acd5b 100644 --- a/drivers/jc42/jc42.c +++ b/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; diff --git a/drivers/jc42/jc42_saul.c b/drivers/jc42/jc42_saul.c index a66bb19f2c..a0cebdb7e9 100644 --- a/drivers/jc42/jc42_saul.c +++ b/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);