From 89804b3c19204b2b50bb7c2a05ebfa8f3dc47c96 Mon Sep 17 00:00:00 2001 From: losinshi Date: Mon, 11 Dec 2006 08:42:13 +0000 Subject: [PATCH] second try to fix negative tempatatures git-svn-id: file:///home/jan/tmp/wetterstation/trunk@198 dd492736-c11a-0410-ad51-8c26713eaf7f --- deamon/seriell/process.c | 6 ++++-- debian/changelog | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/deamon/seriell/process.c b/deamon/seriell/process.c index 5b5c93d..9211b2b 100644 --- a/deamon/seriell/process.c +++ b/deamon/seriell/process.c @@ -286,10 +286,12 @@ static pyano_data process_pyano(time_t timestamp, u_char address, u_char *buffer /* einen vorzeichenbehafteten 14-Bit Binärwert in einen Int umwandeln*/ static int convert_signed_int(u_char hi_byte, u_char lo_byte){ - int val; + unsigned int val = 0; + unsigned int mask = 0; val = convert_unsigned_int(hi_byte,lo_byte); if (get_bit(val,13)){ - val |= ~(0x3FFF); + mask += (0x3FFF); + val |= ~mask; } return val; } diff --git a/debian/changelog b/debian/changelog index 7033d57..056501b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +weatherstation (1.0.4-1) stable; urgency=low + + * second try to fix negative tempatatures + + -- Jan Losinski Thu, 2 Nov 2006 09:38:14 +0100 + weatherstation (1.0.3-1) stable; urgency=low * Some license-changes in the frontend