SDCard enabled

This commit is contained in:
George Alexandre Silva 2024-05-05 15:36:14 -03:00
parent 1375b5bfa5
commit 6a936da474
2 changed files with 27 additions and 5 deletions

View File

@ -7,4 +7,17 @@
#define LED_PIN 4 // Red pin
#define LED_PIN_G 16 // Green pin
#define LED_PIN_B 17 // Green pin
// Pin defines for the SD card interface
// This is working for both, ESP32 2432S028R and ESP 2432S028_2USB boards
// --------------------------------------
// use SPI interface
// (default SPI unit provided by <SPI.h>)
// setup SPI pins.
#define SDSPI_CS 5
#define SDSPI_CLK 18
#define SDSPI_MOSI 23
#define SDSPI_MISO 19
#endif

View File

@ -97,8 +97,12 @@ bool SDCard::loadConfigFile(TSettings* Settings)
{
serializeJsonPretty(json, Serial);
Serial.print('\n');
if (json.containsKey(JSON_KEY_SSID)) {
Settings->WifiSSID = json[JSON_KEY_SSID] | Settings->WifiSSID;
}
if (json.containsKey(JSON_KEY_PASW)) {
Settings->WifiPW = json[JSON_KEY_PASW] | Settings->WifiPW;
}
Settings->PoolAddress = json[JSON_KEY_POOLURL] | Settings->PoolAddress;
strcpy(Settings->PoolPassword, json[JSON_KEY_POOLPASS] | Settings->PoolPassword);
strcpy(Settings->BtcWallet, json[JSON_KEY_WALLETID] | Settings->BtcWallet);
@ -108,8 +112,13 @@ bool SDCard::loadConfigFile(TSettings* Settings)
Settings->Timezone = json[JSON_KEY_TIMEZONE].as<int>();
if (json.containsKey(JSON_KEY_STATS2NV))
Settings->saveStats = json[JSON_KEY_STATS2NV].as<bool>();
if (json.containsKey(JSON_KEY_INVCOLOR))
Settings->saveStats = json[JSON_KEY_INVCOLOR].as<bool>();
if (json.containsKey(JSON_KEY_INVCOLOR)) {
Settings->invertColors = json[JSON_KEY_INVCOLOR].as<bool>();
} else {
Settings->invertColors = false;
}
// Serial.printf("Carteira Lida SD:%s\n", Settings.BtcWallet);
Serial.printf("Carteira Lida SDs:%s\n", Settings->BtcWallet);
return true;
}
else