Преглед изворни кода

#ifndef in *.h + #pragma once (#1639)

Nicolas Liaudat пре 3 година
родитељ
комит
fc5fbd648e
37 измењених фајлова са 188 додато и 288 уклоњено
  1. 8 1
      code/components/jomjol_configfile/configFile.h
  2. 5 0
      code/components/jomjol_controlGPIO/Color.h
  3. 5 0
      code/components/jomjol_controlGPIO/SmartLeds.h
  4. 2 0
      code/components/jomjol_controlGPIO/server_GPIO.h
  5. 2 0
      code/components/jomjol_controlcamera/ClassControllCamera.h
  6. 2 0
      code/components/jomjol_controlcamera/img_converters.h
  7. 0 245
      code/components/jomjol_controlcamera/sensor_old.h
  8. 2 0
      code/components/jomjol_controlcamera/server_camera.h
  9. 6 0
      code/components/jomjol_fileserver_ota/server_file.h
  10. 8 1
      code/components/jomjol_fileserver_ota/server_help.h
  11. 8 1
      code/components/jomjol_fileserver_ota/server_ota.h
  12. 4 0
      code/components/jomjol_flowcontroll/ClassFlow.h
  13. 5 0
      code/components/jomjol_flowcontroll/ClassFlowAlignment.h
  14. 4 2
      code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.h
  15. 3 3
      code/components/jomjol_flowcontroll/ClassFlowControll.h
  16. 4 2
      code/components/jomjol_flowcontroll/ClassFlowDefineTypes.h
  17. 6 0
      code/components/jomjol_flowcontroll/ClassFlowImage.h
  18. 6 0
      code/components/jomjol_flowcontroll/ClassFlowInfluxDB.h
  19. 6 1
      code/components/jomjol_flowcontroll/ClassFlowMQTT.h
  20. 5 0
      code/components/jomjol_flowcontroll/ClassFlowMakeImage.h
  21. 5 3
      code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h
  22. 5 0
      code/components/jomjol_flowcontroll/ClassFlowWriteList.h
  23. 6 0
      code/components/jomjol_helper/Helper.h
  24. 6 0
      code/components/jomjol_image_proc/CAlignAndCutImage.h
  25. 5 3
      code/components/jomjol_image_proc/CFindTemplate.h
  26. 3 3
      code/components/jomjol_image_proc/CImageBasis.h
  27. 7 0
      code/components/jomjol_image_proc/CRotateImage.h
  28. 2 0
      code/components/jomjol_influxdb/interface_influxdb.h
  29. 8 1
      code/components/jomjol_logfile/ClassLogFile.h
  30. 3 0
      code/components/jomjol_mqtt/interface_mqtt.h
  31. 7 0
      code/components/jomjol_mqtt/server_mqtt.h
  32. 4 7
      code/components/jomjol_tfliteclass/CTfLiteClass.h
  33. 7 0
      code/components/jomjol_tfliteclass/server_tflite.h
  34. 9 1
      code/components/jomjol_time_sntp/time_sntp.h
  35. 3 1
      code/components/jomjol_wlan/connect_wlan.h
  36. 3 1
      code/components/jomjol_wlan/read_wlanini.h
  37. 14 12
      code/main/main.cpp

+ 8 - 1
code/components/jomjol_configfile/configFile.h

@@ -1,3 +1,8 @@
+#pragma once
+
+#ifndef CONFIGFILE_H
+#define CONFIGFILE_H
+
 #include <string>
 #include <vector>
 
@@ -12,4 +17,6 @@ public:
     
 private:
     FILE* pFile;
-};
+};
+
+#endif //CONFIGFILE_H

+ 5 - 0
code/components/jomjol_controlGPIO/Color.h

@@ -1,5 +1,8 @@
 #pragma once
 
+#ifndef COLOR_H
+#define COLOR_H
+
 #include <cstdint>
 #include "esp_attr.h"
 union Hsv;
@@ -67,3 +70,5 @@ union Hsv {
     bool operator==( Hsv in ) const { return in.value == value; }
     void swap( Hsv& o ) { value = o.value; }
 };
+
+#endif //COLOR_H

