From fc5fbd648e4dc3f2f37c53bd479478bf8d8541d7 Mon Sep 17 00:00:00 2001 From: Nicolas Liaudat Date: Tue, 20 Dec 2022 06:46:13 +0100 Subject: [PATCH] #ifndef in *.h + #pragma once (#1639) --- .../components/jomjol_configfile/configFile.h | 9 +- code/components/jomjol_controlGPIO/Color.h | 5 + .../components/jomjol_controlGPIO/SmartLeds.h | 5 + .../jomjol_controlGPIO/server_GPIO.h | 2 + .../ClassControllCamera.h | 2 + .../jomjol_controlcamera/img_converters.h | 2 + .../jomjol_controlcamera/sensor_old.h | 245 ------------------ .../jomjol_controlcamera/server_camera.h | 2 + .../jomjol_fileserver_ota/server_file.h | 6 + .../jomjol_fileserver_ota/server_help.h | 9 +- .../jomjol_fileserver_ota/server_ota.h | 9 +- .../jomjol_flowcontroll/ClassFlow.h | 4 + .../jomjol_flowcontroll/ClassFlowAlignment.h | 5 + .../jomjol_flowcontroll/ClassFlowCNNGeneral.h | 6 +- .../jomjol_flowcontroll/ClassFlowControll.h | 6 +- .../ClassFlowDefineTypes.h | 6 +- .../jomjol_flowcontroll/ClassFlowImage.h | 6 + .../jomjol_flowcontroll/ClassFlowInfluxDB.h | 6 + .../jomjol_flowcontroll/ClassFlowMQTT.h | 7 +- .../jomjol_flowcontroll/ClassFlowMakeImage.h | 5 + .../ClassFlowPostProcessing.h | 8 +- .../jomjol_flowcontroll/ClassFlowWriteList.h | 5 + code/components/jomjol_helper/Helper.h | 6 + .../jomjol_image_proc/CAlignAndCutImage.h | 6 + .../jomjol_image_proc/CFindTemplate.h | 8 +- .../jomjol_image_proc/CImageBasis.h | 6 +- .../jomjol_image_proc/CRotateImage.h | 7 + .../jomjol_influxdb/interface_influxdb.h | 2 + code/components/jomjol_logfile/ClassLogFile.h | 9 +- code/components/jomjol_mqtt/interface_mqtt.h | 3 + code/components/jomjol_mqtt/server_mqtt.h | 7 + .../jomjol_tfliteclass/CTfLiteClass.h | 11 +- .../jomjol_tfliteclass/server_tflite.h | 7 + code/components/jomjol_time_sntp/time_sntp.h | 10 +- code/components/jomjol_wlan/connect_wlan.h | 4 +- code/components/jomjol_wlan/read_wlanini.h | 4 +- code/main/main.cpp | 26 +- 37 files changed, 188 insertions(+), 288 deletions(-) delete mode 100644 code/components/jomjol_controlcamera/sensor_old.h diff --git a/code/components/jomjol_configfile/configFile.h b/code/components/jomjol_configfile/configFile.h index c34605e9..8d710e3f 100644 --- a/code/components/jomjol_configfile/configFile.h +++ b/code/components/jomjol_configfile/configFile.h @@ -1,3 +1,8 @@ +#pragma once + +#ifndef CONFIGFILE_H +#define CONFIGFILE_H + #include #include @@ -12,4 +17,6 @@ public: private: FILE* pFile; -}; \ No newline at end of file +}; + +#endif //CONFIGFILE_H \ No newline at end of file diff --git a/code/components/jomjol_controlGPIO/Color.h b/code/components/jomjol_controlGPIO/Color.h index 1923cf0b..aecd69c9 100644 --- a/code/components/jomjol_controlGPIO/Color.h +++ b/code/components/jomjol_controlGPIO/Color.h @@ -1,5 +1,8 @@ #pragma once +#ifndef COLOR_H +#define COLOR_H + #include #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 diff --git a/code/components/jomjol_controlGPIO/SmartLeds.h b/code/components/jomjol_controlGPIO/SmartLeds.h index 824eb337..4a95d41b 100644 --- a/code/components/jomjol_controlGPIO/SmartLeds.h +++ b/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 diff --git a/code/components/jomjol_controlGPIO/server_GPIO.h b/code/components/jomjol_controlGPIO/server_GPIO.h index 4a71036f..bf09fd98 100644 --- a/code/components/jomjol_controlGPIO/server_GPIO.h +++ b/code/components/jomjol_controlGPIO/server_GPIO.h @@ -1,3 +1,5 @@ +#pragma once + #ifndef SERVER_GPIO_H #define SERVER_GPIO_H diff --git a/code/components/jomjol_controlcamera/ClassControllCamera.h b/code/components/jomjol_controlcamera/ClassControllCamera.h index 3763e9d5..fe375a0d 100644 --- a/code/components/jomjol_controlcamera/ClassControllCamera.h +++ b/code/components/jomjol_controlcamera/ClassControllCamera.h @@ -1,3 +1,5 @@ +#pragma once + #ifndef CLASSCONTROLLCAMERA_H #define CLASSCONTROLLCAMERA_H diff --git a/code/components/jomjol_controlcamera/img_converters.h b/code/components/jomjol_controlcamera/img_converters.h index 2b83c4d6..2ed698b7 100644 --- a/code/components/jomjol_controlcamera/img_converters.h +++ b/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_ diff --git a/code/components/jomjol_controlcamera/sensor_old.h b/code/components/jomjol_controlcamera/sensor_old.h deleted file mode 100644 index 1f99c154..00000000 --- a/code/components/jomjol_controlcamera/sensor_old.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * This file is part of the OpenMV project. - * Copyright (c) 2013/2014 Ibrahim Abdelkader - * This work is licensed under the MIT license, see the file LICENSE for details. - * - * Sensor abstraction layer. - * - */ -#ifndef __SENSOR_H__ -#define __SENSOR_H__ -#include -#include - -#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__ */ diff --git a/code/components/jomjol_controlcamera/server_camera.h b/code/components/jomjol_controlcamera/server_camera.h index ac58ca78..7bd79b89 100644 --- a/code/components/jomjol_controlcamera/server_camera.h +++ b/code/components/jomjol_controlcamera/server_camera.h @@ -1,3 +1,5 @@ +#pragma once + #ifndef JOMJOL_CONTROLCAMERA_H #define JOMJOL_CONTROLCAMERA_H diff --git a/code/components/jomjol_fileserver_ota/server_file.h b/code/components/jomjol_fileserver_ota/server_file.h index 1e2764c9..735f6ffb 100644 --- a/code/components/jomjol_fileserver_ota/server_file.h +++ b/code/components/jomjol_fileserver_ota/server_file.h @@ -1,3 +1,8 @@ +#pragma once + +#ifndef SERVERFILE_H +#define SERVERFILE_H + #include #include @@ -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 \ No newline at end of file diff --git a/code/components/jomjol_fileserver_ota/server_help.h b/code/components/jomjol_fileserver_ota/server_help.h index eb836cc6..e9e2c19a 100644 --- a/code/components/jomjol_fileserver_ota/server_help.h +++ b/code/components/jomjol_fileserver_ota/server_help.h @@ -1,3 +1,8 @@ +#pragma once + +#ifndef SERVERHELP_H +#define SERVERHELP_H + #include //#include #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); \ No newline at end of file +esp_err_t set_content_type_from_file(httpd_req_t *req, const char *filename); + +#endif //SERVERHELP_H \ No newline at end of file diff --git a/code/components/jomjol_fileserver_ota/server_ota.h b/code/components/jomjol_fileserver_ota/server_ota.h index db9093e6..1f1ac902 100644 --- a/code/components/jomjol_fileserver_ota/server_ota.h +++ b/code/components/jomjol_fileserver_ota/server_ota.h @@ -1,3 +1,8 @@ +#pragma once + +#ifndef SERVEROTA_H +#define SERVEROTA_H + #include #include @@ -10,4 +15,6 @@ void CheckOTAUpdate(); void doReboot(); void hard_restart(); void CheckUpdate(); -static bool ota_update_task(std::string fn); \ No newline at end of file +static bool ota_update_task(std::string fn); + +#endif //SERVEROTA_H \ No newline at end of file diff --git a/code/components/jomjol_flowcontroll/ClassFlow.h b/code/components/jomjol_flowcontroll/ClassFlow.h index f8760e45..52f5c72c 100644 --- a/code/components/jomjol_flowcontroll/ClassFlow.h +++ b/code/components/jomjol_flowcontroll/ClassFlow.h @@ -1,5 +1,8 @@ #pragma once +#ifndef CLASSFLOW_H +#define CLASSFLOW_H + #include #include #include @@ -48,3 +51,4 @@ public: }; +#endif //CLASSFLOW_H \ No newline at end of file diff --git a/code/components/jomjol_flowcontroll/ClassFlowAlignment.h b/code/components/jomjol_flowcontroll/ClassFlowAlignment.h index 7e1efef7..29ce8cfd 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowAlignment.h +++ b/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 diff --git a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.h b/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.h index ba129b09..8c3baac6 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowCNNGeneral.h +++ b/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" diff --git a/code/components/jomjol_flowcontroll/ClassFlowControll.h b/code/components/jomjol_flowcontroll/ClassFlowControll.h index 23bfb404..a1013647 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowControll.h +++ b/code/components/jomjol_flowcontroll/ClassFlowControll.h @@ -1,7 +1,7 @@ +#pragma once - -#ifndef __FLOWCONTROLL__ -#define __FLOWCONTROLL__ +#ifndef CLASSFLOWCONTROLL_H +#define CLASSFLOWCONTROLL_H #include diff --git a/code/components/jomjol_flowcontroll/ClassFlowDefineTypes.h b/code/components/jomjol_flowcontroll/ClassFlowDefineTypes.h index 8ddca869..4890d94f 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowDefineTypes.h +++ b/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" diff --git a/code/components/jomjol_flowcontroll/ClassFlowImage.h b/code/components/jomjol_flowcontroll/ClassFlowImage.h index e3dacc35..19cb916d 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowImage.h +++ b/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 \ No newline at end of file diff --git a/code/components/jomjol_flowcontroll/ClassFlowInfluxDB.h b/code/components/jomjol_flowcontroll/ClassFlowInfluxDB.h index f1a0c1e5..f79496a5 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowInfluxDB.h +++ b/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 \ No newline at end of file diff --git a/code/components/jomjol_flowcontroll/ClassFlowMQTT.h b/code/components/jomjol_flowcontroll/ClassFlowMQTT.h index 5cac478b..75ed49c5 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowMQTT.h +++ b/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 \ No newline at end of file diff --git a/code/components/jomjol_flowcontroll/ClassFlowMakeImage.h b/code/components/jomjol_flowcontroll/ClassFlowMakeImage.h index ad375625..d1543399 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowMakeImage.h +++ b/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 \ No newline at end of file diff --git a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h index a1d351ec..75c04e19 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.h +++ b/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 diff --git a/code/components/jomjol_flowcontroll/ClassFlowWriteList.h b/code/components/jomjol_flowcontroll/ClassFlowWriteList.h index 49078f19..4ed77100 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowWriteList.h +++ b/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 \ No newline at end of file diff --git a/code/components/jomjol_helper/Helper.h b/code/components/jomjol_helper/Helper.h index 63e324fa..d839357e 100644 --- a/code/components/jomjol_helper/Helper.h +++ b/code/components/jomjol_helper/Helper.h @@ -1,4 +1,8 @@ #pragma once + +#ifndef HELPER_H +#define HELPER_H + #include #include #include @@ -88,3 +92,5 @@ string getResetReason(void); std::string getFormatedUptime(bool compact); const char* get404(void); + +#endif //HELPER_H diff --git a/code/components/jomjol_image_proc/CAlignAndCutImage.h b/code/components/jomjol_image_proc/CAlignAndCutImage.h index 291f6fff..7267cce3 100644 --- a/code/components/jomjol_image_proc/CAlignAndCutImage.h +++ b/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 \ No newline at end of file diff --git a/code/components/jomjol_image_proc/CFindTemplate.h b/code/components/jomjol_image_proc/CFindTemplate.h index 373b638a..b281f502 100644 --- a/code/components/jomjol_image_proc/CFindTemplate.h +++ b/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 \ No newline at end of file +#endif //CFINDTEMPLATE_H \ No newline at end of file diff --git a/code/components/jomjol_image_proc/CImageBasis.h b/code/components/jomjol_image_proc/CImageBasis.h index 01f1540f..eb03c71f 100644 --- a/code/components/jomjol_image_proc/CImageBasis.h +++ b/code/components/jomjol_image_proc/CImageBasis.h @@ -1,7 +1,7 @@ #pragma once -#ifndef __CIMAGEBASIS -#define __CIMAGEBASIS +#ifndef CIMAGEBASIS_H +#define CIMAGEBASIS_H #include #include @@ -86,5 +86,5 @@ class CImageBasis }; -#endif +#endif //CIMAGEBASIS_H diff --git a/code/components/jomjol_image_proc/CRotateImage.h b/code/components/jomjol_image_proc/CRotateImage.h index 4dec78ef..f4113f5e 100644 --- a/code/components/jomjol_image_proc/CRotateImage.h +++ b/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 \ No newline at end of file diff --git a/code/components/jomjol_influxdb/interface_influxdb.h b/code/components/jomjol_influxdb/interface_influxdb.h index 581c0ec2..ab179577 100644 --- a/code/components/jomjol_influxdb/interface_influxdb.h +++ b/code/components/jomjol_influxdb/interface_influxdb.h @@ -1,4 +1,6 @@ #ifdef ENABLE_INFLUXDB + +#pragma once #ifndef INTERFACE_INFLUXDB_H #define INTERFACE_INFLUXDB_H diff --git a/code/components/jomjol_logfile/ClassLogFile.h b/code/components/jomjol_logfile/ClassLogFile.h index 8ea731f5..49f5c314 100644 --- a/code/components/jomjol_logfile/ClassLogFile.h +++ b/code/components/jomjol_logfile/ClassLogFile.h @@ -1,3 +1,8 @@ +#pragma once + +#ifndef CLASSLOGFILE_H +#define CLASSLOGFILE_H + #include #include "esp_log.h" @@ -44,4 +49,6 @@ public: std::string GetCurrentFileNameData(); }; -extern ClassLogFile LogFile; \ No newline at end of file +extern ClassLogFile LogFile; + +#endif //CLASSLOGFILE_H \ No newline at end of file diff --git a/code/components/jomjol_mqtt/interface_mqtt.h b/code/components/jomjol_mqtt/interface_mqtt.h index 23f67892..b79cc2a7 100644 --- a/code/components/jomjol_mqtt/interface_mqtt.h +++ b/code/components/jomjol_mqtt/interface_mqtt.h @@ -1,4 +1,7 @@ #ifdef ENABLE_MQTT + +#pragma once + #ifndef INTERFACE_MQTT_H #define INTERFACE_MQTT_H diff --git a/code/components/jomjol_mqtt/server_mqtt.h b/code/components/jomjol_mqtt/server_mqtt.h index 22d8020a..72e722be 100644 --- a/code/components/jomjol_mqtt/server_mqtt.h +++ b/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 \ No newline at end of file diff --git a/code/components/jomjol_tfliteclass/CTfLiteClass.h b/code/components/jomjol_tfliteclass/CTfLiteClass.h index 66485e96..aa5639cb 100644 --- a/code/components/jomjol_tfliteclass/CTfLiteClass.h +++ b/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 \ No newline at end of file diff --git a/code/components/jomjol_tfliteclass/server_tflite.h b/code/components/jomjol_tfliteclass/server_tflite.h index 452ec0f3..45e6815b 100644 --- a/code/components/jomjol_tfliteclass/server_tflite.h +++ b/code/components/jomjol_tfliteclass/server_tflite.h @@ -1,3 +1,8 @@ +#pragma once + +#ifndef SERVERTFLITE_H +#define SERVERTFLITE_H + #include #include @@ -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 diff --git a/code/components/jomjol_time_sntp/time_sntp.h b/code/components/jomjol_time_sntp/time_sntp.h index 4fab1af6..7b1685dd 100644 --- a/code/components/jomjol_time_sntp/time_sntp.h +++ b/code/components/jomjol_time_sntp/time_sntp.h @@ -1,3 +1,9 @@ +#pragma once + +#ifndef TIMESNTP_H +#define TIMESNTP_H + + #include #include #include @@ -23,4 +29,6 @@ void reset_servername(std::string _servername); void setBootTime(); time_t getUpTime(); bool getTimeIsSet(void); -void restartNtpClient(void); \ No newline at end of file +void restartNtpClient(void); + +#endif //TIMESNTP_H \ No newline at end of file diff --git a/code/components/jomjol_wlan/connect_wlan.h b/code/components/jomjol_wlan/connect_wlan.h index cb71333e..cb52f002 100644 --- a/code/components/jomjol_wlan/connect_wlan.h +++ b/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 \ No newline at end of file +#endif //CONNECT_WLAN_H \ No newline at end of file diff --git a/code/components/jomjol_wlan/read_wlanini.h b/code/components/jomjol_wlan/read_wlanini.h index f406bb1a..47a169ef 100644 --- a/code/components/jomjol_wlan/read_wlanini.h +++ b/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 \ No newline at end of file +#endif //READ_WLANINI_H \ No newline at end of file diff --git a/code/main/main.cpp b/code/main/main.cpp index 91b2bf3c..dce3395d 100644 --- a/code/main/main.cpp +++ b/code/main/main.cpp @@ -1,22 +1,24 @@ -#include -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/event_groups.h" +//#include +//#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;