diff --git a/adafruit_rfm69.py b/adafruit_rfm69.py index 084afd4..da73423 100644 --- a/adafruit_rfm69.py +++ b/adafruit_rfm69.py @@ -779,11 +779,11 @@ def receive(self, timeout=0.5, keep_listening=True, with_header=False, else: packet = bytearray(fifo_length) device.readinto(packet) - if (rx_filter != _RH_BROADCAST_ADDRESS and packet[0] != _RH_BROADCAST_ADDRESS - and packet[0] != rx_filter): - packet = None - if not with_header: # skip the header if not wanted - packet = packet[4:] + if (rx_filter != _RH_BROADCAST_ADDRESS and packet[0] != _RH_BROADCAST_ADDRESS + and packet[0] != rx_filter): + packet = None + elif not with_header: # skip the header if not wanted + packet = packet[4:] # Listen again if necessary and return the result packet. if keep_listening: