From 954e1ff9302890382f9aef68c3db28d950e3baf6 Mon Sep 17 00:00:00 2001 From: S5NC <145265251+S5NC@users.noreply.github.com> Date: Fri, 5 Apr 2024 11:55:52 +0100 Subject: [PATCH] Update SX1262.cpp --- src/modules/SX126x/SX1262.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/modules/SX126x/SX1262.cpp b/src/modules/SX126x/SX1262.cpp index 1bddcf89..3aa5b8f2 100644 --- a/src/modules/SX126x/SX1262.cpp +++ b/src/modules/SX126x/SX1262.cpp @@ -23,7 +23,7 @@ int16_t SX1262::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t sync state = SX126x::fixPaClamping(); RADIOLIB_ASSERT(state); - state = setOutputPower(power); + state = setOutputPower(power, rampTime); RADIOLIB_ASSERT(state); return(state); @@ -97,7 +97,7 @@ int16_t SX1262::setFrequency(float freq, bool calibrate) { return(SX126x::setFrequencyRaw(freq)); } -int16_t SX1262::setOutputPower(int8_t power) { +int16_t SX1262::setOutputPower(int8_t power, uint8_t rampTime) { RADIOLIB_CHECK_RANGE(power, -9, 22, RADIOLIB_ERR_INVALID_OUTPUT_POWER); // get current OCP configuration @@ -109,9 +109,8 @@ int16_t SX1262::setOutputPower(int8_t power) { state = SX126x::setPaConfig(0x04, RADIOLIB_SX126X_PA_CONFIG_SX1262); RADIOLIB_ASSERT(state); - // set output power - /// \todo power ramp time configuration - state = SX126x::setTxParams(power); + // set output power and PA ramp time + state = SX126x::setTxParams(power, rampTime); RADIOLIB_ASSERT(state); // restore OCP configuration