Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/jgromes/RadioLib
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenCellist committed Oct 28, 2024
2 parents ef0cfdd + 4bd05de commit 19b09a0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/modules/LR11x0/LR11x0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,12 @@ int16_t LR11x0::setDataRate(DataRate_t dr) {
state = this->setCodingRate(dr.lora.codingRate);

} else if(type == RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS) {
// set the basic config
state = this->setLrFhssConfig(dr.lrFhss.bw, dr.lrFhss.cr);
RADIOLIB_ASSERT(state);

// set hopping grid
this->lrFhssGrid = dr.lrFhss.narrowGrid ? RADIOLIB_LR11X0_LR_FHSS_GRID_STEP_NON_FCC : RADIOLIB_LR11X0_LR_FHSS_GRID_STEP_FCC;

}

Expand Down
9 changes: 9 additions & 0 deletions src/modules/SX126x/SX126x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,15 @@ int16_t SX126x::setDataRate(DataRate_t dr) {

// set the coding rate
state = this->setCodingRate(dr.lora.codingRate);

} else if(modem == RADIOLIB_SX126X_PACKET_TYPE_LR_FHSS) {
// set the basic config
state = this->setLrFhssConfig(dr.lrFhss.bw, dr.lrFhss.cr);
RADIOLIB_ASSERT(state);

// set hopping grid
this->lrFhssGridNonFcc = dr.lrFhss.narrowGrid ? RADIOLIB_SX126X_LR_FHSS_GRID_STEP_NON_FCC : RADIOLIB_SX126X_LR_FHSS_GRID_STEP_FCC;

}

return(state);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/SX126x/SX126x_LR_FHSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int16_t SX126x::buildLRFHSSPacket(const uint8_t* in, size_t in_len, uint8_t* out

// interleave the payload into output buffer
uint16_t step = 0;
while(step * step < nb_bits) {
while((size_t)(step * step) < nb_bits) {
// probably the silliest sqrt() I ever saw
step++;
}
Expand Down

0 comments on commit 19b09a0

Please sign in to comment.