mirror of
https://github.com/sandeepmistry/arduino-LoRa.git
synced 2025-04-19 13:02:14 +03:00
Backup and restore opcode while setting sync word
This commit is contained in:
parent
c0a438908b
commit
89d292be4d
@ -404,7 +404,15 @@ void LoRaClass::setPreambleLength(long length)
|
||||
|
||||
void LoRaClass::setSyncWord(int sw)
|
||||
{
|
||||
// backup current op mode
|
||||
byte oldOpMode = readRegister(REG_OP_MODE);
|
||||
|
||||
sleep();
|
||||
|
||||
writeRegister(REG_SYNC_WORD, sw);
|
||||
|
||||
// retore previous op mode
|
||||
writeRegister(REG_OP_MODE, oldOpMode);
|
||||
}
|
||||
|
||||
void LoRaClass::crc()
|
||||
|
Loading…
x
Reference in New Issue
Block a user