From bf0e6a5eb0dd6ec9ebf1d4fb2cf2f804de946f44 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 25 Dec 2021 23:19:33 +0100 Subject: lm75: overtemperature threshold and hysteresis are _signed_ 8bit ints --- src/driver/lm75.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/driver') diff --git a/src/driver/lm75.cc b/src/driver/lm75.cc index 3fd1483..8aab05d 100644 --- a/src/driver/lm75.cc +++ b/src/driver/lm75.cc @@ -2,6 +2,8 @@ * Copyright 2020 Daniel Friesel * * SPDX-License-Identifier: BSD-2-Clause + * + * Driver for LM75B Digital Temperature Sensor and Thermal Watchdog. */ #include "driver/lm75.h" #if defined(MULTIPASS_ARCH_HAS_I2C) && !defined(CONFIG_driver_softi2c) @@ -40,7 +42,7 @@ unsigned int LM75::getHyst() return rxbuf[0]; } -void LM75::setOS(unsigned char os) +void LM75::setOS(signed char os) { txbuf[0] = 0x03; txbuf[1] = os; @@ -48,7 +50,7 @@ void LM75::setOS(unsigned char os) i2c.xmit(address, 3, txbuf, 0, rxbuf); } -void LM75::setHyst(unsigned char hyst) +void LM75::setHyst(signed char hyst) { txbuf[0] = 0x02; txbuf[1] = hyst; -- cgit v1.2.3