mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-10 07:10:42 +00:00
SPI seems to work simultaniously
This commit is contained in:
parent
ec3bb4dc86
commit
7632203d60
@ -252,30 +252,21 @@ void getLoRa() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void logToSD() {
|
void logToSD() {
|
||||||
#ifdef USE_LORA
|
DBG("Logging to SD card.");
|
||||||
end_lora();
|
DynamicJsonDocument doc(24576);
|
||||||
#endif
|
for (int i = 0; i < ln; i++) {
|
||||||
if(begin_SD()){
|
doc[i]["id"] = theData[i].id;
|
||||||
DBG("Logging to SD card.");
|
doc[i]["type"] = theData[i].t;
|
||||||
DynamicJsonDocument doc(24576);
|
doc[i]["data"] = theData[i].d;
|
||||||
for (int i = 0; i < ln; i++) {
|
|
||||||
doc[i]["id"] = theData[i].id;
|
|
||||||
doc[i]["type"] = theData[i].t;
|
|
||||||
doc[i]["data"] = theData[i].d;
|
|
||||||
}
|
|
||||||
String outgoingString;
|
|
||||||
serializeJson(doc, outgoingString);
|
|
||||||
|
|
||||||
File logfile = SD.open("fdrs_log.txt", FILE_WRITE);
|
|
||||||
logfile.println(outgoingString);
|
|
||||||
logfile.close();
|
|
||||||
|
|
||||||
end_SD();
|
|
||||||
}
|
}
|
||||||
|
String outgoingString;
|
||||||
#ifdef USE_LORA
|
serializeJson(doc, outgoingString);
|
||||||
begin_lora();
|
|
||||||
#endif
|
File logfile = SD.open("fdrs_log.txt", FILE_WRITE);
|
||||||
|
logfile.println(outgoingString);
|
||||||
|
logfile.close();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendESPNOW(uint8_t address) {
|
void sendESPNOW(uint8_t address) {
|
||||||
|
Loading…
Reference in New Issue
Block a user