[CC1101] txPower updated according to chosen freq.

This commit is contained in:
Andrea Guglielmini 2019-12-12 02:50:55 +01:00
parent 16d599ec28
commit d863c02ffe
2 changed files with 6 additions and 1 deletions

View file

@ -315,7 +315,8 @@ int16_t CC1101::setFrequency(float freq) {
_freq = freq;
}
return(state);
// Update the TX power accordingly to new freq. (PA values depend on chosen freq)
return setOutputPower(_power);
}
int16_t CC1101::setBitRate(float br) {
@ -389,6 +390,9 @@ int16_t CC1101::setFrequencyDeviation(float freqDev) {
}
int16_t CC1101::setOutputPower(int8_t power) {
// Store the value.
_power = power;
// round to the known frequency settings
uint8_t f;
if(_freq < 374.0) {

View file

@ -833,6 +833,7 @@ class CC1101: public PhysicalLayer {
bool _promiscuous;
uint8_t _syncWordLength;
int8_t _power;
int16_t config();
int16_t directMode();