Added ability to specify per-board transceiver OCP limit

This commit is contained in:
Mark Qvist 2024-12-10 15:35:29 +01:00
parent d012c37146
commit d88f231332
2 changed files with 4 additions and 1 deletions

View File

@ -227,6 +227,7 @@
#define HAS_TCXO true #define HAS_TCXO true
#define HAS_BUSY true #define HAS_BUSY true
#define DIO2_AS_RF_SWITCH true #define DIO2_AS_RF_SWITCH true
#define OCP_TUNED 0x38
const int pin_busy = 32; const int pin_busy = 32;
const int pin_dio = 33; const int pin_dio = 33;
const int pin_tcxo_enable = -1; const int pin_tcxo_enable = -1;
@ -331,6 +332,7 @@
#define HAS_SLEEP true #define HAS_SLEEP true
#define PIN_WAKEUP GPIO_NUM_0 #define PIN_WAKEUP GPIO_NUM_0
#define WAKEUP_LEVEL 0 #define WAKEUP_LEVEL 0
#define OCP_TUNED 0x28
const int pin_btn_usr1 = 0; const int pin_btn_usr1 = 0;
@ -519,6 +521,7 @@
#define DIO2_AS_RF_SWITCH true #define DIO2_AS_RF_SWITCH true
#define HAS_BUSY true #define HAS_BUSY true
#define HAS_TCXO true #define HAS_TCXO true
#define OCP_TUNED 0x38
#define HAS_DISPLAY true #define HAS_DISPLAY true
#define HAS_CONSOLE true #define HAS_CONSOLE true

View File

@ -771,7 +771,7 @@ void sx126x::setTxPower(int level, int outputPin) {
if (level > 22) { level = 22; } if (level > 22) { level = 22; }
else if (level < -9) { level = -9; } else if (level < -9) { level = -9; }
writeRegister(REG_OCP_6X, 0x38); // 160mA limit, overcurrent protection writeRegister(REG_OCP_6X, OCP_TUNED); // Use board-specific tuned OCP
uint8_t tx_buf[2]; uint8_t tx_buf[2];