Cleanup SPI handles when re-starting

rfm98w_packettx
Mark Jessop 2024-10-07 09:21:46 +10:30
rodzic a626e5d260
commit 72535848b6
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -65,6 +65,10 @@ class RFM98W_Serial(object):
Configure the RFM98W into direct asynchronous FSK mode, with the appropriate power, deviation, and transmit frequency.
"""
# Cleanup any open file handlers.
if self.hw:
self.hw.teardown()
self.hw = HardwareInterface(self.spidevice)
self.lora = LoRaRFM98W(self.hw, verbose=False)