formatting

This commit is contained in:
Kevin Hester 2021-01-08 11:52:43 +08:00
parent 20131a51a2
commit 3636b87db0

View File

@ -5,6 +5,7 @@
#include "FS.h" #include "FS.h"
#include "CryptoEngine.h" #include "CryptoEngine.h"
#include "FSCommon.h"
#include "GPS.h" #include "GPS.h"
#include "MeshRadio.h" #include "MeshRadio.h"
#include "NodeDB.h" #include "NodeDB.h"
@ -16,7 +17,6 @@
#include "error.h" #include "error.h"
#include "mesh-pb-constants.h" #include "mesh-pb-constants.h"
#include "meshwifi/meshwifi.h" #include "meshwifi/meshwifi.h"
#include "FSCommon.h"
#include <pb_decode.h> #include <pb_decode.h>
#include <pb_encode.h> #include <pb_encode.h>
@ -41,8 +41,6 @@ DeviceState versions used to be defined in the .proto file but really only this
#define DEVICESTATE_CUR_VER 11 #define DEVICESTATE_CUR_VER 11
#define DEVICESTATE_MIN_VER DEVICESTATE_CUR_VER #define DEVICESTATE_MIN_VER DEVICESTATE_CUR_VER
// FIXME - move this somewhere else // FIXME - move this somewhere else
extern void getMacAddr(uint8_t *dmac); extern void getMacAddr(uint8_t *dmac);
@ -148,18 +146,26 @@ bool NodeDB::resetRadioConfig()
if (!*channelName) { // emptystring if (!*channelName) { // emptystring
// Per mesh.proto spec, if bandwidth is specified we must ignore modemConfig enum, we assume that in that case // Per mesh.proto spec, if bandwidth is specified we must ignore modemConfig enum, we assume that in that case
// the app fucked up and forgot to set channelSettings.name // the app fucked up and forgot to set channelSettings.name
if (channelSettings.bandwidth != 0)
channelName = "Unset"; channelName = "Unset";
if(channelSettings.bandwidth == 0) switch(channelSettings.modem_config) { else
switch (channelSettings.modem_config) {
case ChannelSettings_ModemConfig_Bw125Cr45Sf128: case ChannelSettings_ModemConfig_Bw125Cr45Sf128:
channelName = "Medium"; break; channelName = "Medium";
break;
case ChannelSettings_ModemConfig_Bw500Cr45Sf128: case ChannelSettings_ModemConfig_Bw500Cr45Sf128:
channelName = "ShortFast"; break; channelName = "ShortFast";
break;
case ChannelSettings_ModemConfig_Bw31_25Cr48Sf512: case ChannelSettings_ModemConfig_Bw31_25Cr48Sf512:
channelName = "LongAlt"; break; channelName = "LongAlt";
break;
case ChannelSettings_ModemConfig_Bw125Cr48Sf4096: case ChannelSettings_ModemConfig_Bw125Cr48Sf4096:
channelName = "LongSlow"; break; channelName = "LongSlow";
break;
default: default:
channelName = "Invalid"; break; channelName = "Invalid";
break;
} }
} }
@ -271,7 +277,8 @@ void NodeDB::init()
myNodeInfo.node_num_bits = sizeof(NodeNum) * 8; myNodeInfo.node_num_bits = sizeof(NodeNum) * 8;
myNodeInfo.packet_id_bits = sizeof(PacketId) * 8; myNodeInfo.packet_id_bits = sizeof(PacketId) * 8;
myNodeInfo.error_code = CriticalErrorCode_None; // For the error code, only show values from this boot (discard value from flash) myNodeInfo.error_code =
CriticalErrorCode_None; // For the error code, only show values from this boot (discard value from flash)
myNodeInfo.error_address = 0; myNodeInfo.error_address = 0;
// likewise - we always want the app requirements to come from the running appload // likewise - we always want the app requirements to come from the running appload