[SX128x] fix for improper GFSK syncword setting with length other than 5 bytes (#1446)

* [SX128x] fix for improper GFSK syncword setting with length other than 5 bytes

* [SX128x] misc. rework
pull/1450/head
Linar Yusupov 2025-03-06 19:47:59 +03:00 zatwierdzone przez GitHub
rodzic 6bf0c3f735
commit c88cf551cc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -997,7 +997,7 @@ int16_t SX128x::setSyncWord(const uint8_t* syncWord, uint8_t len) {
}
// update sync word
int16_t state = SX128x::writeRegister(RADIOLIB_SX128X_REG_SYNC_WORD_1_BYTE_4, const_cast<uint8_t*>(syncWord), len);
int16_t state = SX128x::writeRegister(RADIOLIB_SX128X_REG_SYNC_WORD_1_BYTE_4 + (5 - len), const_cast<uint8_t*>(syncWord), len);
RADIOLIB_ASSERT(state);
// update packet parameters