1
0
mirror of https://github.com/agdsn/ancient-weatherstation.git synced 2026-06-19 14:58:00 +00:00

second try to fix negative tempatatures

git-svn-id: file:///home/jan/tmp/wetterstation/trunk@198 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
losinshi
2006-12-11 08:42:13 +00:00
parent 96ce58a7b8
commit 89804b3c19
2 changed files with 10 additions and 2 deletions
+4 -2
View File
@@ -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;
}