mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-08 22:22:05 +00:00
Cast user pref strings. (#6123)
This commit is contained in:
parent
f2e49aa4ee
commit
598cfcc081
@ -117,7 +117,7 @@ AudioThread *audioThread = nullptr;
|
|||||||
|
|
||||||
using namespace concurrency;
|
using namespace concurrency;
|
||||||
|
|
||||||
volatile static const char slipstreamTZString[] = USERPREFS_TZ_STRING;
|
volatile static const char slipstreamTZString[] = {USERPREFS_TZ_STRING};
|
||||||
|
|
||||||
// We always create a screen object, but we only init it if we find the hardware
|
// We always create a screen object, but we only init it if we find the hardware
|
||||||
graphics::Screen *screen = nullptr;
|
graphics::Screen *screen = nullptr;
|
||||||
|
@ -119,7 +119,7 @@ void Channels::initDefaultChannel(ChannelIndex chIndex)
|
|||||||
channelSettings.psk.size = sizeof(defaultpsk0);
|
channelSettings.psk.size = sizeof(defaultpsk0);
|
||||||
#endif
|
#endif
|
||||||
#ifdef USERPREFS_CHANNEL_0_NAME
|
#ifdef USERPREFS_CHANNEL_0_NAME
|
||||||
strcpy(channelSettings.name, USERPREFS_CHANNEL_0_NAME);
|
strcpy(channelSettings.name, (const char *)USERPREFS_CHANNEL_0_NAME);
|
||||||
#endif
|
#endif
|
||||||
#ifdef USERPREFS_CHANNEL_0_PRECISION
|
#ifdef USERPREFS_CHANNEL_0_PRECISION
|
||||||
channelSettings.module_settings.position_precision = USERPREFS_CHANNEL_0_PRECISION;
|
channelSettings.module_settings.position_precision = USERPREFS_CHANNEL_0_PRECISION;
|
||||||
@ -138,7 +138,7 @@ void Channels::initDefaultChannel(ChannelIndex chIndex)
|
|||||||
channelSettings.psk.size = sizeof(defaultpsk1);
|
channelSettings.psk.size = sizeof(defaultpsk1);
|
||||||
#endif
|
#endif
|
||||||
#ifdef USERPREFS_CHANNEL_1_NAME
|
#ifdef USERPREFS_CHANNEL_1_NAME
|
||||||
strcpy(channelSettings.name, USERPREFS_CHANNEL_1_NAME);
|
strcpy(channelSettings.name, (const char *)USERPREFS_CHANNEL_1_NAME);
|
||||||
#endif
|
#endif
|
||||||
#ifdef USERPREFS_CHANNEL_1_PRECISION
|
#ifdef USERPREFS_CHANNEL_1_PRECISION
|
||||||
channelSettings.module_settings.position_precision = USERPREFS_CHANNEL_1_PRECISION;
|
channelSettings.module_settings.position_precision = USERPREFS_CHANNEL_1_PRECISION;
|
||||||
@ -157,7 +157,7 @@ void Channels::initDefaultChannel(ChannelIndex chIndex)
|
|||||||
channelSettings.psk.size = sizeof(defaultpsk2);
|
channelSettings.psk.size = sizeof(defaultpsk2);
|
||||||
#endif
|
#endif
|
||||||
#ifdef USERPREFS_CHANNEL_2_NAME
|
#ifdef USERPREFS_CHANNEL_2_NAME
|
||||||
strcpy(channelSettings.name, USERPREFS_CHANNEL_2_NAME);
|
strcpy(channelSettings.name, (const char *)USERPREFS_CHANNEL_2_NAME);
|
||||||
#endif
|
#endif
|
||||||
#ifdef USERPREFS_CHANNEL_2_PRECISION
|
#ifdef USERPREFS_CHANNEL_2_PRECISION
|
||||||
channelSettings.module_settings.position_precision = USERPREFS_CHANNEL_2_PRECISION;
|
channelSettings.module_settings.position_precision = USERPREFS_CHANNEL_2_PRECISION;
|
||||||
|
@ -859,12 +859,12 @@ void NodeDB::installDefaultDeviceState()
|
|||||||
// Set default owner name
|
// Set default owner name
|
||||||
pickNewNodeNum(); // based on macaddr now
|
pickNewNodeNum(); // based on macaddr now
|
||||||
#ifdef USERPREFS_CONFIG_OWNER_LONG_NAME
|
#ifdef USERPREFS_CONFIG_OWNER_LONG_NAME
|
||||||
snprintf(owner.long_name, sizeof(owner.long_name), USERPREFS_CONFIG_OWNER_LONG_NAME);
|
snprintf(owner.long_name, sizeof(owner.long_name), (const char *)USERPREFS_CONFIG_OWNER_LONG_NAME);
|
||||||
#else
|
#else
|
||||||
snprintf(owner.long_name, sizeof(owner.long_name), "Meshtastic %04x", getNodeNum() & 0x0ffff);
|
snprintf(owner.long_name, sizeof(owner.long_name), "Meshtastic %04x", getNodeNum() & 0x0ffff);
|
||||||
#endif
|
#endif
|
||||||
#ifdef USERPREFS_CONFIG_OWNER_SHORT_NAME
|
#ifdef USERPREFS_CONFIG_OWNER_SHORT_NAME
|
||||||
snprintf(owner.short_name, sizeof(owner.short_name), USERPREFS_CONFIG_OWNER_SHORT_NAME);
|
snprintf(owner.short_name, sizeof(owner.short_name), (const char *)USERPREFS_CONFIG_OWNER_SHORT_NAME);
|
||||||
#else
|
#else
|
||||||
snprintf(owner.short_name, sizeof(owner.short_name), "%04x", getNodeNum() & 0x0ffff);
|
snprintf(owner.short_name, sizeof(owner.short_name), "%04x", getNodeNum() & 0x0ffff);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user