[CC1101] Fixed parameter type
This commit is contained in:
parent
76d9a91ffa
commit
b006a9d52b
2 changed files with 6 additions and 4 deletions
|
@ -174,7 +174,8 @@ int16_t CC1101::setBitRate(float br) {
|
||||||
SPIsendCommand(CC1101_CMD_IDLE);
|
SPIsendCommand(CC1101_CMD_IDLE);
|
||||||
|
|
||||||
// calculate exponent and mantisa values
|
// calculate exponent and mantisa values
|
||||||
uint8_t e, m;
|
uint8_t e = 0;
|
||||||
|
uint8_t m = 0;
|
||||||
getExpMant(br * 1000.0, 256, 28, 14, e, m);
|
getExpMant(br * 1000.0, 256, 28, 14, e, m);
|
||||||
|
|
||||||
// set bit rate value
|
// set bit rate value
|
||||||
|
@ -223,7 +224,8 @@ int16_t CC1101::setFrequencyDeviation(float freqDev) {
|
||||||
SPIsendCommand(CC1101_CMD_IDLE);
|
SPIsendCommand(CC1101_CMD_IDLE);
|
||||||
|
|
||||||
// calculate exponent and mantisa values
|
// calculate exponent and mantisa values
|
||||||
uint8_t e, m;
|
uint8_t e = 0;
|
||||||
|
uint8_t m = 0;
|
||||||
getExpMant(freqDev * 1000.0, 8, 17, 7, e, m);
|
getExpMant(freqDev * 1000.0, 8, 17, 7, e, m);
|
||||||
|
|
||||||
// set frequency deviation value
|
// set frequency deviation value
|
||||||
|
@ -252,7 +254,7 @@ int16_t CC1101::directMode() {
|
||||||
return(state);
|
return(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CC1101::getExpMant(float target, uint8_t mantOffset, uint8_t divExp, uint8_t expMax, uint8_t& exp, uint8_t& mant) {
|
void CC1101::getExpMant(float target, uint16_t mantOffset, uint8_t divExp, uint8_t expMax, uint8_t& exp, uint8_t& mant) {
|
||||||
// get table origin point (exp = 0, mant = 0)
|
// get table origin point (exp = 0, mant = 0)
|
||||||
float origin = (mantOffset * CC1101_CRYSTAL_FREQ * 1000000.0)/((uint32_t)1 << divExp);
|
float origin = (mantOffset * CC1101_CRYSTAL_FREQ * 1000000.0)/((uint32_t)1 << divExp);
|
||||||
|
|
||||||
|
|
|
@ -519,7 +519,7 @@ class CC1101: public PhysicalLayer {
|
||||||
|
|
||||||
int16_t config();
|
int16_t config();
|
||||||
int16_t directMode();
|
int16_t directMode();
|
||||||
void getExpMant(float target, uint8_t mantOffset, uint8_t divExp, uint8_t expMax, uint8_t& exp, uint8_t& mant);
|
void getExpMant(float target, uint16_t mantOffset, uint8_t divExp, uint8_t expMax, uint8_t& exp, uint8_t& mant);
|
||||||
|
|
||||||
// SPI read overrides to set access bit for status registers
|
// SPI read overrides to set access bit for status registers
|
||||||
int16_t SPIgetRegValue(uint8_t reg, uint8_t msb = 7, uint8_t lsb = 0);
|
int16_t SPIgetRegValue(uint8_t reg, uint8_t msb = 7, uint8_t lsb = 0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue