Fork with intent to refactor and add support for American 902-928(915) Frequency Bands
Diff: sx1276/sx1276-mbed-hal.cpp
- Revision:
- 43:90de42f3c1fd
- Parent:
- 42:72deced1a4c4
--- a/sx1276/sx1276-mbed-hal.cpp Mon May 08 22:52:31 2017 +0200 +++ b/sx1276/sx1276-mbed-hal.cpp Tue May 09 11:19:51 2017 +0200 @@ -138,8 +138,10 @@ void SX1276Generic::IoInit( void ) { - if (_tcxo) + if (_tcxo) { *_tcxo = 1; + wait_ms(TCXO_STARTUP_MS); + } AntSwInit( ); SpiInit( ); } @@ -306,6 +308,15 @@ void SX1276Generic::SetAntSw( uint8_t opMode ) { + /* + * Note that the Mode RFLR (LoRa) and Mode RF are using identical + * values. Unfortunately booth representations are being used. + */ + if (_tcxo && *_tcxo == 0 && opMode != RFLR_OPMODE_SLEEP) { + *_tcxo = 1; + wait_ms(TCXO_STARTUP_MS); + } + switch( opMode ) { case RFLR_OPMODE_TRANSMITTER: @@ -329,10 +340,12 @@ *_antSwitchTXBoost = 0; } else { if (_antSwitch) - _antSwitch = 0; + *_antSwitch = 0; } break; case RFLR_OPMODE_SLEEP: + if (_tcxo) + *_tcxo = 0; case RFLR_OPMODE_STANDBY: default: if (boardConnected == MURATA_SX1276) {