diff --git a/micropython/lora/lora-sx126x/lora/sx126x.py b/micropython/lora/lora-sx126x/lora/sx126x.py index ff0263d9d..eeb3bffb7 100644 --- a/micropython/lora/lora-sx126x/lora/sx126x.py +++ b/micropython/lora/lora-sx126x/lora/sx126x.py @@ -469,7 +469,7 @@ def calibrate(self): # See DS 13.1.12 Calibrate Function # calibParam 0xFE means to calibrate all blocks. - self._cmd("BBH", _CMD_SET_RX, timeout >> 16, timeout) + self._cmd(">BBH", _CMD_SET_RX, timeout >> 16, timeout) # 24 bits return self._dio1 @@ -729,10 +729,10 @@ def _cmd(self, fmt, *write_args, n_read=0, write_buf=None, read_buf=None): return res def _reg_read(self, addr): - return self._cmd("BBBB", _CMD_READ_REGISTER, addr >> 8, addr & 0xFF, n_read=1)[0] + return self._cmd(">BHB", _CMD_READ_REGISTER, addr, 0, n_read=1)[0] def _reg_write(self, addr, val): - return self._cmd("BBBB", _CMD_WRITE_REGISTER, addr >> 8, addr & 0xFF, val & 0xFF) + return self._cmd(">BHB", _CMD_WRITE_REGISTER, addr, val & 0xFF) class _SX1262(_SX126x):