+ 5 - 0
code/components/jomjol_controlGPIO/SmartLeds.h

@@ -1,5 +1,8 @@
 #pragma once
 
+#ifndef SMARTLEDS_H
+#define SMARTLEDS_H
+
 /*
  * A C++ driver for the WS2812 LEDs using the RMT peripheral on the ESP32.
  *
@@ -528,3 +531,5 @@ private:
     int _latchFrames;
     uint8_t _latchBuffer[ LATCH_FRAME_SIZE_BYTES ];
 };
+
+#endif //SMARTLEDS_H

+ 2 - 0
code/components/jomjol_controlGPIO/server_GPIO.h

@@ -1,3 +1,5 @@
+#pragma once
+
 #ifndef SERVER_GPIO_H
 #define SERVER_GPIO_H
 

+ 2 - 0
code/components/jomjol_controlcamera/ClassControllCamera.h

@@ -1,3 +1,5 @@
+#pragma once
+
 #ifndef CLASSCONTROLLCAMERA_H
 #define CLASSCONTROLLCAMERA_H
 

+ 2 - 0
code/components/jomjol_controlcamera/img_converters.h

@@ -11,6 +11,8 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
+#pragma once
+
 #ifndef _IMG_CONVERTERS_H_
 #define _IMG_CONVERTERS_H_
 

+ 0 - 245
code/components/jomjol_controlcamera/sensor_old.h

@@ -1,245 +0,0 @@
-/*
- * This file is part of the OpenMV project.
- * Copyright (c) 2013/2014 Ibrahim Abdelkader <i.abdalkader@gmail.com>
- * This work is licensed under the MIT license, see the file LICENSE for details.
- *
- * Sensor abstraction layer.
- *
- */
-#ifndef __SENSOR_H__
-#define __SENSOR_H__
-#include <stdint.h>
-#include <stdbool.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
-    OV9650_PID = 0x96,
-    OV7725_PID = 0x77,
-    OV2640_PID = 0x26,
-    OV3660_PID = 0x3660,
-    OV5640_PID = 0x5640,
-    OV7670_PID = 0x76,
-    NT99141_PID = 0x1410,
-    GC2145_PID = 0x2145,
-    GC032A_PID = 0x232a,
-    GC0308_PID = 0x9b,
-} camera_pid_t;
-
-typedef enum {
-    CAMERA_OV7725,
-    CAMERA_OV2640,
-    CAMERA_OV3660,
-    CAMERA_OV5640,
-    CAMERA_OV7670,
-    CAMERA_NT99141,
-    CAMERA_GC2145,
-    CAMERA_GC032A,
-    CAMERA_GC0308,
-    CAMERA_MODEL_MAX,
-    CAMERA_NONE,
-} camera_model_t;
-
-typedef enum {
-    OV2640_SCCB_ADDR   = 0x30,// 0x60 >> 1
-    OV5640_SCCB_ADDR   = 0x3C,// 0x78 >> 1
-    OV3660_SCCB_ADDR   = 0x3C,// 0x78 >> 1
-    OV7725_SCCB_ADDR   = 0x21,// 0x42 >> 1
-    OV7670_SCCB_ADDR   = 0x21,// 0x42 >> 1
-    NT99141_SCCB_ADDR  = 0x2A,// 0x54 >> 1
-    GC2145_SCCB_ADDR   = 0x3C,// 0x78 >> 1
-    GC032A_SCCB_ADDR   = 0x21,// 0x42 >> 1
-    GC0308_SCCB_ADDR   = 0x21,// 0x42 >> 1
-} camera_sccb_addr_t;
-
-typedef enum {
-    PIXFORMAT_RGB565,    // 2BPP/RGB565
-    PIXFORMAT_YUV422,    // 2BPP/YUV422
-    PIXFORMAT_GRAYSCALE, // 1BPP/GRAYSCALE
-    PIXFORMAT_JPEG,      // JPEG/COMPRESSED
-    PIXFORMAT_RGB888,    // 3BPP/RGB888
-    PIXFORMAT_RAW,       // RAW
-    PIXFORMAT_RGB444,    // 3BP2P/RGB444
-    PIXFORMAT_RGB555,    // 3BP2P/RGB555
-} pixformat_t;
-
-typedef enum {
-    FRAMESIZE_96X96,    // 96x96
-    FRAMESIZE_QQVGA,    // 160x120
-    FRAMESIZE_QCIF,     // 176x144
-    FRAMESIZE_HQVGA,    // 240x176
-    FRAMESIZE_240X240,  // 240x240
-    FRAMESIZE_QVGA,     // 320x240
-    FRAMESIZE_CIF,      // 400x296
-    FRAMESIZE_HVGA,     // 480x320
-    FRAMESIZE_VGA,      // 640x480
-    FRAMESIZE_SVGA,     // 800x600
-    FRAMESIZE_XGA,      // 1024x768
-    FRAMESIZE_HD,       // 1280x720
-    FRAMESIZE_SXGA,     // 1280x1024
-    FRAMESIZE_UXGA,     // 1600x1200
-    // 3MP Sensors
-    FRAMESIZE_FHD,      // 1920x1080
-    FRAMESIZE_P_HD,     //  720x1280
-    FRAMESIZE_P_3MP,    //  864x1536
-    FRAMESIZE_QXGA,     // 2048x1536
-    // 5MP Sensors
-    FRAMESIZE_QHD,      // 2560x1440
-    FRAMESIZE_WQXGA,    // 2560x1600
-    FRAMESIZE_P_FHD,    // 1080x1920
-    FRAMESIZE_QSXGA,    // 2560x1920
-    FRAMESIZE_INVALID
-} framesize_t;
-
-typedef struct {
-    const camera_model_t model;
-    const char *name;
-    const camera_sccb_addr_t sccb_addr;
-    const camera_pid_t pid;
-    const framesize_t max_size;
-    const bool support_jpeg;
-} camera_sensor_info_t;
-
-typedef enum {
-    ASPECT_RATIO_4X3,
-    ASPECT_RATIO_3X2,
-    ASPECT_RATIO_16X10,
-    ASPECT_RATIO_5X3,
-    ASPECT_RATIO_16X9,
-    ASPECT_RATIO_21X9,
-    ASPECT_RATIO_5X4,
-    ASPECT_RATIO_1X1,
-    ASPECT_RATIO_9X16
-} aspect_ratio_t;
-
-typedef enum {
-    GAINCEILING_2X,
-    GAINCEILING_4X,
-    GAINCEILING_8X,
-    GAINCEILING_16X,
-    GAINCEILING_32X,
-    GAINCEILING_64X,
-    GAINCEILING_128X,
-} gainceiling_t;
-
-typedef struct {
-        uint16_t max_width;
-        uint16_t max_height;
-        uint16_t start_x;
-        uint16_t start_y;
-        uint16_t end_x;
-        uint16_t end_y;
-        uint16_t offset_x;
-        uint16_t offset_y;
-        uint16_t total_x;
-        uint16_t total_y;
-} ratio_settings_t;
-
-typedef struct {
-        const uint16_t width;
-        const uint16_t height;
-        const aspect_ratio_t aspect_ratio;
-} resolution_info_t;
-
-// Resolution table (in sensor.c)
-extern const resolution_info_t resolution[];
-// camera sensor table (in sensor.c)
-extern const camera_sensor_info_t camera_sensor[];
-
-typedef struct {
-    uint8_t MIDH;
-    uint8_t MIDL;
-    uint16_t PID;
-    uint8_t VER;
-} sensor_id_t;
-
-typedef struct {
-    framesize_t framesize;//0 - 10
-    bool scale;
-    bool binning;
-    uint8_t quality;//0 - 63
-    int8_t brightness;//-2 - 2
-    int8_t contrast;//-2 - 2
-    int8_t saturation;//-2 - 2
-    int8_t sharpness;//-2 - 2
-    uint8_t denoise;
-    uint8_t special_effect;//0 - 6
-    uint8_t wb_mode;//0 - 4
-    uint8_t awb;
-    uint8_t awb_gain;
-    uint8_t aec;
-    uint8_t aec2;
-    int8_t ae_level;//-2 - 2
-    uint16_t aec_value;//0 - 1200
-    uint8_t agc;
-    uint8_t agc_gain;//0 - 30
-    uint8_t gainceiling;//0 - 6
-    uint8_t bpc;
-    uint8_t wpc;
-    uint8_t raw_gma;
-    uint8_t lenc;
-    uint8_t hmirror;
-    uint8_t vflip;
-    uint8_t dcw;
-    uint8_t colorbar;
-} camera_status_t;
-
-typedef struct _sensor sensor_t;
-typedef struct _sensor {
-    sensor_id_t id;             // Sensor ID.
-    uint8_t  slv_addr;          // Sensor I2C slave address.
-    pixformat_t pixformat;
-    camera_status_t status;
-    int xclk_freq_hz;
-
-    // Sensor function pointers
-    int  (*init_status)         (sensor_t *sensor);
-    int  (*reset)               (sensor_t *sensor);
-    int  (*set_pixformat)       (sensor_t *sensor, pixformat_t pixformat);
-    int  (*set_framesize)       (sensor_t *sensor, framesize_t framesize);
-    int  (*set_contrast)        (sensor_t *sensor, int level);
-    int  (*set_brightness)      (sensor_t *sensor, int level);
-    int  (*set_saturation)      (sensor_t *sensor, int level);
-    int  (*set_sharpness)       (sensor_t *sensor, int level);
-    int  (*set_denoise)         (sensor_t *sensor, int level);
-    int  (*set_gainceiling)     (sensor_t *sensor, gainceiling_t gainceiling);
-    int  (*set_quality)         (sensor_t *sensor, int quality);
-    int  (*set_colorbar)        (sensor_t *sensor, int enable);
-    int  (*set_whitebal)        (sensor_t *sensor, int enable);
-    int  (*set_gain_ctrl)       (sensor_t *sensor, int enable);
-    int  (*set_exposure_ctrl)   (sensor_t *sensor, int enable);
-    int  (*set_hmirror)         (sensor_t *sensor, int enable);
-    int  (*set_vflip)           (sensor_t *sensor, int enable);
-
-    int  (*set_aec2)            (sensor_t *sensor, int enable);
-    int  (*set_awb_gain)        (sensor_t *sensor, int enable);
-    int  (*set_agc_gain)        (sensor_t *sensor, int gain);
-    int  (*set_aec_value)       (sensor_t *sensor, int gain);
-
-    int  (*set_special_effect)  (sensor_t *sensor, int effect);
-    int  (*set_wb_mode)         (sensor_t *sensor, int mode);
-    int  (*set_ae_level)        (sensor_t *sensor, int level);
-
-    int  (*set_dcw)             (sensor_t *sensor, int enable);
-    int  (*set_bpc)             (sensor_t *sensor, int enable);
-    int  (*set_wpc)             (sensor_t *sensor, int enable);
-
-    int  (*set_raw_gma)         (sensor_t *sensor, int enable);
-    int  (*set_lenc)            (sensor_t *sensor, int enable);
-
-    int  (*get_reg)             (sensor_t *sensor, int reg, int mask);
-    int  (*set_reg)             (sensor_t *sensor, int reg, int mask, int value);
-    int  (*set_res_raw)         (sensor_t *sensor, int startX, int startY, int endX, int endY, int offsetX, int offsetY, int totalX, int totalY, int outputX, int outputY, bool scale, bool binning);
-    int  (*set_pll)             (sensor_t *sensor, int bypass, int mul, int sys, int root, int pre, int seld5, int pclken, int pclk);
-    int  (*set_xclk)            (sensor_t *sensor, int timer, int xclk);
-} sensor_t;
-
-camera_sensor_info_t *esp_camera_sensor_get_info(sensor_id_t *id);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __SENSOR_H__ */

