From 35d303b81fd2d5aeee83c32268d8f9c9e76e0b30 Mon Sep 17 00:00:00 2001
From: Leonard Techel <git@barnslig.eu>
Date: Wed, 29 Jan 2025 10:22:17 +0100
Subject: [PATCH] lora-sx126x: Fix invert_iq_rx / invert_iq_tx

This commit fixes a typo and changes a tuple that needs to be mutable
to a list.
---
 micropython/lora/lora-sx126x/lora/sx126x.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/micropython/lora/lora-sx126x/lora/sx126x.py b/micropython/lora/lora-sx126x/lora/sx126x.py
index 77052c97c..641367a9f 100644
--- a/micropython/lora/lora-sx126x/lora/sx126x.py
+++ b/micropython/lora/lora-sx126x/lora/sx126x.py
@@ -363,11 +363,11 @@ def configure(self, lora_cfg):
         if "preamble_len" in lora_cfg:
             self._preamble_len = lora_cfg["preamble_len"]
 
-        self._invert_iq = (
+        self._invert_iq = [
             lora_cfg.get("invert_iq_rx", self._invert_iq[0]),
             lora_cfg.get("invert_iq_tx", self._invert_iq[1]),
             self._invert_iq[2],
-        )
+        ]
 
         if "freq_khz" in lora_cfg:
             self._rf_freq_hz = int(lora_cfg["freq_khz"] * 1000)
@@ -449,7 +449,7 @@ def configure(self, lora_cfg):
     def _invert_workaround(self, enable):
         # Apply workaround for DS 15.4 Optimizing the Inverted IQ Operation
         if self._invert_iq[2] != enable:
-            val = self._read_read(_REG_IQ_POLARITY_SETUP)
+            val = self._reg_read(_REG_IQ_POLARITY_SETUP)
             val = (val & ~4) | _flag(4, enable)
             self._reg_write(_REG_IQ_POLARITY_SETUP, val)
             self._invert_iq[2] = enable