X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Ftmp123.c;h=7f8b4f09cd802c1af7d25b29e754772207bd51cb;hb=911d2706a86d326786bfe721dcc3d63aeade7f28;hp=9fcc9165c16efe9f924a308b5dfd53e952bed436;hpb=56d6f07e5c87bf8745bb9548ae2227b39d083883;p=bertos.git diff --git a/bertos/drv/tmp123.c b/bertos/drv/tmp123.c index 9fcc9165..7f8b4f09 100644 --- a/bertos/drv/tmp123.c +++ b/bertos/drv/tmp123.c @@ -44,19 +44,21 @@ #include -#include +#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);