Skip to content

Commit 5795fe1

Browse files
committed
micropython/lora: Update the implicit header option in the _SX127x.
The `_reg_update` method must be called after updating the implicit header option's bit. Signed-off-by: Jatty Andriean <jandriea@outlook.com>
1 parent 0a91a37 commit 5795fe1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

micropython/lora/lora-sx127x/lora/sx127x.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,13 @@ def configure(self, lora_cfg):
416416
modem_config1 |= (self._coding_rate - 4) << _MODEM_CONFIG1_CODING_RATE_SHIFT
417417
update_mask |= _MODEM_CONFIG1_CODING_RATE_MASK << _MODEM_CONFIG1_CODING_RATE_SHIFT
418418

419-
self._reg_update(_REG_MODEM_CONFIG1, update_mask, modem_config1)
420-
421419
if "implicit_header" in lora_cfg:
422420
self._implicit_header = lora_cfg["implicit_header"]
423421
modem_config1 |= _flag(_MODEM_CONFIG1_IMPLICIT_HEADER_MODE_ON, self._implicit_header)
424422
update_mask |= _MODEM_CONFIG1_IMPLICIT_HEADER_MODE_ON
425423

424+
self._reg_update(_REG_MODEM_CONFIG1, update_mask, modem_config1)
425+
426426
# Update MODEM_CONFIG2, for any fields that changed
427427
modem_config2 = 0
428428
update_mask = 0

0 commit comments

Comments
 (0)