[CC1101] txPower updated according to chosen freq.
This commit is contained in:
parent
16d599ec28
commit
d863c02ffe
2 changed files with 6 additions and 1 deletions
|
@ -315,7 +315,8 @@ int16_t CC1101::setFrequency(float freq) {
|
||||||
_freq = 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) {
|
int16_t CC1101::setBitRate(float br) {
|
||||||
|
@ -389,6 +390,9 @@ int16_t CC1101::setFrequencyDeviation(float freqDev) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t CC1101::setOutputPower(int8_t power) {
|
int16_t CC1101::setOutputPower(int8_t power) {
|
||||||
|
// Store the value.
|
||||||
|
_power = power;
|
||||||
|
|
||||||
// round to the known frequency settings
|
// round to the known frequency settings
|
||||||
uint8_t f;
|
uint8_t f;
|
||||||
if(_freq < 374.0) {
|
if(_freq < 374.0) {
|
||||||
|
|
|
@ -833,6 +833,7 @@ class CC1101: public PhysicalLayer {
|
||||||
bool _promiscuous;
|
bool _promiscuous;
|
||||||
|
|
||||||
uint8_t _syncWordLength;
|
uint8_t _syncWordLength;
|
||||||
|
int8_t _power;
|
||||||
|
|
||||||
int16_t config();
|
int16_t config();
|
||||||
int16_t directMode();
|
int16_t directMode();
|
||||||
|
|
Loading…
Add table
Reference in a new issue