X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Ftmp123.c;h=cce2696a2daf8e4c0943f8336e24922590db6e26;hb=d76509a30e7b0ff2440538e2a06210dc64da9214;hp=9fcc9165c16efe9f924a308b5dfd53e952bed436;hpb=56d6f07e5c87bf8745bb9548ae2227b39d083883;p=bertos.git diff --git a/bertos/drv/tmp123.c b/bertos/drv/tmp123.c index 9fcc9165..cce2696a 100644 --- a/bertos/drv/tmp123.c +++ b/bertos/drv/tmp123.c @@ -46,17 +46,19 @@ #include +#include // Macro and data type to manage celsius degree + /** * Read temperature from TMP123 chip. */ -deci_celsius_t tmp123_read(KFile *fd) +deg_t tmp123_read(KFile *fd) { int16_t tmp; - CS_ENABLE(); + TMP123_HW_CS_EN(); kfile_read(fd, &tmp, sizeof(tmp)); tmp = be16_to_cpu(tmp); - CS_DISABLE(); + TMP123_HW_CS_DIS(); tmp >>= 3; return DIV_ROUND((tmp * 10), 16);