Skip to content

Commit

Permalink
Fixes as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
pkendall64 committed Jan 28, 2023
1 parent cdb6f01 commit 2e06ce8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/Backpack/devBackpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static int timeout()
return 1000; // don't check for another second so we don't spam too hard :-)
}

if (versionRequestTries < 10 && strlen(backpackVersion) == 0 && (lastVersionTryTime == 0 || lastVersionTryTime+1000 < millis())) {
if (versionRequestTries < 10 && strlen(backpackVersion) == 0 && (lastVersionTryTime == 0 || millis() - lastVersionTryTime > 1000)) {
lastVersionTryTime = millis();
versionRequestTries++;
mspPacket_t out;
Expand Down
8 changes: 4 additions & 4 deletions src/src/tx_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void ICACHE_RAM_ATTR SetRFLinkRate(uint8_t index) // Set speed of RF link (hz)
, uidMacSeedGet(), OtaCrcInitializer, (ModParams->radio_type == RADIO_TYPE_SX128x_FLRC)
#endif
);

if (isDualRadio() && config.GetAntennaMode() == TX_RADIO_MODE_GEMINI) // Gemini mode
{
Radio.SetFrequencyReg(FHSSgetInitialGeminiFreq(), SX12XX_Radio_2);
Expand Down Expand Up @@ -369,7 +369,7 @@ void ICACHE_RAM_ATTR HandleFHSS()
Radio.SetFrequencyReg(FHSSgetGeminiFreq(), SX12XX_Radio_2);
}
else
{
{
Radio.SetFrequencyReg(FHSSgetNextFreq());
}
}
Expand Down Expand Up @@ -461,7 +461,7 @@ void ICACHE_RAM_ATTR SendRCdataToRF()
switch (config.GetAntennaMode())
{
case TX_RADIO_MODE_GEMINI:
transmittingRadio = SX12XX_Radio_All; // Gemini mode
transmittingRadio = SX12XX_Radio_All; // Gemini mode
break;
case TX_RADIO_MODE_ANT_1:
transmittingRadio = SX12XX_Radio_1; // Single antenna tx and true diversity rx for tlm receiption.
Expand Down Expand Up @@ -931,7 +931,7 @@ void ProcessMSPPacket(mspPacket_t *packet)
if (packet->function == MSP_ELRS_GET_BACKPACK_VERSION)
{
memset(backpackVersion, 0, sizeof(backpackVersion));
memcpy(backpackVersion, packet->payload, packet->payloadSize > sizeof(backpackVersion)-1 ? sizeof(backpackVersion)-1 : packet->payloadSize);
memcpy(backpackVersion, packet->payload, min((size_t)packet->payloadSize, sizeof(backpackVersion)-1));
}
}

Expand Down

0 comments on commit 2e06ce8

Please sign in to comment.