55#pragma once
66#include "globals.h"
77
8- #if !CONFIG_IDF_TARGET_ESP32S3 && !CONFIG_IDF_TARGET_ESP32
9- #error "Must select ESP32 or ESP32S3 board"
10- #endif
11-
128/**************************************************************************
139 Uncomment one only of the ESP32 or ESP32S3 camera models in the block below
1410 Selecting wrong model may crash your device due to pin conflict
4339//#define CAMERA_MODEL_DFRobot_Romeo_ESP32S3
4440//#define CAMERA_MODEL_XENOIONEX
4541//#define CAMERA_MODEL_Waveshare_ESP32_S3_ETH
42+ //#define CAMERA_MODEL_DFRobot_ESP32_S3_AI_CAM
4643//#define AUXILIARY
44+
45+ // User's ESP32C3 board (auxiliary only)
46+ #elif defined(CONFIG_IDF_TARGET_ESP32C3 )
47+ #define AUXILIARY
48+ #define NO_SD
49+ #endif
50+
51+ #if !defined(CONFIG_IDF_TARGET_ESP32S3 ) && !defined(CONFIG_IDF_TARGET_ESP32 ) && !defined(AUXILIARY )
52+ #error "Must select ESP32 or ESP32S3 board for camera"
4753#endif
4854
55+
4956/***************************************************************
5057 Optional features NOT included by default to reduce heap use
5158 To include a particular feature, change false to true
100107/*********************** Fixed defines leave as is ***********************/
101108/** Do not change anything below here unless you know what you are doing **/
102109
110+ #ifndef AUXILIARY
103111#include "esp_camera.h"
112+ #endif
104113#include "camera_pins.h"
105114
106115#define STATIC_IP_OCTAL "133" // dev only
110119#define DOT_MAX 50
111120#define HOSTNAME_GRP 99
112121
113- #define APP_VER "10.6.1 "
122+ #define APP_VER "10.6.2 "
114123
115124#if defined(AUXILIARY )
116125#define APP_NAME "ESP-CAM_AUX" // max 15 chars
117126#define INDEX_PAGE_PATH DATA_DIR "/Auxil" HTML_EXT
118127#define USE_UARTTASK
119128#elif defined(SIDE_ALARM )
120- #define APP_NAME "ESP-CAM-SIDE " // max 15 chars
129+ #define APP_NAME "ESP-CAM_SIDE " // max 15 chars
121130#define INDEX_PAGE_PATH DATA_DIR "/SideAl" HTML_EXT
122131#define NO_SD
123132#else
@@ -230,7 +239,7 @@ struct fnameStruct {
230239};
231240
232241enum audioAction {NO_ACTION , UPDATE_CONFIG , RECORD_ACTION , PLAY_ACTION , PASS_ACTION , WAV_ACTION , STOP_ACTION };
233-
242+ enum stepperModel { BYJ_48 , BIPOLAR_8mm };
234243// global app specific functions
235244
236245void applyFilters ();
@@ -241,7 +250,6 @@ void buildAviHdr(uint8_t FPS, uint8_t frameType, uint16_t frameCnt, bool isTL =
241250void buildAviIdx (size_t dataSize , bool isVid = true, bool isTL = false);
242251size_t buildSubtitle (int srtSeqNo , uint32_t sampleInterval );
243252void buzzerAlert (bool buzzerOn );
244- bool checkMotion (camera_fb_t * fb , bool motionStatus , bool lightLevelOnly = false);
245253int8_t checkPotVol (int8_t adjVol );
246254bool checkSDFiles ();
247255void currentStackUsage ();
@@ -257,10 +265,8 @@ bool haveWavFile(bool isTL = false);
257265bool identifyBMx ();
258266void intercom ();
259267bool isNight (uint8_t nightSwitch );
260- void keepFrame (camera_fb_t * fb );
261268void micTaskStatus ();
262269void motorSpeed (int speedVal , bool leftMotor = true);
263- void notifyMotion (camera_fb_t * fb );
264270void openSDfile (const char * streamFile );
265271void prepAudio ();
266272void prepAviIndex (bool isTL = false);
@@ -288,7 +294,7 @@ void startHeartbeat();
288294void startSustainTasks ();
289295bool startTelemetry ();
290296void stepperDone ();
291- void stepperRun (float RPM , float revFraction , bool _clockwise );
297+ void stepperRun (float RPM , float revFraction , bool _clockwise , stepperModel thisStepper );
292298void stopPlaying ();
293299void stopSustainTask (int taskId );
294300void stopTelemetry (const char * fileName );
@@ -300,6 +306,12 @@ size_t writeAviIndex(byte* clientBuf, size_t buffSize, bool isTL = false);
300306bool writeUart (uint8_t cmd , uint32_t outputData );
301307size_t writeWavFile (byte * clientBuf , size_t buffSize );
302308
309+ #ifndef CONFIG_IDF_TARGET_ESP32C3
310+ bool checkMotion (camera_fb_t * fb , bool motionStatus , bool lightLevelOnly = false);
311+ void keepFrame (camera_fb_t * fb );
312+ void notifyMotion (camera_fb_t * fb );
313+ #endif
314+
303315/******************** Global app declarations *******************/
304316
305317// motion detection parameters
@@ -332,7 +344,6 @@ extern bool forceRecord; // Recording enabled by rec button
332344extern bool forcePlayback ; // playback enabled by user
333345extern uint8_t FPS ;
334346extern uint8_t fsizePtr ; // index to frameData[] for record
335- extern framesize_t maxFS ;
336347extern bool isCapturing ;
337348extern uint8_t lightLevel ;
338349extern uint8_t lampLevel ;
@@ -357,6 +368,10 @@ extern bool streamSrt;
357368extern uint8_t numStreams ;
358369extern uint8_t vidStreams ;
359370
371+ #ifndef CONFIG_IDF_TARGET_ESP32C3
372+ extern framesize_t maxFS ;
373+ #endif
374+
360375// buffers
361376extern uint8_t iSDbuffer [];
362377extern uint8_t aviHeader [];
0 commit comments