Merge 848b7e48fd into db0112e9c2
commit
2612b01ce6
|
|
@ -505,25 +505,32 @@ void System_TaskCaptureAndSendPhoto(void *pvParameters) {
|
||||||
TickType_t xLastWakeTime = xTaskGetTickCount();
|
TickType_t xLastWakeTime = xTaskGetTickCount();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (Connect.CheckSendingIntervalExpired()) {
|
/* Pause periodic snapshots while MJPG stream is active */
|
||||||
Connect.SetSendingIntervalCounter(0);
|
if (SystemCamera.GetStreamStatus()) {
|
||||||
/* send network information to backend */
|
SystemLog.AddEvent(LogLevel_Verbose, F("Photo processing task: stream active, pausing periodic snapshots"));
|
||||||
if ((WL_CONNECTED == WiFi.status()) && (false == FirmwareUpdate.Processing)) {
|
/* do not increase the sending interval counter while streaming */
|
||||||
SystemLog.AddEvent(LogLevel_Verbose, F("Task photo processing. Start sending info"));
|
|
||||||
esp_task_wdt_reset();
|
|
||||||
Connect.SendInfoToBackend();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* send photo to backend*/
|
|
||||||
if ((WL_CONNECTED == WiFi.status()) && (false == FirmwareUpdate.Processing)) {
|
|
||||||
SystemLog.AddEvent(LogLevel_Verbose, F("Task photo processing. Start sending photo"));
|
|
||||||
esp_task_wdt_reset();
|
|
||||||
Connect.TakePictureAndSendToBackend();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* update counter */
|
if (Connect.CheckSendingIntervalExpired()) {
|
||||||
Connect.IncreaseSendingIntervalCounter();
|
Connect.SetSendingIntervalCounter(0);
|
||||||
|
/* send network information to backend */
|
||||||
|
if ((WL_CONNECTED == WiFi.status()) && (false == FirmwareUpdate.Processing)) {
|
||||||
|
SystemLog.AddEvent(LogLevel_Verbose, F("Task photo processing. Start sending info"));
|
||||||
|
esp_task_wdt_reset();
|
||||||
|
Connect.SendInfoToBackend();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* send photo to backend*/
|
||||||
|
if ((WL_CONNECTED == WiFi.status()) && (false == FirmwareUpdate.Processing)) {
|
||||||
|
SystemLog.AddEvent(LogLevel_Verbose, F("Task photo processing. Start sending photo"));
|
||||||
|
esp_task_wdt_reset();
|
||||||
|
Connect.TakePictureAndSendToBackend();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
/* update counter */
|
||||||
|
Connect.IncreaseSendingIntervalCounter();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemLog.AddEvent(LogLevel_Verbose, F("Photo processing task. Stack free size: "), String(uxTaskGetStackHighWaterMark(NULL)) + "B");
|
SystemLog.AddEvent(LogLevel_Verbose, F("Photo processing task. Stack free size: "), String(uxTaskGetStackHighWaterMark(NULL)) + "B");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue