[SX126x] Allow subclasses to change the TX mode used
This prepares for adding a STM32WLx subclass later.
This commit is contained in:
parent
52ec165643
commit
da6c3f6a6b
2 changed files with 5 additions and 2 deletions
|
@ -299,7 +299,7 @@ int16_t SX126x::receive(uint8_t* data, size_t len) {
|
|||
|
||||
int16_t SX126x::transmitDirect(uint32_t frf) {
|
||||
// set RF switch (if present)
|
||||
_mod->setRfSwitchState(Module::MODE_TX);
|
||||
_mod->setRfSwitchState(_tx_mode);
|
||||
|
||||
// user requested to start transmitting immediately (required for RTTY)
|
||||
int16_t state = RADIOLIB_ERR_NONE;
|
||||
|
@ -418,7 +418,7 @@ int16_t SX126x::startTransmit(uint8_t* data, size_t len, uint8_t addr) {
|
|||
RADIOLIB_ASSERT(state);
|
||||
|
||||
// set RF switch (if present)
|
||||
_mod->setRfSwitchState(Module::MODE_TX);
|
||||
_mod->setRfSwitchState(_tx_mode);
|
||||
|
||||
// start transmission
|
||||
state = setTx(RADIOLIB_SX126X_TX_TIMEOUT_NONE);
|
||||
|
|
|
@ -1043,6 +1043,9 @@ class SX126x: public PhysicalLayer {
|
|||
|
||||
int16_t _lastError = RADIOLIB_ERR_NONE;
|
||||
|
||||
// Allow subclasses to define different TX modes
|
||||
uint8_t _tx_mode = Module::MODE_TX;
|
||||
|
||||
int16_t config(uint8_t modem);
|
||||
int16_t checkCommandResult();
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue