From f79b926a15f4920e7287c5dddf895f334d822e73 Mon Sep 17 00:00:00 2001 From: asterix Date: Tue, 6 Oct 2009 09:37:00 +0000 Subject: [PATCH] Typo. Check i2c dependence. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3035 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/lm75.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bertos/drv/lm75.c b/bertos/drv/lm75.c index 845fa3a4..2828f3e1 100644 --- a/bertos/drv/lm75.c +++ b/bertos/drv/lm75.c @@ -63,10 +63,10 @@ deci_celsius_t lm75_read(addr_t sens_addr) i2c_start_w(SELECT_ADDRESS(sens_addr)); i2c_put(LM75_PAD_BYTE); i2c_start_r(SELECT_ADDRESS(sens_addr)); - i2c_recv(&data, sizeof(data)); + i2c_recv(data, sizeof(data)); - degree = (uint16_t)data[0]; - deci_degree = (uint16_t)(((data[1] >> 7) & 1 ) * 5); + degree = (int16_t)data[0]; + deci_degree = (int16_t)(((data[1] >> 7) & 1 ) * 5); LOG_INFO("[%d.%d C]\n", degree, deci_degree); @@ -75,9 +75,8 @@ deci_celsius_t lm75_read(addr_t sens_addr) void lm75_init(void) { - i2c_init(); - LOG_INFO("Init I2C module.\n"); - + // Check dependence + MOD_CHECK(i2c); LM75_HW_INIT(); } -- 2.25.1