michael vor 1 Jahr
Ursprung
Commit
ebcec97d1d
2 geänderte Dateien mit 52 neuen und 64 gelöschten Zeilen
  1. 48 59
      code/include/defines.h
  2. 4 5
      code/platformio.ini

+ 48 - 59
code/include/defines.h

@@ -63,11 +63,6 @@
     // #define GRAYSCALE_AS_DEFAULT
 
 
-    //ClassControllCamera + ClassFlowTakeImage
-    #define CAMERA_MODEL_AI_THINKER
-    #define BOARD_ESP32CAM_AITHINKER
-
-
     //server_GPIO
     #define __LEDGLOBAL
 
@@ -202,8 +197,24 @@
 ////      Conditionnal definitions       ////
 /////////////////////////////////////////////
 
-//******* camera model 
-#if defined(CAMERA_MODEL_WROVER_KIT)
+
+// ******* Board type   
+#if defined(BOARD_WROVER_KIT) // WROVER-KIT PIN Map
+	// SD card (operated with SDMMC peripheral)
+	//-------------------------------------------------
+	#define GPIO_SDCARD_CLK GPIO_NUM_14
+	#define GPIO_SDCARD_CMD GPIO_NUM_15
+	#define GPIO_SDCARD_D0  GPIO_NUM_2
+	#ifndef __SD_USE_ONE_LINE_MODE__
+		#define GPIO_SDCARD_D1 GPIO_NUM_4
+		#define GPIO_SDCARD_D2 GPIO_NUM_12
+		#define GPIO_SDCARD_D3 GPIO_NUM_13
+	#else
+		#define GPIO_SDCARD_D1 GPIO_NUM_NC
+		#define GPIO_SDCARD_D2 GPIO_NUM_NC
+		#define GPIO_SDCARD_D3 GPIO_NUM_13
+	#endif
+
     #define CAM_PIN_PWDN     GPIO_NUM_NC  //power down is not used
     #define CAM_PIN_RESET    GPIO_NUM_NC  //software reset will be performed
     #define CAM_PIN_XCLK     GPIO_NUM_21
@@ -222,7 +233,14 @@
     #define CAM_PIN_HREF     GPIO_NUM_23
     #define CAM_PIN_PCLK     GPIO_NUM_22
 
-#elif defined(CAMERA_MODEL_M5STACK_PSRAM)
+    //Statusled + ClassControllCamera
+    #define BLINK_GPIO GPIO_NUM_33              // PIN for red board LED, On the board the LED is on the IO2, but it is used for the SD
+	
+    //ClassControllCamera
+    #define FLASH_GPIO GPIO_NUM_12              // PIN for flashlight LED
+    #define USE_PWM_LEDFLASH                    // if __LEDGLOBAL is defined, a global variable is used for LED control, otherwise locally and each time a new
+
+#elif defined(BOARD_M5STACK_PSRAM) // M5STACK PSRAM PIN Map
     #define CAM_PIN_PWDN     GPIO_NUM_NC
     #define CAM_PIN_RESET    GPIO_NUM_15
     #define CAM_PIN_XCLK     GPIO_NUM_27
@@ -241,54 +259,6 @@
     #define CAM_PIN_HREF     GPIO_NUM_26
     #define CAM_PIN_PCLK     GPIO_NUM_21
 
-#elif defined(CAMERA_MODEL_AI_THINKER)
-    #define CAM_PIN_PWDN     GPIO_NUM_32
-    #define CAM_PIN_RESET    GPIO_NUM_NC  //software reset will be performed
-    #define CAM_PIN_XCLK     GPIO_NUM_0
-    #define CAM_PIN_SIOD     GPIO_NUM_26
-    #define CAM_PIN_SIOC     GPIO_NUM_27
-
-    #define CAM_PIN_D7       GPIO_NUM_35
-    #define CAM_PIN_D6       GPIO_NUM_34
-    #define CAM_PIN_D5       GPIO_NUM_39
-    #define CAM_PIN_D4       GPIO_NUM_36
-    #define CAM_PIN_D3       GPIO_NUM_21
-    #define CAM_PIN_D2       GPIO_NUM_19
-    #define CAM_PIN_D1       GPIO_NUM_18
-    #define CAM_PIN_D0       GPIO_NUM_5
-    #define CAM_PIN_VSYNC    GPIO_NUM_25
-    #define CAM_PIN_HREF     GPIO_NUM_23
-    #define CAM_PIN_PCLK     GPIO_NUM_22
-
-#else
-    #error "Camera model not selected"
-#endif  //camera model
-
-// ******* Board type   
-#if defined(BOARD_WROVER_KIT) // WROVER-KIT PIN Map
-	// SD card (operated with SDMMC peripheral)
-	//-------------------------------------------------
-	#define GPIO_SDCARD_CLK GPIO_NUM_14
-	#define GPIO_SDCARD_CMD GPIO_NUM_15
-	#define GPIO_SDCARD_D0 GPIO_NUM_2
-	#ifndef __SD_USE_ONE_LINE_MODE__
-		#define GPIO_SDCARD_D1 GPIO_NUM_4
-		#define GPIO_SDCARD_D2 GPIO_NUM_12
-		#define GPIO_SDCARD_D3 GPIO_NUM_13
-	#else
-		#define GPIO_SDCARD_D1 GPIO_NUM_NC
-		#define GPIO_SDCARD_D2 GPIO_NUM_NC
-		#define GPIO_SDCARD_D3 GPIO_NUM_13
-	#endif
-
-    //Statusled + ClassControllCamera
-    #define BLINK_GPIO GPIO_NUM_33              // PIN for red board LED, On the board the LED is on the IO2, but it is used for the SD
-	
-    //ClassControllCamera
-    #define FLASH_GPIO GPIO_NUM_12              // PIN for flashlight LED
-    #define USE_PWM_LEDFLASH                    // if __LEDGLOBAL is defined, a global variable is used for LED control, otherwise locally and each time a new
-
-#elif defined(BOARD_M5STACK_PSRAM) // M5STACK PSRAM PIN Map
     //Statusled + ClassControllCamera
     #define BLINK_GPIO GPIO_NUM_33              // PIN for red board LED
 	