+ 2 - 0
code/components/jomjol_controlcamera/server_camera.h

@@ -1,3 +1,5 @@
+#pragma once
+
 #ifndef JOMJOL_CONTROLCAMERA_H
 #define JOMJOL_CONTROLCAMERA_H
 

+ 6 - 0
code/components/jomjol_fileserver_ota/server_file.h

@@ -1,3 +1,8 @@
+#pragma once
+
+#ifndef SERVERFILE_H
+#define SERVERFILE_H
+
 #include <esp_http_server.h>
 #include <string>
 
@@ -13,3 +18,4 @@ esp_err_t get_tflite_file_handler(httpd_req_t *req);
 esp_err_t get_data_file_handler(httpd_req_t *req);
 esp_err_t get_numbers_file_handler(httpd_req_t *req);
 
+#endif //SERVERFILE_H

+ 8 - 1
code/components/jomjol_fileserver_ota/server_help.h

@@ -1,3 +1,8 @@
+#pragma once
+
+#ifndef SERVERHELP_H
+#define SERVERHELP_H
+
 #include <string>
 //#include <sys/param.h>
 #include "esp_http_server.h"
@@ -7,4 +12,6 @@ const char* get_path_from_uri(char *dest, const char *base_path, const char *uri
 
 esp_err_t send_file(httpd_req_t *req, std::string filename);
 
-esp_err_t set_content_type_from_file(httpd_req_t *req, const char *filename);
+esp_err_t set_content_type_from_file(httpd_req_t *req, const char *filename);
+
+#endif //SERVERHELP_H

+ 8 - 1
code/components/jomjol_fileserver_ota/server_ota.h

@@ -1,3 +1,8 @@
+#pragma once
+
+#ifndef SERVEROTA_H
+#define SERVEROTA_H
+
 #include <esp_log.h>
 
 #include <esp_http_server.h>
@@ -10,4 +15,6 @@ void CheckOTAUpdate();
 void doReboot();
 void hard_restart();
 void CheckUpdate();
-static bool ota_update_task(std::string fn);
+static bool ota_update_task(std::string fn);
+
+#endif //SERVEROTA_H

+ 4 - 0
code/components/jomjol_flowcontroll/ClassFlow.h

@@ -1,5 +1,8 @@
 #pragma once
 
+#ifndef CLASSFLOW_H
+#define CLASSFLOW_H
+
 #include <fstream>
 #include <string>
 #include <vector>
@@ -48,3 +51,4 @@ public:
 
 };
 
