mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 20:46:52 +03:00
add basic exception handling for the camera module
This commit is contained in:
@@ -143,12 +143,6 @@ extern "C" void app_main(void)
|
|||||||
{
|
{
|
||||||
TickType_t xDelay;
|
TickType_t xDelay;
|
||||||
|
|
||||||
|
|
||||||
printf("Do Reset Camera\n");
|
|
||||||
PowerResetCamera();
|
|
||||||
Camera.InitCam();
|
|
||||||
Camera.LightOnOff(false);
|
|
||||||
|
|
||||||
if (!Init_NVS_SDCard())
|
if (!Init_NVS_SDCard())
|
||||||
{
|
{
|
||||||
xTaskCreate(&task_NoSDBlink, "task_NoSDBlink", configMINIMAL_STACK_SIZE * 64, NULL, tskIDLE_PRIORITY+1, NULL);
|
xTaskCreate(&task_NoSDBlink, "task_NoSDBlink", configMINIMAL_STACK_SIZE * 64, NULL, tskIDLE_PRIORITY+1, NULL);
|
||||||
@@ -215,6 +209,22 @@ extern "C" void app_main(void)
|
|||||||
register_server_main_uri(server, "/sdcard");
|
register_server_main_uri(server, "/sdcard");
|
||||||
|
|
||||||
printf("vor dotautostart\n");
|
printf("vor dotautostart\n");
|
||||||
|
|
||||||
|
// init camera module
|
||||||
|
printf("Do Reset Camera\n");
|
||||||
|
PowerResetCamera();
|
||||||
|
esp_err_t cam = Camera.InitCam();
|
||||||
|
if (cam != ESP_OK) {
|
||||||
|
ESP_LOGE(TAGMAIN, "Failed to initialize camera module. "
|
||||||
|
"Check that your camera module is working and connected properly.");
|
||||||
|
|
||||||
|
LogFile.SwitchOnOff(true);
|
||||||
|
LogFile.WriteToFile("Failed to initialize camera module. "
|
||||||
|
"Check that your camera module is working and connected properly.");
|
||||||
|
LogFile.SwitchOnOff(false);
|
||||||
|
} else {
|
||||||
|
Camera.LightOnOff(false);
|
||||||
TFliteDoAutoStart();
|
TFliteDoAutoStart();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user