From 6f2157f0f649dc17f3ea46045a3b4b5fa96b870c Mon Sep 17 00:00:00 2001 From: ZanzyTHEbar Date: Mon, 12 Dec 2022 23:48:24 +0000 Subject: [PATCH] update - fix ini camera pinout bug, was breaking OTA and WROVER support --- ESP/platformio.ini | 84 +++++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 34 deletions(-) diff --git a/ESP/platformio.ini b/ESP/platformio.ini index 413379f..e4a21ac 100644 --- a/ESP/platformio.ini +++ b/ESP/platformio.ini @@ -46,6 +46,25 @@ VSYNC_GPIO_NUM = 25 HREF_GPIO_NUM = 23 PCLK_GPIO_NUM = 22 +build_flags = + ; CAMERA PINOUT DEFINITIONS + -DPWDN_GPIO_NUM=${pinoutsESPCAM.PWDN_GPIO_NUM} ; Set the PWDN pin + -DRESET_GPIO_NUM=${pinoutsESPCAM.RESET_GPIO_NUM} ; Set the RESET pin + -DXCLK_GPIO_NUM=${pinoutsESPCAM.XCLK_GPIO_NUM} ; Set the XCLK pin + -DSIOD_GPIO_NUM=${pinoutsESPCAM.SIOD_GPIO_NUM} ; Set the SIOD pin + -DSIOC_GPIO_NUM=${pinoutsESPCAM.SIOC_GPIO_NUM} ; Set the SIOC pin + -DY9_GPIO_NUM=${pinoutsESPCAM.Y9_GPIO_NUM} ; Set the Y9 pin + -DY8_GPIO_NUM=${pinoutsESPCAM.Y8_GPIO_NUM} ; Set the Y8 pin + -DY7_GPIO_NUM=${pinoutsESPCAM.Y7_GPIO_NUM} ; Set the Y7 pin + -DY6_GPIO_NUM=${pinoutsESPCAM.Y6_GPIO_NUM} ; Set the Y6 pin + -DY5_GPIO_NUM=${pinoutsESPCAM.Y5_GPIO_NUM} ; Set the Y5 pin + -DY4_GPIO_NUM=${pinoutsESPCAM.Y4_GPIO_NUM} ; Set the Y4 pin + -DY3_GPIO_NUM=${pinoutsESPCAM.Y3_GPIO_NUM} ; Set the Y3 pin + -DY2_GPIO_NUM=${pinoutsESPCAM.Y2_GPIO_NUM} ; Set the Y2 pin + -DVSYNC_GPIO_NUM=${pinoutsESPCAM.VSYNC_GPIO_NUM} ; Set the VSYNC pin + -DHREF_GPIO_NUM=${pinoutsESPCAM.HREF_GPIO_NUM} ; Set the HREF pin + -DPCLK_GPIO_NUM=${pinoutsESPCAM.PCLK_GPIO_NUM} ; Set the PCLK pin + [pinoutsESPWROVER] ; CAMERA_MODEL_WROVER_KIT PWDN_GPIO_NUM = -1 @@ -65,6 +84,25 @@ VSYNC_GPIO_NUM = 25 HREF_GPIO_NUM = 23 PCLK_GPIO_NUM = 22 +build_flags = + ; CAMERA PINOUT DEFINITIONS + -DPWDN_GPIO_NUM=${pinoutsESPWROVER.PWDN_GPIO_NUM} ; Set the PWDN pin + -DRESET_GPIO_NUM=${pinoutsESPWROVER.RESET_GPIO_NUM} ; Set the RESET pin + -DXCLK_GPIO_NUM=${pinoutsESPWROVER.XCLK_GPIO_NUM} ; Set the XCLK pin + -DSIOD_GPIO_NUM=${pinoutsESPWROVER.SIOD_GPIO_NUM} ; Set the SIOD pin + -DSIOC_GPIO_NUM=${pinoutsESPWROVER.SIOC_GPIO_NUM} ; Set the SIOC pin + -DY9_GPIO_NUM=${pinoutsESPWROVER.Y9_GPIO_NUM} ; Set the Y9 pin + -DY8_GPIO_NUM=${pinoutsESPWROVER.Y8_GPIO_NUM} ; Set the Y8 pin + -DY7_GPIO_NUM=${pinoutsESPWROVER.Y7_GPIO_NUM} ; Set the Y7 pin + -DY6_GPIO_NUM=${pinoutsESPWROVER.Y6_GPIO_NUM} ; Set the Y6 pin + -DY5_GPIO_NUM=${pinoutsESPWROVER.Y5_GPIO_NUM} ; Set the Y5 pin + -DY4_GPIO_NUM=${pinoutsESPWROVER.Y4_GPIO_NUM} ; Set the Y4 pin + -DY3_GPIO_NUM=${pinoutsESPWROVER.Y3_GPIO_NUM} ; Set the Y3 pin + -DY2_GPIO_NUM=${pinoutsESPWROVER.Y2_GPIO_NUM} ; Set the Y2 pin + -DVSYNC_GPIO_NUM=${pinoutsESPWROVER.VSYNC_GPIO_NUM} ; Set the VSYNC pin + -DHREF_GPIO_NUM=${pinoutsESPWROVER.HREF_GPIO_NUM} ; Set the HREF pin + -DPCLK_GPIO_NUM=${pinoutsESPWROVER.PCLK_GPIO_NUM} ; Set the PCLK pin + [common] platform = espressif32 framework = arduino @@ -101,23 +139,6 @@ build_flags = -DBOARD_HAS_PSRAM ; enable psram -DASYNCWEBSERVER_REGEX ; enable regex in asyncwebserver -mfix-esp32-psram-cache-issue ; fix for psram - ; CAMERA PINOUT DEFINITIONS - -DPWDN_GPIO_NUM=${pinoutsESPCAM.PWDN_GPIO_NUM} ; Set the PWDN pin - -DRESET_GPIO_NUM=${pinoutsESPCAM.RESET_GPIO_NUM} ; Set the RESET pin - -DXCLK_GPIO_NUM=${pinoutsESPCAM.XCLK_GPIO_NUM} ; Set the XCLK pin - -DSIOD_GPIO_NUM=${pinoutsESPCAM.SIOD_GPIO_NUM} ; Set the SIOD pin - -DSIOC_GPIO_NUM=${pinoutsESPCAM.SIOC_GPIO_NUM} ; Set the SIOC pin - -DY9_GPIO_NUM=${pinoutsESPCAM.Y9_GPIO_NUM} ; Set the Y9 pin - -DY8_GPIO_NUM=${pinoutsESPCAM.Y8_GPIO_NUM} ; Set the Y8 pin - -DY7_GPIO_NUM=${pinoutsESPCAM.Y7_GPIO_NUM} ; Set the Y7 pin - -DY6_GPIO_NUM=${pinoutsESPCAM.Y6_GPIO_NUM} ; Set the Y6 pin - -DY5_GPIO_NUM=${pinoutsESPCAM.Y5_GPIO_NUM} ; Set the Y5 pin - -DY4_GPIO_NUM=${pinoutsESPCAM.Y4_GPIO_NUM} ; Set the Y4 pin - -DY3_GPIO_NUM=${pinoutsESPCAM.Y3_GPIO_NUM} ; Set the Y3 pin - -DY2_GPIO_NUM=${pinoutsESPCAM.Y2_GPIO_NUM} ; Set the Y2 pin - -DVSYNC_GPIO_NUM=${pinoutsESPCAM.VSYNC_GPIO_NUM} ; Set the VSYNC pin - -DHREF_GPIO_NUM=${pinoutsESPCAM.HREF_GPIO_NUM} ; Set the HREF pin - -DPCLK_GPIO_NUM=${pinoutsESPCAM.PCLK_GPIO_NUM} ; Set the PCLK pin ;build_unflags = -Os ; disable optimization for size lib_ldf_mode = deep+ @@ -150,6 +171,8 @@ build_type = ${common.build_type} extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} -DDEBUG_MODE=1 ; Set the debug mode + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESPCAM.build_flags} [env:esp32Cam_release] platform = ${common.platform} @@ -168,6 +191,8 @@ extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} -DDEBUG_MODE=0 ; Set the debug mode -DCORE_DEBUG_LEVEL=1 + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESPCAM.build_flags} ; Experimental OTA Environment - do not select unless you know what you are doing [env:esp32Cam_OTA] @@ -178,6 +203,9 @@ build_flags = ${common.build_flags} -DDEBUG_MODE=0 ; Set the debug mode -DCORE_DEBUG_LEVEL=1 -DDEBUG_ESP_OTA + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESPCAM.build_flags} + lib_deps = ${common.lib_deps} upload_speed = ${common.upload_speed} monitor_speed = ${common.monitor_speed} @@ -215,23 +243,7 @@ extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} -DDEBUG_MODE=1 ; Set the debug mode ; CAMERA PINOUT DEFINITIONS - -DPWDN_GPIO_NUM=${pinoutsESPWROVER.PWDN_GPIO_NUM} ; Set the PWDN pin - -DRESET_GPIO_NUM=${pinoutsESPWROVER.RESET_GPIO_NUM} ; Set the RESET pin - -DXCLK_GPIO_NUM=${pinoutsESPWROVER.XCLK_GPIO_NUM} ; Set the XCLK pin - -DSIOD_GPIO_NUM=${pinoutsESPWROVER.SIOD_GPIO_NUM} ; Set the SIOD pin - -DSIOC_GPIO_NUM=${pinoutsESPWROVER.SIOC_GPIO_NUM} ; Set the SIOC pin - -DY9_GPIO_NUM=${pinoutsESPWROVER.Y9_GPIO_NUM} ; Set the Y9 pin - -DY8_GPIO_NUM=${pinoutsESPWROVER.Y8_GPIO_NUM} ; Set the Y8 pin - -DY7_GPIO_NUM=${pinoutsESPWROVER.Y7_GPIO_NUM} ; Set the Y7 pin - -DY6_GPIO_NUM=${pinoutsESPWROVER.Y6_GPIO_NUM} ; Set the Y6 pin - -DY5_GPIO_NUM=${pinoutsESPWROVER.Y5_GPIO_NUM} ; Set the Y5 pin - -DY4_GPIO_NUM=${pinoutsESPWROVER.Y4_GPIO_NUM} ; Set the Y4 pin - -DY3_GPIO_NUM=${pinoutsESPWROVER.Y3_GPIO_NUM} ; Set the Y3 pin - -DY2_GPIO_NUM=${pinoutsESPWROVER.Y2_GPIO_NUM} ; Set the Y2 pin - -DVSYNC_GPIO_NUM=${pinoutsESPWROVER.VSYNC_GPIO_NUM} ; Set the VSYNC pin - -DHREF_GPIO_NUM=${pinoutsESPWROVER.HREF_GPIO_NUM} ; Set the HREF pin - -DPCLK_GPIO_NUM=${pinoutsESPWROVER.PCLK_GPIO_NUM} ; Set the PCLK pin - + ${pinoutsESPWROVER.build_flags} [env:wrover_release] platform = ${common.platform} board = esp-wrover-kit @@ -253,6 +265,8 @@ extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} -DDEBUG_MODE=0 ; Set the debug mode -DCORE_DEBUG_LEVEL=1 + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESPWROVER.build_flags} ; Experimental OTA Environment - do not select unless you know what you are doing [env:wrover_OTA] @@ -277,6 +291,8 @@ build_flags = ${common.build_flags} -DDEBUG_MODE=0 ; Set the debug mode -DCORE_DEBUG_LEVEL=1 -DDEBUG_ESP_OTA + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESPWROVER.build_flags} upload_port = 192.168.1.38 upload_protocol = espota upload_flags =