+#endif //CLASSFLOW_H

+ 5 - 0
code/components/jomjol_flowcontroll/ClassFlowAlignment.h

@@ -1,5 +1,8 @@
 #pragma once
 
+#ifndef CLASSFLOWALIGNMENT_H
+#define CLASSFLOWALIGNMENT_H
+
 #include "ClassFlow.h"
 #include "Helper.h"
 #include "CAlignAndCutImage.h"
@@ -44,3 +47,5 @@ public:
     string name(){return "ClassFlowAlignment";};
 };
 
+
+#endif //CLASSFLOWALIGNMENT_H

+ 4 - 2
code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.h

@@ -1,5 +1,7 @@
-#ifndef __CLASSCNNGENERAL__
-#define __CLASSCNNGENERAL__
+#pragma once
+
+#ifndef CLASSFLOWCNNGENERAL_H
+#define CLASSFLOWCNNGENERAL_H
 
 #include"ClassFlowDefineTypes.h"
 #include "ClassFlowAlignment.h"

+ 3 - 3
code/components/jomjol_flowcontroll/ClassFlowControll.h

@@ -1,7 +1,7 @@
+#pragma once
 
-
-#ifndef __FLOWCONTROLL__
-#define __FLOWCONTROLL__
+#ifndef CLASSFLOWCONTROLL_H
+#define CLASSFLOWCONTROLL_H
 
 #include <string>
 