@@ -302,7 +272,7 @@
 	//-------------------------------------------------
 	#define GPIO_SDCARD_CLK GPIO_NUM_14
 	#define GPIO_SDCARD_CMD GPIO_NUM_15
-	#define GPIO_SDCARD_D0 GPIO_NUM_2
+	#define GPIO_SDCARD_D0  GPIO_NUM_2
 	#ifndef __SD_USE_ONE_LINE_MODE__
 		#define GPIO_SDCARD_D1 GPIO_NUM_4
 		#define GPIO_SDCARD_D2 GPIO_NUM_12
@@ -313,6 +283,24 @@
 		#define GPIO_SDCARD_D3 GPIO_NUM_13
 	#endif
 
+    #define CAM_PIN_PWDN     GPIO_NUM_32
+    #define CAM_PIN_RESET    GPIO_NUM_NC  //software reset will be performed
+    #define CAM_PIN_XCLK     GPIO_NUM_0
+    #define CAM_PIN_SIOD     GPIO_NUM_26
+    #define CAM_PIN_SIOC     GPIO_NUM_27
+
+    #define CAM_PIN_D7       GPIO_NUM_35
+    #define CAM_PIN_D6       GPIO_NUM_34
+    #define CAM_PIN_D5       GPIO_NUM_39
+    #define CAM_PIN_D4       GPIO_NUM_36
+    #define CAM_PIN_D3       GPIO_NUM_21
+    #define CAM_PIN_D2       GPIO_NUM_19
+    #define CAM_PIN_D1       GPIO_NUM_18
+    #define CAM_PIN_D0       GPIO_NUM_5
+    #define CAM_PIN_VSYNC    GPIO_NUM_25
+    #define CAM_PIN_HREF     GPIO_NUM_23
+    #define CAM_PIN_PCLK     GPIO_NUM_22
+
     //Statusled + ClassControllCamera
     #define BLINK_GPIO GPIO_NUM_33              // PIN for red board LED
 	
@@ -320,12 +308,13 @@
     #define FLASH_GPIO GPIO_NUM_4               // PIN for flashlight LED
     #define USE_PWM_LEDFLASH                    // if __LEDGLOBAL is defined, a global variable is used for LED control, otherwise locally and each time a new
 
-#endif // ESP32Cam (AiThinker) PIN Map
+#else
+    #error "Board not selected"
+#endif  //Board PIN Map
 
 
 // ******* LED definition
 #ifdef USE_PWM_LEDFLASH
-
     //// PWM für Flash-LED
     #define LEDC_TIMER              LEDC_TIMER_1 // LEDC_TIMER_0
     #define LEDC_MODE               LEDC_LOW_SPEED_MODE

+ 4 - 5
code/platformio.ini

@@ -30,7 +30,6 @@
         -DUSE_ESP32
         -DUSE_ESP32_FRAMEWORK_ESP_IDF
 
-
 [flags:runtime]
     build_flags = 
         -Wno-nonnull-compare
@@ -47,6 +46,7 @@
         ;-Wshadow-compatible-local
         -fno-exceptions
 
+
 ; The main env - default
 [env:esp32cam]
 extends = common:esp32-idf
@@ -57,14 +57,14 @@ build_flags =
     ${common:esp32-idf.build_flags}
 	${flags:runtime.build_flags}
     ; ### Sofware options : (can be set in defines.h)
+	-D BOARD_ESP32CAM_AITHINKER
 	-D ENABLE_MQTT 
     -D ENABLE_INFLUXDB
     -D ENABLE_WEBHOOK
     -D ENABLE_SOFTAP 
 board_build.partitions = partitions.csv
 monitor_speed = 115200
-monitor_rts = 0
-monitor_dtr = 0
+
 
 ; full standalone dev mode
 ; As sample, the board is nod32s instead of esp32cam (do not change nothing in fact :)
@@ -79,6 +79,7 @@ build_flags =
     ${common:esp32-idf.build_flags}
 	${flags:clangtidy.build_flags}
     ; ### Sofware options : (can be set in defines.h)
+	-D BOARD_ESP32CAM_AITHINKER
 	-D ENABLE_MQTT 
     -D ENABLE_INFLUXDB
     -D ENABLE_WEBHOOK
@@ -124,8 +125,6 @@ platform_packages =
     ;;;;espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
 board_build.partitions = partitions.csv
 monitor_speed = 115200
-monitor_rts = 0
-monitor_dtr = 0
 
 
 ; Activate all debug mode