From d27ccfcbcdad22acd83d20660fb88c4e5c3677e5 Mon Sep 17 00:00:00 2001 From: asterix Date: Thu, 8 Oct 2009 12:31:51 +0000 Subject: [PATCH] Use types and conversion macro from ntc.h. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3045 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/lm75.c | 3 ++- bertos/drv/lm75.h | 5 +++-- bertos/drv/tmp123.c | 4 +++- bertos/drv/tmp123.h | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bertos/drv/lm75.c b/bertos/drv/lm75.c index 449a4dd2..3a30aadd 100644 --- a/bertos/drv/lm75.c +++ b/bertos/drv/lm75.c @@ -52,10 +52,11 @@ #include #include +#include // Macro and data type to manage celsius degree #define SELECT_ADDRESS(addr) LM75_ADDRESS_BYTE | (addr << 1) -deci_celsius_t lm75_read(addr_t sens_addr) +deg_t lm75_read(addr_t sens_addr) { uint8_t data[2]; int16_t degree; diff --git a/bertos/drv/lm75.h b/bertos/drv/lm75.h index 8c7ee4e3..f1d9bf7c 100644 --- a/bertos/drv/lm75.h +++ b/bertos/drv/lm75.h @@ -45,13 +45,14 @@ #include +#include // Macro and data type to manage celsius degree + #define LM75_ADDRESS_BYTE 0x91 #define LM75_PAD_BYTE 0x0 -typedef int16_t deci_celsius_t; typedef uint8_t addr_t; -deci_celsius_t lm75_read(addr_t sens_addr); +deg_t lm75_read(addr_t sens_addr); void lm75_init(void); diff --git a/bertos/drv/tmp123.c b/bertos/drv/tmp123.c index 9fcc9165..4c90a0e7 100644 --- a/bertos/drv/tmp123.c +++ b/bertos/drv/tmp123.c @@ -46,10 +46,12 @@ #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; diff --git a/bertos/drv/tmp123.h b/bertos/drv/tmp123.h index cb7b377c..85859b25 100644 --- a/bertos/drv/tmp123.h +++ b/bertos/drv/tmp123.h @@ -47,9 +47,9 @@ #include -typedef int16_t deci_celsius_t; +#include // Macro and data type to manage celsius degree -deci_celsius_t tmp123_read(KFile *fd); +deg_t tmp123_read(KFile *fd); void tmp123_init(void); -- 2.25.1