X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fdrivers%2Fao_cc1200.c;fp=src%2Fdrivers%2Fao_cc1200.c;h=7ac32e188e1b46319f14c60b0c4b996517d29825;hp=9d3b77cbdf87561d56a8eb69b807927d4b041ce4;hb=3e7661761f6ea81b6a9732359edf4c5ada3e8e20;hpb=58a0a242f31ebe4532564f5c04162e8fb82f9aeb diff --git a/src/drivers/ao_cc1200.c b/src/drivers/ao_cc1200.c index 9d3b77cb..7ac32e18 100644 --- a/src/drivers/ao_cc1200.c +++ b/src/drivers/ao_cc1200.c @@ -716,6 +716,7 @@ ao_radio_get(uint8_t len) { static uint32_t last_radio_setting; static uint8_t last_radio_rate; + static uint8_t last_radio_10mw; ao_mutex_get(&ao_radio_mutex); @@ -732,6 +733,18 @@ ao_radio_get(uint8_t len) ao_radio_mode &= (uint16_t) ~AO_RADIO_MODE_BITS_PACKET; last_radio_rate = ao_config.radio_rate; } + if(ao_config.radio_10mw != last_radio_10mw) { + last_radio_10mw = ao_config.radio_10mw; + /* + * 0x37 "should" be 10dBm, but measurements on TBT + * v4.0 show that too hot by a about 1.5dB, so use + * 0x34 to make sure we're in spec. + */ + if (ao_config.radio_10mw) + ao_radio_reg_write(CC1200_PA_CFG1, 0x34); + else + ao_radio_reg_write(CC1200_PA_CFG1, 0x3f); + } ao_radio_set_len(len); }