* Repeatedly takes a one-shot image at a specified cycle and saves it to the * SD card. Saves the captured image to a file whose name consists of the * prefix and timestamp suffix specified by the filename argument. If the * filename argument does not exist, the prefix will be assumed a fixed string * defined by the ESP32CAM_GLOBAL_IDENTIFIER macro directive in ESP32Cam.h. * This function wri
| 539 | * @return ESP_FAIL Any other error occurred. |
| 540 | */ |
| 541 | esp_err_t ESP32Cam::timerShot(const unsigned long period, fs::SDFS& sd, const char* filenamePrefix) { |
| 542 | // Allow one-shot writes even if SD.begin() is not running in the user sketch. |
| 543 | // To do so, it detects the card mount state only once and tries to start the |
| 544 | // SD file system. |
| 545 | if (!_autoMount(MOUNT_SD, reinterpret_cast<fs::FS*>(&sd))) |
| 546 | return ESP_ERR_INVALID_STATE; |
| 547 | _timerShot(period, filenamePrefix); |
| 548 | return ESP_OK; |
| 549 | } |
| 550 | |
| 551 | /** |
| 552 | * Repeatedly takes a one-shot image at a specified cycle and saves it to the |