Draft
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4135 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 3 3
Lines 23 23
Branches 7 7
=====================================
Misses 23 23 ☔ View full report in Codecov by Sentry. |
This commit introduces several new regions and corresponding modem presets to align with recent firmware updates. - Adds `EU_866`, `NARROW_868`, and `HAM_US433` regions. - Adds new modem presets: `LITE_FAST`, `LITE_SLOW`, `NARROW_FAST`, and `NARROW_SLOW`. - Updates the channel calculation logic to account for channel spacing, matching the firmware's behavior. - Sets the default modem preset automatically when a new region is selected. - Updates the protobuf submodule to the latest version. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
3b7afbd to
9602fe7
Compare
Correct the `numChannels` and `radioFreq` calculations to align with the firmware logic. This primarily affects the NARROW_868 region by properly accounting for channel spacing. - Remove `regionInfo.spacing` from the `numChannels` numerator. - Add `regionInfo.spacing` to the `radioFreq` calculation. - Add tests to verify `numChannels` and `radioFreq` for the `NARROW_868` region.
9602fe7 to
0724924
Compare
NomDeTom
reviewed
Jan 23, 2026
| // Firmware: channel_num = hash(channelName) % numChannels; | ||
| // freq = myRegion->freqStart + myRegion->spacing + (bw / 2000) + (channel_num * channelSpacing); | ||
| // The app's channelNum function returns 1..numChannels if channelNum is 0. | ||
| (regionInfo.freqStart + regionInfo.spacing + bw / 2) + (channelNum - 1) * channelSpacing |
There was a problem hiding this comment.
Should be
(regionInfo.freqStart + (bw / 2)) + ((channelNum - 1) * channelSpacing)
NomDeTom
reviewed
Jan 23, 2026
| (regionInfo.freqStart + bandwidth(regionInfo) / 2) + (channelNum - 1) * bandwidth(regionInfo) | ||
| val bw = bandwidth(regionInfo) | ||
| val channelSpacing = regionInfo.spacing + bw | ||
| // Match firmware: float freq = myRegion->freqStart + myRegion->spacing + (bw / 2000) + (channel_num * |
There was a problem hiding this comment.
Firmware line is float freq = myRegion->freqStart + (bw / 2000) + (channel_num * channelSpacing);
NomDeTom
reviewed
Jan 23, 2026
| ), | ||
|
|
||
| /** US 433MHz Amateur Use band */ | ||
| HAM_US433( |
There was a problem hiding this comment.
This has been taken out for now. Will come back to it after non-ham is sorted
The frequency calculation for amateur radio regions was incorrectly including `regionInfo.spacing`. This change removes the spacing component from the calculation when the region description contains "Amateur", aligning the behavior with the firmware.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces several new regions and corresponding modem presets to align with recent firmware updates.
EU_866,NARROW_868, andHAM_US433regions.LITE_FAST,LITE_SLOW,NARROW_FAST, andNARROW_SLOW.This is mostly for @NomDeTom to test his proposed changes.