]> git.tnoah.ca Git - lora-radio.git/commitdiff
Fix issue with SX1280 TX power not being set properly
authorjacob.eva <x00010@disroot.org>
Wed, 24 Jul 2024 14:52:08 +0000 (15:52 +0100)
committerjacob.eva <x00010@disroot.org>
Wed, 24 Jul 2024 14:52:08 +0000 (15:52 +0100)
Radio.cpp

index 57ae164d9578f8a31d51f1d0aaec9d57e723865d..585cceb38ea1d688b8e5ac2597047b926bbbf3df 100644 (file)
--- a/Radio.cpp
+++ b/Radio.cpp
@@ -2295,7 +2295,7 @@ void sx128x::setTxPower(int level, int outputPin) {
             break;
     }
 
-    tx_buf[0] = reg_value;
+    tx_buf[0] = reg_value + 18;
     tx_buf[1] = 0xE0; // ramping time - 20 microseconds
 
     executeOpcode(OP_TX_PARAMS_8X, tx_buf, 2);
@@ -2381,7 +2381,7 @@ void sx128x::setTxPower(int level, int outputPin) {
                 break;
         }
 
-        tx_buf[0] = level;
+        tx_buf[0] = reg_value + 18;
         tx_buf[1] = 0xE0; // ramping time - 20 microseconds
     #else
     // For SX1280 boards with no specific PA requirements
@@ -2393,7 +2393,7 @@ void sx128x::setTxPower(int level, int outputPin) {
 
         _txp = level;
 
-        tx_buf[0] = level;
+        tx_buf[0] = level + 18;
         tx_buf[1] = 0xE0; // ramping time - 20 microseconds
     #endif
     executeOpcode(OP_TX_PARAMS_8X, tx_buf, 2);