Skip to content

Commit

Permalink
fix lora us915 logic to step into 500 kHz range
Browse files Browse the repository at this point in the history
  • Loading branch information
iamemilio authored and deadprogram committed Oct 26, 2023
1 parent e95cfe6 commit 4edb771
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lora/lorawan/region/us915.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,21 @@ func (c *ChannelUS) Next() bool {
freq, ok := stepFrequency125(c.frequency)
if ok {
c.frequency = freq
return true
} else {
c.frequency = lora.Mhz_903_0
return true
c.bandwidth = lora.Bandwidth_500_0
}
case lora.Bandwidth_500_0:
freq, ok := stepFrequency500(c.frequency)
if ok {
c.frequency = freq
return true
} else {
// there are no more frequencies to check after sweeping all 8 500 kHz channels
return false
}
}

return false
return true
}

func stepFrequency125(freq uint32) (uint32, bool) {
Expand Down

0 comments on commit 4edb771

Please sign in to comment.