From 9dae818033e1702d5d0a7942e487772caa289a69 Mon Sep 17 00:00:00 2001
From: jgromes <jan.gromes@gmail.com>
Date: Thu, 23 Mar 2023 19:07:04 +0100
Subject: [PATCH] [SX126x] Explicitly enabled CRC (#706)

---
 src/modules/SX126x/SX126x.cpp | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp
index 44852fac..2c6c8c15 100644
--- a/src/modules/SX126x/SX126x.cpp
+++ b/src/modules/SX126x/SX126x.cpp
@@ -73,6 +73,12 @@ int16_t SX126x::begin(uint8_t cr, uint8_t syncWord, uint16_t preambleLength, flo
   state = setPreambleLength(preambleLength);
   RADIOLIB_ASSERT(state);
 
+  if (useRegulatorLDO) {
+      state = setRegulatorLDO();
+  } else {
+      state = setRegulatorDCDC();
+  }
+
   // set publicly accessible settings that are not a part of begin method
   state = setCurrentLimit(60.0);
   RADIOLIB_ASSERT(state);
@@ -80,11 +86,8 @@ int16_t SX126x::begin(uint8_t cr, uint8_t syncWord, uint16_t preambleLength, flo
   state = setDio2AsRfSwitch(true);
   RADIOLIB_ASSERT(state);
 
-  if (useRegulatorLDO) {
-      state = setRegulatorLDO();
-  } else {
-      state = setRegulatorDCDC();
-  }
+  state = setCRC(2);
+  RADIOLIB_ASSERT(state);
 
   return(state);
 }