Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b4a20c1
Add a new frequency range for EU SRD area with adaptive DC
caveman99 Nov 19, 2025
b1a0633
new presets yo
NomDeTom Dec 20, 2025
d6b58c7
Update protobufs
NomDeTom Dec 20, 2025
6d5b632
Merge pull request #4 from NomDeTom/create-pull-request/update-protobufs
NomDeTom Dec 20, 2025
d8bfab5
guards against using presets outside of region
NomDeTom Dec 20, 2025
dcf476c
update EU 866MHz band description
NomDeTom Dec 23, 2025
8fa1c4a
Refactor preset validation to happen before applying radio config (an…
Stary2001 Dec 24, 2025
94aa0fb
add default preset to regions
NomDeTom Dec 24, 2025
3921945
update RDEF macro to include default presets and preset bits
NomDeTom Dec 24, 2025
44a2fda
Refactor RDEF macro for improved readability and consistency; adjust …
NomDeTom Dec 24, 2025
8b22774
Improved the allowed presets checking by adding a bitfield to each re…
NomDeTom Dec 25, 2025
ab601fa
Check settings against the new region, not the old one
Stary2001 Dec 26, 2025
9536221
use array of accepted modes per region
phaseloop Dec 28, 2025
e624b8f
fix compliation error
phaseloop Dec 28, 2025
52664f9
Merge pull request #6 from phaseloop/New_presets-array
NomDeTom Dec 29, 2025
e1ea21f
added ham check
NomDeTom Dec 29, 2025
9162a6f
interim for review
NomDeTom Dec 29, 2025
72b350c
Update HAM US433 frequency range and config settings
wehooper4 Jan 3, 2026
c4087d9
Merge pull request #7 from wehooper4/patch-1
NomDeTom Jan 3, 2026
4693296
remove hamfast
NomDeTom Jan 3, 2026
ef959cc
Update protobufs
NomDeTom Jan 3, 2026
0748de7
Merge pull request #8 from NomDeTom/create-pull-request/update-protobufs
NomDeTom Jan 3, 2026
2a25a15
tidy up removing hamfast
NomDeTom Jan 3, 2026
4a70f79
fixed license check
NomDeTom Jan 4, 2026
b87e88f
Add overrideSlot to RegionInfo and update RDEF macro usage, added err…
NomDeTom Jan 5, 2026
7255a02
added logging if slot override is being used
NomDeTom Jan 5, 2026
ebb70c4
Merge upstream branch changes, inc KZ region update and custom CR cha…
NomDeTom Jan 5, 2026
879daab
trunk FML
NomDeTom Jan 5, 2026
f64e69c
fixed error in CR check, added logic for if a lower CR than default i…
NomDeTom Jan 5, 2026
be0223e
Merge branch 'develop' into New_presets
NomDeTom Jan 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion protobufs
12 changes: 12 additions & 0 deletions src/DisplayFormatters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ const char *DisplayFormatters::getModemPresetDisplayName(meshtastic_Config_LoRaC
case meshtastic_Config_LoRaConfig_ModemPreset_LONG_MODERATE:
return useShortName ? "LongM" : "LongMod";
break;
case meshtastic_Config_LoRaConfig_ModemPreset_LITE_FAST:
return useShortName ? "LiteF" : "LiteFast";
break;
case meshtastic_Config_LoRaConfig_ModemPreset_LITE_SLOW:
return useShortName ? "LiteS" : "LiteSlow";
break;
case meshtastic_Config_LoRaConfig_ModemPreset_NARROW_FAST:
return useShortName ? "NarF" : "NarrowFast";
break;
case meshtastic_Config_LoRaConfig_ModemPreset_NARROW_SLOW:
return useShortName ? "NarS" : "NarrowSlow";
break;
default:
return useShortName ? "Custom" : "Invalid";
break;
Expand Down
7 changes: 4 additions & 3 deletions src/airtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@ bool AirTime::isTxAllowedChannelUtil(bool polite)

bool AirTime::isTxAllowedAirUtil()
{
if (!config.lora.override_duty_cycle && myRegion->dutyCycle < 100) {
if (utilizationTXPercent() < myRegion->dutyCycle * polite_duty_cycle_percent / 100) {
float effectiveDutyCycle = getEffectiveDutyCycle();
if (!config.lora.override_duty_cycle && effectiveDutyCycle < 100) {
if (utilizationTXPercent() < effectiveDutyCycle * polite_duty_cycle_percent / 100) {
return true;
} else {
LOG_WARN("TX air util. >%f%%. Skip send", myRegion->dutyCycle * polite_duty_cycle_percent / 100);
LOG_WARN("TX air util. >%f%%. Skip send", effectiveDutyCycle * polite_duty_cycle_percent / 100);
return false;
}
}
Expand Down
12 changes: 10 additions & 2 deletions src/graphics/draw/MenuHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ void menuHandler::LoraRegionPicker(uint32_t duration)
{"US", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_US},
{"EU_433", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_EU_433},
{"EU_868", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_EU_868},
{"NARROW_868", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_NARROW_868},
{"EU_866", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_EU_866},
{"CN", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_CN},
{"JP", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_JP},
{"ANZ", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_ANZ},
Expand All @@ -135,6 +137,7 @@ void menuHandler::LoraRegionPicker(uint32_t duration)
{"KZ_863", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_KZ_863},
{"NP_865", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_NP_865},
{"BR_902", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_BR_902},
{"HAM_US433", OptionsAction::Select, meshtastic_Config_LoRaConfig_RegionCode_HAM_US433},
};

constexpr size_t regionCount = sizeof(regionOptions) / sizeof(regionOptions[0]);
Expand Down Expand Up @@ -185,7 +188,7 @@ void menuHandler::LoraRegionPicker(uint32_t duration)
#endif
config.lora.tx_enabled = true;
initRegion();
if (myRegion->dutyCycle < 100) {
if (getEffectiveDutyCycle() < 100) {
config.lora.ignore_mqtt = true; // Ignore MQTT by default if region has a duty cycle limit
}

Expand Down Expand Up @@ -247,6 +250,8 @@ void menuHandler::DeviceRolePicker()
screen->showOverlayBanner(bannerOptions);
}

// TODO: make RadioPresetOption array dynamic based on available presets for region

void menuHandler::RadioPresetPicker()
{
static const RadioPresetOption presetOptions[] = {
Expand All @@ -259,7 +264,10 @@ void menuHandler::RadioPresetPicker()
{"ShortSlow", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW},
{"ShortFast", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST},
{"ShortTurbo", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO},
};
{"LiteFast", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_LITE_FAST},
{"LiteSlow", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_LITE_SLOW},
{"NarrowFast", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_NARROW_FAST},
{"NarrowSlow", OptionsAction::Select, meshtastic_Config_LoRaConfig_ModemPreset_NARROW_SLOW}};

constexpr size_t presetCount = sizeof(presetOptions) / sizeof(presetOptions[0]);
static std::array<const char *, presetCount> presetLabels{};
Expand Down
21 changes: 20 additions & 1 deletion src/mesh/MeshRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,29 @@ struct RegionInfo {
bool audioPermitted;
bool freqSwitching;
bool wideLora;
bool licensedOnly; // Only allow in HAM mode
uint8_t overrideSlot; // default frequency slot if not using channel hashing
meshtastic_Config_LoRaConfig_ModemPreset defaultPreset;
// static list of available presets
const meshtastic_Config_LoRaConfig_ModemPreset *availablePresets;
const char *name; // EU433 etc
};

extern const RegionInfo regions[];
extern const RegionInfo *myRegion;

extern void initRegion();
extern void initRegion();

/**
* Get the effective duty cycle for the current region based on device role.
* For EU_866, returns 10% for fixed devices (ROUTER, ROUTER_LATE) and 2.5% for mobile devices.
* For other regions, returns the standard duty cycle.
*/
extern float getEffectiveDutyCycle();

extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_STD[];
extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_EU_868[];
extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_LITE[];
extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_NARROW[];
extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_HAM[];
extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_UNDEF[];
Loading
Loading