last fix does not work!
git-svn-id: file:///home/jan/tmp/wetterstation/trunk@199 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
parent
89804b3c19
commit
774b960f05
|
|
@ -286,12 +286,10 @@ static pyano_data process_pyano(time_t timestamp, u_char address, u_char *buffer
|
||||||
|
|
||||||
/* einen vorzeichenbehafteten 14-Bit Binärwert in einen Int umwandeln*/
|
/* einen vorzeichenbehafteten 14-Bit Binärwert in einen Int umwandeln*/
|
||||||
static int convert_signed_int(u_char hi_byte, u_char lo_byte){
|
static int convert_signed_int(u_char hi_byte, u_char lo_byte){
|
||||||
unsigned int val = 0;
|
int val = 0;
|
||||||
unsigned int mask = 0;
|
|
||||||
val = convert_unsigned_int(hi_byte,lo_byte);
|
val = convert_unsigned_int(hi_byte,lo_byte);
|
||||||
if (get_bit(val,13)){
|
if (get_bit(val,13)){
|
||||||
mask += (0x3FFF);
|
val |= ~(0x3FFF);
|
||||||
val |= ~mask;
|
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue