Skip to content

Commit ef582f2

Browse files
committed
Fix SX126x XTAL initialisation (#14)
1 parent 275ffab commit ef582f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

smtUdpPacketForwarder/Radio.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ void hexPrint(uint8_t data[], int length, FILE *dest) { // {{{
147147
} else { \
148148
SX126x* sx126x_chip = dynamic_cast<SX126x*>(origin); \
149149
if (sx126x_chip != nullptr) { \
150+
sx126x_chip->XTAL = true; \
150151
result = sx126x_chip->invertIQ(false); \
151152
if (result == RADIOLIB_ERR_NONE) { \
152153
result = sx126x_chip->setCRC((uint8_t) 1); \
@@ -184,6 +185,7 @@ void hexPrint(uint8_t data[], int length, FILE *dest) { // {{{
184185
} else { \
185186
SX126x* sx126x_chip = dynamic_cast<SX126x*>(origin); \
186187
if (sx126x_chip != nullptr) { \
188+
sx126x_chip->XTAL = true; \
187189
result = sx126x_chip->invertIQ(downlink_pkt.iq_polatization_inversion); \
188190
if (result == RADIOLIB_ERR_NONE) { \
189191
result = sx126x_chip->setCRC(downlink_pkt.disable_crc ? (uint8_t) 0 : (uint8_t) 1); \
@@ -203,6 +205,8 @@ void hexPrint(uint8_t data[], int length, FILE *dest) { // {{{
203205
downlink_pkt.preamble_length, \
204206
false /* don't use OOK */ \
205207
); \
208+
SX126x* sx126x_chip = dynamic_cast<SX126x*>(origin); \
209+
if (sx126x_chip != nullptr) sx126x_chip->XTAL = true; \
206210
if (result == RADIOLIB_ERR_NONE) result = chip->setSyncWord(gfskSyncWord, ((uint8_t) sizeof(gfskSyncWord))); \
207211
} \
208212
if (result == RADIOLIB_ERR_NONE) result = chip->setCurrentLimit(current_lim_ma); \

0 commit comments

Comments
 (0)