Add debug log setting and custom endpoint settings

This commit is contained in:
Djuri 2024-12-28 16:29:34 +01:00
parent 190d650887
commit bc3e5afe51
7 changed files with 95 additions and 30 deletions

View file

@ -284,6 +284,22 @@ void setupPreferences()
setBlockHeight(preferences.getUInt("blockHeight", INITIAL_BLOCK_HEIGHT));
setPrice(preferences.getUInt("lastPrice", INITIAL_LAST_PRICE), CURRENCY_USD);
if (!preferences.isKey("enableDebugLog")) {
preferences.putBool("enableDebugLog", DEFAULT_ENABLE_DEBUG_LOG);
}
if (!preferences.isKey("ceEnabled")) {
preferences.putBool("ceEnabled", DEFAULT_CUSTOM_ENDPOINT_ENABLED);
}
if (!preferences.isKey("ceEndpoint")) {
preferences.putString("ceEndpoint", DEFAULT_CUSTOM_ENDPOINT);
}
if (!preferences.isKey("ceDisableSSL")) {
preferences.putBool("ceDisableSSL", DEFAULT_CUSTOM_ENDPOINT_DISABLE_SSL);
}
if (preferences.getBool("ownDataSource", DEFAULT_OWN_DATA_SOURCE))
ScreenHandler::setCurrentCurrency(preferences.getUChar("lastCurrency", CURRENCY_USD));
else
@ -767,3 +783,8 @@ const char* getWebUiFilename() {
return "littlefs_4MB.bin";
}
}
bool debugLogEnabled()
{
return preferences.getBool("enableDebugLog", DEFAULT_ENABLE_DEBUG_LOG);
}