The field version of the solarnano grid on the ionQubes
Fork of SolarNanoGridv3 by
Diff: Battery/Battery.cpp
- Revision:
- 32:f586ce639168
- Parent:
- 31:3bf76548e024
- Child:
- 33:77d979225f45
--- a/Battery/Battery.cpp Thu Jun 23 13:45:12 2016 +0000 +++ b/Battery/Battery.cpp Thu Jul 21 11:14:14 2016 +0000 @@ -448,9 +448,10 @@ flagSendFileDone = 0; sendFileDone(); INFO("File sent <%s>",txFileName); - flag = &flagNextFile; - delay->detach(); - delay->attach(this, &Battery::setFlag, 2.5); + //flag = &flagNextFile; + //delay->detach(); + //delay->attach(this, &Battery::setFlag, 2.5); + flagNextFile = 1; } if (flagCheckOut) { flagCheckOut=0; @@ -633,27 +634,26 @@ } + /** * Update the last file sent file */ void Battery::sendFileDone() { - DBG("Send File Done. Writing to lastFileTx.txt..."); - if (strlen(txFileName)>0) { - spiSD(); - FILE *fp = fopen("/sd/lastFileTx.txt", "w"); - if (fp != NULL) { - spiSD(); - fprintf(fp, "%s %u \n", txFileName, fileLength); - spiSD(); - fclose(fp); - DBG("sendFileDone> updated lastFileTx.txt %s %u ", txFileName, fileLength); - } else { - INFO("sendFileDone> Cannot update file lastFiletx.txt"); - } - spiNRF(); + int check; + if (strlen(txFileName)>0) { + spiSD(); + FILE *fp = fopen("/sd/lastFileTx.txt", "w"); + if (fp != NULL) { + check = fprintf(fp, "%s %u \n", txFileName, fileLength); + fclose(fp); + DBG("sendFileDone> updated lastFileTx.txt %s %u chk = %d", txFileName, fileLength, check); + } else { + INFO("sendFileDone> Cannot update file lastFiletx.txt"); + } + spiNRF(); - } + } }