[CC1101] Fixed typos

This commit is contained in:
jgromes 2020-03-22 08:10:49 +01:00
parent 3bb81988dd
commit 28c12f4576
3 changed files with 12 additions and 12 deletions

View file

@ -123,8 +123,8 @@ void loop() {
// you can also transmit byte array up to 256 bytes long // you can also transmit byte array up to 256 bytes long
/* /*
byte byteArr[] = {0x01, 0x23, 0x45, 0x56, byte byteArr[] = {0x01, 0x23, 0x45, 0x67,
0x78, 0xAB, 0xCD, 0xEF}; 0x89, 0xAB, 0xCD, 0xEF};
int state = cc.startTransmit(byteArr, 8); int state = cc.startTransmit(byteArr, 8);
*/ */

View file

@ -76,7 +76,7 @@ int16_t CC1101::begin(float freq, float br, float freqDev, float rxBw, int8_t po
state = variablePacketLengthMode(); state = variablePacketLengthMode();
RADIOLIB_ASSERT(state); RADIOLIB_ASSERT(state);
// configure default preamble lenght // configure default preamble length
state = setPreambleLength(preambleLength); state = setPreambleLength(preambleLength);
RADIOLIB_ASSERT(state); RADIOLIB_ASSERT(state);
@ -330,7 +330,7 @@ int16_t CC1101::setBitRate(float br) {
// set mode to standby // set mode to standby
SPIsendCommand(CC1101_CMD_IDLE); SPIsendCommand(CC1101_CMD_IDLE);
// calculate exponent and mantisa values // calculate exponent and mantissa values
uint8_t e = 0; uint8_t e = 0;
uint8_t m = 0; uint8_t m = 0;
getExpMant(br * 1000.0, 256, 28, 14, e, m); getExpMant(br * 1000.0, 256, 28, 14, e, m);
@ -350,7 +350,7 @@ int16_t CC1101::setRxBandwidth(float rxBw) {
// set mode to standby // set mode to standby
SPIsendCommand(CC1101_CMD_IDLE); SPIsendCommand(CC1101_CMD_IDLE);
// calculate exponent and mantisa values // calculate exponent and mantissa values
for(int8_t e = 3; e >= 0; e--) { for(int8_t e = 3; e >= 0; e--) {
for(int8_t m = 3; m >= 0; m --) { for(int8_t m = 3; m >= 0; m --) {
float point = (CC1101_CRYSTAL_FREQ * 1000000.0)/(8 * (m + 4) * ((uint32_t)1 << e)); float point = (CC1101_CRYSTAL_FREQ * 1000000.0)/(8 * (m + 4) * ((uint32_t)1 << e));
@ -380,7 +380,7 @@ int16_t CC1101::setFrequencyDeviation(float freqDev) {
// set mode to standby // set mode to standby
SPIsendCommand(CC1101_CMD_IDLE); SPIsendCommand(CC1101_CMD_IDLE);
// calculate exponent and mantisa values // calculate exponent and mantissa values
uint8_t e = 0; uint8_t e = 0;
uint8_t m = 0; uint8_t m = 0;
getExpMant(freqDev * 1000.0, 8, 17, 7, e, m); getExpMant(freqDev * 1000.0, 8, 17, 7, e, m);
@ -563,8 +563,8 @@ int16_t CC1101::setOOK(bool enableOOK) {
int16_t state = SPIsetRegValue(CC1101_REG_MDMCFG2, CC1101_MOD_FORMAT_ASK_OOK, 6, 4); int16_t state = SPIsetRegValue(CC1101_REG_MDMCFG2, CC1101_MOD_FORMAT_ASK_OOK, 6, 4);
RADIOLIB_ASSERT(state); RADIOLIB_ASSERT(state);
// PA_TABLE[0] is (by default) the power value used when transmitting a "0L". // PA_TABLE[0] is (by default) the power value used when transmitting a "0".
// Set PA_TABLE[1] to be used when transmitting a "1L". // Set PA_TABLE[1] to be used when transmitting a "1".
state = SPIsetRegValue(CC1101_REG_FREND0, 1, 2, 0); state = SPIsetRegValue(CC1101_REG_FREND0, 1, 2, 0);
RADIOLIB_ASSERT(state); RADIOLIB_ASSERT(state);
@ -627,11 +627,11 @@ int16_t CC1101::variablePacketLengthMode(uint8_t maxLen) {
int16_t CC1101::enableSyncWordFiltering(uint8_t maxErrBits, bool requireCarrierSense) { int16_t CC1101::enableSyncWordFiltering(uint8_t maxErrBits, bool requireCarrierSense) {
switch (maxErrBits){ switch (maxErrBits){
case 0: case 0:
// in 16 bit sync word, expect all 16 bits. // in 16 bit sync word, expect all 16 bits
return (SPIsetRegValue(CC1101_REG_MDMCFG2, return (SPIsetRegValue(CC1101_REG_MDMCFG2,
requireCarrierSense ? CC1101_SYNC_MODE_16_16_THR : CC1101_SYNC_MODE_16_16, 2, 0)); requireCarrierSense ? CC1101_SYNC_MODE_16_16_THR : CC1101_SYNC_MODE_16_16, 2, 0));
case 1: case 1:
// in 16 bit sync word, expect at least 15 bits. // in 16 bit sync word, expect at least 15 bits
return (SPIsetRegValue(CC1101_REG_MDMCFG2, return (SPIsetRegValue(CC1101_REG_MDMCFG2,
requireCarrierSense ? CC1101_SYNC_MODE_15_16_THR : CC1101_SYNC_MODE_15_16, 2, 0)); requireCarrierSense ? CC1101_SYNC_MODE_15_16_THR : CC1101_SYNC_MODE_15_16, 2, 0));
default: default: