Skip to content

Commit

Permalink
Merge pull request #1166 from kb9nate/patch-1
Browse files Browse the repository at this point in the history
Update SX1278.cpp to fix errataFix typo
  • Loading branch information
jgromes authored Jul 18, 2024
2 parents 858bf64 + ceba2d9 commit 111fb37
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/modules/SX127x/SX1278.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,49 +639,49 @@ void SX1278::errataFix(bool rx) {
uint8_t fixedRegs[3] = { 0x00, 0x00, 0x00 };
float rxFreq = frequency;
if(fabs(SX127x::bandwidth - 7.8) <= 0.001) {
fixedRegs[0] = 0b0000000;
fixedRegs[0] = 0b00000000;
fixedRegs[1] = 0x48;
fixedRegs[2] = 0x00;
rxFreq += 0.00781;
} else if(fabs(SX127x::bandwidth - 10.4) <= 0.001) {
fixedRegs[0] = 0b0000000;
fixedRegs[0] = 0b00000000;
fixedRegs[1] = 0x44;
fixedRegs[2] = 0x00;
rxFreq += 0.01042;
} else if(fabs(SX127x::bandwidth - 15.6) <= 0.001) {
fixedRegs[0] = 0b0000000;
fixedRegs[0] = 0b00000000;
fixedRegs[1] = 0x44;
fixedRegs[2] = 0x00;
rxFreq += 0.01562;
} else if(fabs(SX127x::bandwidth - 20.8) <= 0.001) {
fixedRegs[0] = 0b0000000;
fixedRegs[0] = 0b00000000;
fixedRegs[1] = 0x44;
fixedRegs[2] = 0x00;
rxFreq += 0.02083;
} else if(fabs(SX127x::bandwidth - 31.25) <= 0.001) {
fixedRegs[0] = 0b0000000;
fixedRegs[0] = 0b00000000;
fixedRegs[1] = 0x44;
fixedRegs[2] = 0x00;
rxFreq += 0.03125;
} else if(fabs(SX127x::bandwidth - 41.7) <= 0.001) {
fixedRegs[0] = 0b0000000;
fixedRegs[0] = 0b00000000;
fixedRegs[1] = 0x44;
fixedRegs[2] = 0x00;
rxFreq += 0.04167;
} else if(fabs(SX127x::bandwidth - 62.5) <= 0.001) {
fixedRegs[0] = 0b0000000;
fixedRegs[0] = 0b00000000;
fixedRegs[1] = 0x40;
fixedRegs[2] = 0x00;
} else if(fabs(SX127x::bandwidth - 125.0) <= 0.001) {
fixedRegs[0] = 0b0000000;
fixedRegs[0] = 0b00000000;
fixedRegs[1] = 0x40;
fixedRegs[2] = 0x00;
} else if(fabs(SX127x::bandwidth - 250.0) <= 0.001) {
fixedRegs[0] = 0b0000000;
fixedRegs[0] = 0b00000000;
fixedRegs[1] = 0x40;
fixedRegs[2] = 0x00;
} else if(fabs(SX127x::bandwidth - 500.0) <= 0.001) {
fixedRegs[0] = 0b1000000;
fixedRegs[0] = 0b10000000;
fixedRegs[1] = mod->SPIreadRegister(0x2F);
fixedRegs[2] = mod->SPIreadRegister(0x30);
} else {
Expand Down

0 comments on commit 111fb37

Please sign in to comment.