Skip to content

Commit

Permalink
lora-sx127x: Fix configuring the implicit header option in the _SX127x.
Browse files Browse the repository at this point in the history
The `_reg_update` method must be called after updating the implicit header
option's bit.

Signed-off-by: Jatty Andriean <[email protected]>
  • Loading branch information
jandriea authored and dpgeorge committed Oct 18, 2024
1 parent 394cbfc commit 7f5ac83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions micropython/lora/lora-sx127x/lora/sx127x.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,13 +416,13 @@ def configure(self, lora_cfg):
modem_config1 |= (self._coding_rate - 4) << _MODEM_CONFIG1_CODING_RATE_SHIFT
update_mask |= _MODEM_CONFIG1_CODING_RATE_MASK << _MODEM_CONFIG1_CODING_RATE_SHIFT

self._reg_update(_REG_MODEM_CONFIG1, update_mask, modem_config1)

if "implicit_header" in lora_cfg:
self._implicit_header = lora_cfg["implicit_header"]
modem_config1 |= _flag(_MODEM_CONFIG1_IMPLICIT_HEADER_MODE_ON, self._implicit_header)
update_mask |= _MODEM_CONFIG1_IMPLICIT_HEADER_MODE_ON

self._reg_update(_REG_MODEM_CONFIG1, update_mask, modem_config1)

# Update MODEM_CONFIG2, for any fields that changed
modem_config2 = 0
update_mask = 0
Expand Down
2 changes: 1 addition & 1 deletion micropython/lora/lora-sx127x/manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
metadata(version="0.1.1")
metadata(version="0.1.2")
require("lora")
package("lora")

0 comments on commit 7f5ac83

Please sign in to comment.