+ 4 - 2
code/components/jomjol_flowcontroll/ClassFlowDefineTypes.h

@@ -1,5 +1,7 @@
-#ifndef __CLASSFLOWIMAGE_CLASS__
-#define __CLASSFLOWIMAGE_CLASS__
+#pragma once
+
+#ifndef CLASSFLOWDEFINETYPES_H
+#define CLASSFLOWDEFINETYPES_H
 
 #include "ClassFlowImage.h"
 

+ 6 - 0
code/components/jomjol_flowcontroll/ClassFlowImage.h

@@ -1,4 +1,8 @@
 #pragma once
+
+#ifndef CLASSFLOWIMAGE_H
+#define CLASSFLOWIMAGE_H
+
 #include "ClassFlow.h"
 
 using namespace std;
@@ -22,3 +26,5 @@ public:
 	
 	void RemoveOldLogs();
 };
+
+#endif //CLASSFLOWIMAGE_H

+ 6 - 0
code/components/jomjol_flowcontroll/ClassFlowInfluxDB.h

@@ -1,5 +1,10 @@
 #ifdef ENABLE_INFLUXDB
+
 #pragma once
+
+#ifndef CLASSFINFLUXDB_H
+#define CLASSFINFLUXDB_H
+
 #include "ClassFlow.h"
 
 #include "ClassFlowPostProcessing.h"
