diff --git a/rfm69.py b/rfm69.py index 353bc29..9b74880 100644 --- a/rfm69.py +++ b/rfm69.py @@ -251,11 +251,10 @@ class Rfm69(threading.Thread): config[RegTemp1] = 0x01 config[RegTemp2] = 0x00 config[RegTestLna] = 0x1B - config[RegTestDagc] = 0x30 + config[RegTestDagc] = 0x30 #low beta 0 config[RegTestAfc] = 0x00 config[RegPacketConfig1] = 0x00 #Fixed length, CRC off, no adr - config[RegPacketConfig2] = 0 #1<>" + key + "<<") @@ -526,7 +524,7 @@ class Rfm69(threading.Thread): self.__SetDioMapping(2, 1) #DIO2 -> DATA self.__mutex.acquire() while True: - self.__WriteReg(RegPayloadLength, 0) #unlimited lendth + self.__WriteReg(RegPayloadLength, 0) #unlimited length self.__WriteReg(RegFifoThresh, self.__fifothresh) if self.__syncsize > 0: self.__SetDioMapping(0, DIO0_PM_SYNC) #DIO0 -> SyncAddress @@ -547,12 +545,12 @@ class Rfm69(threading.Thread): def ReceivePacket(self, length): self.__StartRx() - afc = self.ReadReg(RegAfcMsb) << 8 - afc = afc | self.ReadReg(RegAfcLsb) - result = self.ReadFifoWait(length) rssi = -self.ReadReg(RegRssiValue) / 2 + afc = self.ReadReg(RegAfcMsb) << 8 + afc = afc | self.ReadReg(RegAfcLsb) + if afc >= 0x8000: afc = afc - 0x10000