Skip to content

Commit

Permalink
Fix SX126x XTAL initialisation (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhgzhg committed Jan 4, 2024
1 parent 275ffab commit ef582f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions smtUdpPacketForwarder/Radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ void hexPrint(uint8_t data[], int length, FILE *dest) { // {{{
} else { \
SX126x* sx126x_chip = dynamic_cast<SX126x*>(origin); \
if (sx126x_chip != nullptr) { \
sx126x_chip->XTAL = true; \
result = sx126x_chip->invertIQ(false); \
if (result == RADIOLIB_ERR_NONE) { \
result = sx126x_chip->setCRC((uint8_t) 1); \
Expand Down Expand Up @@ -184,6 +185,7 @@ void hexPrint(uint8_t data[], int length, FILE *dest) { // {{{
} else { \
SX126x* sx126x_chip = dynamic_cast<SX126x*>(origin); \
if (sx126x_chip != nullptr) { \
sx126x_chip->XTAL = true; \
result = sx126x_chip->invertIQ(downlink_pkt.iq_polatization_inversion); \
if (result == RADIOLIB_ERR_NONE) { \
result = sx126x_chip->setCRC(downlink_pkt.disable_crc ? (uint8_t) 0 : (uint8_t) 1); \
Expand All @@ -203,6 +205,8 @@ void hexPrint(uint8_t data[], int length, FILE *dest) { // {{{
downlink_pkt.preamble_length, \
false /* don't use OOK */ \
); \
SX126x* sx126x_chip = dynamic_cast<SX126x*>(origin); \
if (sx126x_chip != nullptr) sx126x_chip->XTAL = true; \
if (result == RADIOLIB_ERR_NONE) result = chip->setSyncWord(gfskSyncWord, ((uint8_t) sizeof(gfskSyncWord))); \
} \
if (result == RADIOLIB_ERR_NONE) result = chip->setCurrentLimit(current_lim_ma); \
Expand Down

0 comments on commit ef582f2

Please sign in to comment.