presetForRegionChange

fun LoRaRegionPresetMap?.presetForRegionChange(previousRegion: Config.LoRaConfig.RegionCode, newRegion: Config.LoRaConfig.RegionCode, current: Config.LoRaConfig.ModemPreset): Config.LoRaConfig.ModemPreset(source)

Returns the modem preset the LoRa form should hold when the region changes from previousRegion to newRegion with current selected.

Keeps current (legality-repaired via repairPresetFor) except at fresh setup: when previousRegion is UNSET and current is the ModemPreset.LONG_FAST placeholder a factory-flashed node reports (proto default), the region's advertised default is adopted instead (the firmware map's when present, else the app's built-in default). Any other preset at UNSET was set deliberately (e.g. a vendor build pinning USERPREFS_LORACONFIG_MODEM_PRESET) and is kept.

A build that pins a preset can also advertise it as an UNSET map entry (firmware #11507), stating outright that the preset is deliberate; that keeps even a pinned LONG_FAST, which the placeholder heuristic alone cannot distinguish.