fix default slot (#155)

This commit is contained in:
Manuel
2025-06-23 16:10:58 +02:00
committed by GitHub
parent d99edaf437
commit cdc6e5bdee
+2 -1
View File
@@ -1,4 +1,5 @@
#include "graphics/common/LoRaPresets.h"
#include "util/ILog.h"
/**
* LoRa Presets
@@ -48,7 +49,7 @@ uint16_t LoRaPresets::getDefaultSlot(meshtastic_Config_LoRaConfig_RegionCode reg
uint32_t numChannels = getNumChannels(region, preset);
return numChannels == 0
? 1
? (region == meshtastic_Config_LoRaConfig_RegionCode_UNSET ? 0 : 1)
: hash(channelName && channelName[0] != '\0' ? channelName : modemPreset[preset].preset) % numChannels + 1;
}