SDCard enabled
This commit is contained in:
parent
1375b5bfa5
commit
6a936da474
@ -7,4 +7,17 @@
|
|||||||
#define LED_PIN 4 // Red pin
|
#define LED_PIN 4 // Red pin
|
||||||
#define LED_PIN_G 16 // Green pin
|
#define LED_PIN_G 16 // Green pin
|
||||||
#define LED_PIN_B 17 // 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
|
#endif
|
@ -97,8 +97,12 @@ bool SDCard::loadConfigFile(TSettings* Settings)
|
|||||||
{
|
{
|
||||||
serializeJsonPretty(json, Serial);
|
serializeJsonPretty(json, Serial);
|
||||||
Serial.print('\n');
|
Serial.print('\n');
|
||||||
Settings->WifiSSID = json[JSON_KEY_SSID] | Settings->WifiSSID;
|
if (json.containsKey(JSON_KEY_SSID)) {
|
||||||
Settings->WifiPW = json[JSON_KEY_PASW] | Settings->WifiPW;
|
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;
|
Settings->PoolAddress = json[JSON_KEY_POOLURL] | Settings->PoolAddress;
|
||||||
strcpy(Settings->PoolPassword, json[JSON_KEY_POOLPASS] | Settings->PoolPassword);
|
strcpy(Settings->PoolPassword, json[JSON_KEY_POOLPASS] | Settings->PoolPassword);
|
||||||
strcpy(Settings->BtcWallet, json[JSON_KEY_WALLETID] | Settings->BtcWallet);
|
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>();
|
Settings->Timezone = json[JSON_KEY_TIMEZONE].as<int>();
|
||||||
if (json.containsKey(JSON_KEY_STATS2NV))
|
if (json.containsKey(JSON_KEY_STATS2NV))
|
||||||
Settings->saveStats = json[JSON_KEY_STATS2NV].as<bool>();
|
Settings->saveStats = json[JSON_KEY_STATS2NV].as<bool>();
|
||||||
if (json.containsKey(JSON_KEY_INVCOLOR))
|
if (json.containsKey(JSON_KEY_INVCOLOR)) {
|
||||||
Settings->saveStats = json[JSON_KEY_INVCOLOR].as<bool>();
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user