mossmann / im-me

software for the Girl Tech IM-Me
GNU General Public License v2.0
149 stars 57 forks source link

RSSI ^ 0x80 #5

Open Ivan275g4 opened 2 years ago

Ivan275g4 commented 2 years ago

im-me/specan/src/specan.c Line:542 chan_table[ch].ss[sweep] = (RSSI ^ 0x80);

Where does the 0x80 come from? What does it do? Is it a short cut to skip the harder math?

The PDF for the 1110 states: The RSSI value read from the RSSI status register is a 2’s complement number. The following procedure can be used to convert the RSSI reading to an absolute power level (RSSI_dBm).

1) Read the RSSI status register 2) Convert the reading from a hexadecimal number to a decimal number (RSSI_dec) 3) If RSSI_dec ≥ 128 then RSSI_dBm = (RSSI_dec – 256)/2 – RSSI_offset 4) Else if RSSI_dec < 128 then RSSI_dBm = (RSSI_dec)/2 – RSSI_offset