Skip to content

Commit

Permalink
removed an error update at select nextchannel
Browse files Browse the repository at this point in the history
  • Loading branch information
Heltec-Aaron-Lee committed Aug 2, 2021
1 parent 4e96e1b commit 3212aa6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions libraries/LoraWan102/src/loramac/LoRaMac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2631,17 +2631,16 @@ static LoRaMacStatus_t ScheduleTx( void )
while ( RegionNextChannel( LoRaMacRegion, &nextChan, &Channel, &dutyCycleTimeOff, &AggregatedTimeOff ) == false ) {
// Set the default datarate
//LoRaMacParams.ChannelsDatarate = LoRaMacParamsDefaults.ChannelsDatarate;
int8_t dr_temp = LoRaMacParams.ChannelsDatarate;
if(dr_temp == minDatarate)
if(LoRaMacParams.ChannelsDatarate == minDatarate)
{
dr_temp = maxDatarate;
LoRaMacParams.ChannelsDatarate = maxDatarate;
}
else
{
dr_temp --;
LoRaMacParams.ChannelsDatarate --;
}
// Update datarate in the function parameters
nextChan.Datarate = dr_temp;
nextChan.Datarate = LoRaMacParams.ChannelsDatarate;
}


Expand Down

0 comments on commit 3212aa6

Please sign in to comment.