@@ -30,4 +35,5 @@ public:
     string name(){return "ClassFlowInfluxDB";};
 };
 
+#endif //CLASSFINFLUXDB_H
 #endif //ENABLE_INFLUXDB

+ 6 - 1
code/components/jomjol_flowcontroll/ClassFlowMQTT.h

@@ -1,5 +1,10 @@
 #ifdef ENABLE_MQTT
+
 #pragma once
+
+#ifndef CLASSFFLOWMQTT_H
+#define CLASSFFLOWMQTT_H
+
 #include "ClassFlow.h"
 
 #include "ClassFlowPostProcessing.h"
@@ -33,5 +38,5 @@ public:
     bool doFlow(string time);
     string name(){return "ClassFlowMQTT";};
 };
-
+#endif //CLASSFFLOWMQTT_H
 #endif //ENABLE_MQTT

+ 5 - 0
code/components/jomjol_flowcontroll/ClassFlowMakeImage.h

@@ -1,4 +1,8 @@
 #pragma once
+
+#ifndef CLASSFFLOWMAKEIMAGE_H
+#define CLASSFFLOWMAKEIMAGE_H
+
 #include "ClassFlowImage.h"
 #include "ClassControllCamera.h"
 #include "../../include/defines.h"
@@ -48,3 +52,4 @@ public:
 };
 
 
+#endif //CLASSFFLOWMAKEIMAGE_H

+ 5 - 3
code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h

@@ -1,5 +1,7 @@
-#ifndef __FLOWPOSTPROCESSING__
-#define __FLOWPOSTPROCESSING__
+#pragma once
+
+#ifndef CLASSFFLOWPOSTPROCESSING_H
+#define CLASSFFLOWPOSTPROCESSING_H
 
 #include "ClassFlow.h"
 #include "ClassFlowMakeImage.h"
@@ -76,4 +78,4 @@ public:
 };
 
 
-#endif
+#endif //CLASSFFLOWPOSTPROCESSING_H

+ 5 - 0
code/components/jomjol_flowcontroll/ClassFlowWriteList.h

@@ -1,4 +1,8 @@
 #pragma once
+
+#ifndef CLASSFFLOWPWRITELIST_H
+#define CLASSFFLOWPWRITELIST_H
+
 #include "ClassFlow.h"
 #include "ClassFlowPostProcessing.h"
 
@@ -20,3 +24,4 @@ public:
     string name(){return "ClassFlowWriteList";};
 };
 
+#endif //CLASSFFLOWPWRITELIST_H

+ 6 - 0
code/components/jomjol_helper/Helper.h

@@ -1,4 +1,8 @@
 #pragma once
+
+#ifndef HELPER_H
+#define HELPER_H
+
 #include <string>
 #include <fstream>
 #include <vector>
@@ -88,3 +92,5 @@ string getResetReason(void);
 std::string getFormatedUptime(bool compact);
 
 const char* get404(void);
+
+#endif //HELPER_H

+ 6 - 0
code/components/jomjol_image_proc/CAlignAndCutImage.h

@@ -1,3 +1,8 @@
+#pragma once
+
+#ifndef CALIGNANDCUTIMAGE_H
+#define CALIGNANDCUTIMAGE_H
+
 #include "CImageBasis.h"
 #include "CFindTemplate.h"
 
@@ -19,3 +24,4 @@ class CAlignAndCutImage : public CImageBasis
         void GetRefSize(int *ref_dx, int *ref_dy);
 };
 
+#endif //CALIGNANDCUTIMAGE_H

