diff --git a/Radio.cpp b/Radio.cpp index b438a68..33b46a9 100644 --- a/Radio.cpp +++ b/Radio.cpp @@ -2208,60 +2208,88 @@ void sx128x::setTxPower(int level, int outputPin) { switch (level) { case 0: reg_value = -18; + break; case 1: reg_value = -17; + break; case 2: reg_value = -16; + break; case 3: reg_value = -15; + break; case 4: reg_value = -14; + break; case 5: reg_value = -13; + break; case 6: reg_value = -12; + break; case 7: reg_value = -10; + break; case 8: reg_value = -9; + break; case 9: reg_value = -8; + break; case 10: reg_value = -7; + break; case 11: reg_value = -6; + break; case 12: reg_value = -5; + break; case 13: reg_value = -4; + break; case 14: reg_value = -3; + break; case 15: reg_value = -2; + break; case 16: reg_value = -1; + break; case 17: reg_value = 0; + break; case 18: reg_value = 1; + break; case 19: reg_value = 2; + break; case 20: reg_value = 3; + break; case 21: reg_value = 4; + break; case 22: reg_value = 5; + break; case 23: reg_value = 6; + break; case 24: reg_value = 8; + break; case 25: reg_value = 9; + break; case 26: reg_value = 12; + break; case 27: reg_value = 13; + break; } diff --git a/Radio.h b/Radio.h index 9b88114..8fdda9b 100644 --- a/Radio.h +++ b/Radio.h @@ -66,14 +66,14 @@ public: _radio_online(false), _st_airtime_limit(0.0), _lt_airtime_limit(0.0), _airtime_lock(false), _airtime(0.0), _longterm_airtime(0.0), _local_channel_util(0.0), _total_channel_util(0.0), - _longterm_channel_util(0.0), _last_status_update(0), _last_dcd(0), - _stat_rx_ongoing(false), _stat_signal_detected(false), - _stat_signal_synced(false), _dcd_count(0), _dcd(false), _dcd_led(false), + _longterm_channel_util(0.0), _last_status_update(0), + _stat_signal_detected(false), _stat_signal_synced(false),_stat_rx_ongoing(false), _last_dcd(0), + _dcd_count(0), _dcd(false), _dcd_led(false), _dcd_waiting(false), _dcd_wait_until(0), _dcd_sample(0), _post_tx_yield_timeout(0), _csma_slot_ms(50), _csma_p_min(0.1), _csma_p_max(0.8), _preambleLength(6), _lora_symbol_time_ms(0.0), _lora_symbol_rate(0.0), _lora_us_per_byte(0.0), _bitrate(0), - _onReceive(NULL), _packet{0} {}; + _packet{0}, _onReceive(NULL) {}; virtual int begin(); virtual void end();