Merge pull request #88 from Guglio95/master

[CC1101] Output power updated according to chosen frequency
This commit is contained in:
Jan Gromeš 2019-12-12 05:42:29 +01:00 committed by GitHub
commit e61bd588b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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();