+ 5 - 3
code/components/jomjol_image_proc/CFindTemplate.h

@@ -1,5 +1,7 @@
-#ifndef __CFINDTEMPLATE_CLASS
-#define __CFINDTEMPLATE_CLASS
+#pragma once
+
+#ifndef CFINDTEMPLATE_H
+#define CFINDTEMPLATE_H
 
 #include "CImageBasis.h"
 
@@ -37,4 +39,4 @@ class CFindTemplate : public CImageBasis
         bool CalculateSimularities(uint8_t* _rgb_tmpl, int _startx, int _starty, int _sizex, int _sizey, int &min, float &avg, int &max, float &SAD, float _SADold, float _SADcrit);
 };
 
-#endif
+#endif //CFINDTEMPLATE_H

+ 3 - 3
code/components/jomjol_image_proc/CImageBasis.h

@@ -1,7 +1,7 @@
 #pragma once
 
-#ifndef __CIMAGEBASIS
-#define __CIMAGEBASIS
+#ifndef CIMAGEBASIS_H
+#define CIMAGEBASIS_H
 
 #include <stdint.h>
 #include <string>
@@ -86,5 +86,5 @@ class CImageBasis
 };
 
 
-#endif
+#endif //CIMAGEBASIS_H
 

+ 7 - 0
code/components/jomjol_image_proc/CRotateImage.h

@@ -1,3 +1,8 @@
+#pragma once
+
+#ifndef CROTATEIMAGE_H
+#define CROTATEIMAGE_H
+
 #include "CImageBasis.h"
 
 
@@ -19,3 +24,5 @@ class CRotateImage: public CImageBasis
         void Translate(int _dx, int _dy);
         void Mirror();
 };
+
+#endif //CROTATEIMAGE_H

+ 2 - 0
code/components/jomjol_influxdb/interface_influxdb.h

@@ -1,4 +1,6 @@
 #ifdef ENABLE_INFLUXDB
+
+#pragma once
 #ifndef INTERFACE_INFLUXDB_H
 #define INTERFACE_INFLUXDB_H
 

+ 8 - 1
code/components/jomjol_logfile/ClassLogFile.h

@@ -1,3 +1,8 @@
+#pragma once
+
+#ifndef CLASSLOGFILE_H
+#define CLASSLOGFILE_H
+
 
 #include <string>
 #include "esp_log.h"
@@ -44,4 +49,6 @@ public:
     std::string GetCurrentFileNameData();
 };
 
-extern ClassLogFile LogFile;
+extern ClassLogFile LogFile;
+
+#endif //CLASSLOGFILE_H

+ 3 - 0
code/components/jomjol_mqtt/interface_mqtt.h

@@ -1,4 +1,7 @@
 #ifdef ENABLE_MQTT
+
+#pragma once
+
 #ifndef INTERFACE_MQTT_H
 #define INTERFACE_MQTT_H
 

+ 7 - 0
code/components/jomjol_mqtt/server_mqtt.h

@@ -1,5 +1,10 @@
 #ifdef ENABLE_MQTT
 
+#pragma once
+
+#ifndef SERVERMQTT_H
+#define SERVERMQTT_H
+
 #include "ClassFlowDefineTypes.h"
 
 void SetHomeassistantDiscoveryEnabled(bool enabled);
@@ -16,4 +21,6 @@ void publishSystemData();
 std::string getTimeUnit(void);
 void GotConnected(std::string maintopic, int SetRetainFlag);
 
+
+#endif //SERVERMQTT_H
 #endif //ENABLE_MQTT

+ 4 - 7
code/components/jomjol_tfliteclass/CTfLiteClass.h

@@ -1,11 +1,7 @@
+#pragma once
 
-/*
-#define TFLITE_MINIMAL_CHECK(x)                              \
-  if (!(x)) {                                                \
-    fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); \
-    exit(1);                                                 \
-  }
-*/
+#ifndef CTFLITECLASS_H
+#define CTFLITECLASS_H
 
 #include "tensorflow/lite/micro/all_ops_resolver.h"
 #include "tensorflow/lite/micro/micro_error_reporter.h"
@@ -72,3 +68,4 @@ class CTfLiteClass
         int ReadInputDimenstion(int _dim);
 };
 
+#endif //CTFLITECLASS_H

+ 7 - 0
code/components/jomjol_tfliteclass/server_tflite.h

@@ -1,3 +1,8 @@
+#pragma once
+
+#ifndef SERVERTFLITE_H
+#define SERVERTFLITE_H
+
 #include <esp_log.h>
 #include <string>
 
@@ -26,3 +31,5 @@ esp_err_t GetJPG(std::string _filename, httpd_req_t *req);
 esp_err_t GetRawJPG(httpd_req_t *req);
 
 extern ClassFlowControll tfliteflow;
+
+#endif //SERVERTFLITE_H

+ 9 - 1
code/components/jomjol_time_sntp/time_sntp.h

@@ -1,3 +1,9 @@
+#pragma once
+
+#ifndef TIMESNTP_H
+#define TIMESNTP_H
+
+
 #include <string>
 #include <time.h>
 #include <sys/time.h>
@@ -23,4 +29,6 @@ void reset_servername(std::string _servername);
 void setBootTime();
 time_t getUpTime();
 bool getTimeIsSet(void);
-void restartNtpClient(void);
+void restartNtpClient(void);
+
+#endif //TIMESNTP_H

+ 3 - 1
code/components/jomjol_wlan/connect_wlan.h

@@ -1,3 +1,5 @@
+#pragma once
+
 #ifndef CONNECT_WLAN_H
 #define CONNECT_WLAN_H
 
@@ -15,4 +17,4 @@ bool getWIFIisConnected();
 extern std::string hostname;
 extern std::string std_hostname;
 
-#endif
+#endif //CONNECT_WLAN_H

+ 3 - 1
code/components/jomjol_wlan/read_wlanini.h

@@ -1,3 +1,5 @@
+#pragma once
+
 #ifndef READ_WLANINI_H
 #define READ_WLANINI_H
 
@@ -8,4 +10,4 @@ void LoadWlanFromFile(std::string fn, char *&_ssid, char *&_password, char *&_ho
 bool ChangeHostName(std::string fn, std::string _newhostname);
 
 
-#endif
+#endif //READ_WLANINI_H

+ 14 - 12
code/main/main.cpp

@@ -1,22 +1,24 @@
-#include <string>
-#include "freertos/FreeRTOS.h"
-#include "freertos/task.h"
-#include "freertos/event_groups.h"
+//#include <string>
+//#include "freertos/FreeRTOS.h"
+//#include "freertos/task.h"
+//#include "freertos/event_groups.h"
 
-#include "driver/gpio.h"
-#include "sdkconfig.h"
+//#include "driver/gpio.h"
+//#include "sdkconfig.h"
 //#include "esp_psram.h" // Comming in IDF 5.0, see https://docs.espressif.com/projects/esp-idf/en/v5.0-beta1/esp32/migration-guides/release-5.x/system.html?highlight=esp_psram_get_size
 //#include "spiram.h"
 #include "esp32/spiram.h"
 
+
 // SD-Card ////////////////////
-#include "nvs_flash.h"
+//#include "nvs_flash.h"
 #include "esp_vfs_fat.h"
-#include "sdmmc_cmd.h"
+//#include "sdmmc_cmd.h"
 #include "driver/sdmmc_host.h"
-#include "driver/sdmmc_defs.h"
+//#include "driver/sdmmc_defs.h"
 ///////////////////////////////
 
+
 #include "ClassLogFile.h"
 
 #include "connect_wlan.h"
@@ -27,15 +29,15 @@
 #include "server_file.h"
 #include "server_ota.h"
 #include "time_sntp.h"
-#include "ClassControllCamera.h"
+//#include "ClassControllCamera.h"
 #include "server_main.h"
 #include "server_camera.h"
 #ifdef ENABLE_MQTT
     #include "server_mqtt.h"
 #endif //ENABLE_MQTT
-#include "Helper.h"
+//#include "Helper.h"
 #include "../../include/defines.h"
-#include "server_GPIO.h"
+//#include "server_GPIO.h"
 
 extern const char* GIT_TAG;
 extern const char* GIT_REV;