forked from mobizt/ESP-Mail-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ESP_Mail_FS.h
152 lines (110 loc) · 3.73 KB
/
ESP_Mail_FS.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#pragma once
#ifndef ESP_MAIL_CONFIG_H
#define ESP_MAIL_CONFIG_H
#include <Arduino.h>
#include "extras/MB_MCU.h"
/* 📌 Enable IMAP class compilation option */
#define ENABLE_IMAP // comment this line to disable or exclude it
/* 📌 Enable SMTP class compilation option */
#define ENABLE_SMTP // comment this line to disable or exclude it
/* 📌 PSRAM compilation option for ESP32/ESP8266 module */
#if defined(ESP32) || defined(ESP8266)
#define ESP_MAIL_USE_PSRAM
#endif
/** 📌Flash Filesystem compilation options
*
* ::::::: To use SPIFFS :::::::
*
* #define ESP_MAIL_DEFAULT_FLASH_FS SPIFFS
*
*
* ::::::: To use LittleFS Filesystem :::::::
*
* #include <LittleFS.h>
* #define ESP_MAIL_DEFAULT_FLASH_FS LittleFS
*
*
* ::::::: To use SPIFFS Filesystem :::::::
*
* #if defined(ESP32)
* #include <SPIFFS.h>
* #endif
* #define ESP_MAIL_DEFAULT_FLASH_FS SPIFFS
*
*
* ::::::: To use FAT Filesystem :::::::
*
* #include <FFat.h>
* #define ESP_MAIL_DEFAULT_FLASH_FS FFat //For ESP32 FAT
*
*/
#if defined(ESP32) || defined(ESP8266)
#if defined(ESP8266)
// Use LittleFS as default flash filesystem for ESP8266
#include <LittleFS.h>
#define ESP_MAIL_DEFAULT_FLASH_FS LittleFS
#elif defined(ESP_ARDUINO_VERSION) /* ESP32 core >= v2.0.x */ /* ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) */
// Use LittleFS as default flash filesystem for ESP32 core v2.0.x
#include <LittleFS.h>
#define ESP_MAIL_DEFAULT_FLASH_FS LittleFS
#else
// Use SPIFFS as default flash filesystem for ESP32 core v1.0.6 and earlier
#include <SPIFFS.h>
#define ESP_MAIL_DEFAULT_FLASH_FS SPIFFS
#endif
#endif
// For ESP32, format SPIFFS or FFat if mounting failed
#define ESP_MAIL_FORMAT_FLASH_IF_MOUNT_FAILED 1
/** 📌 SD Filesystem compilation options
*
* ::::::: To use SD SPI interface :::::::
*
* #include <SD.h>
* #define ESP_MAIL_DEFAULT_SD_FS SD
* #define ESP_MAIL_CARD_TYPE_SD 1
*
* ::::::: To Use SD MMC interface on ESP32 :::::::
*
* #include <SD_MMC.h>
* #define ESP_MAIL_DEFAULT_SD_FS SD_MMC //For ESP32 SDMMC
* #define ESP_MAIL_CARD_TYPE_SD_MMC 1
*
* ::::::: To use SdFat on ESP32 and other devices except for ESP8266 :::::::
*
* #include <SdFat.h> //https://github.com/greiman/SdFat
* static SdFat sd_fat_fs; //should declare as static here
* #define ESP_MAIL_DEFAULT_SD_FS sd_fat_fs
* #define ESP_MAIL_CARD_TYPE_SD 1
* #define ESP_MAIL_SD_FS_FILE SdFile
*
* The SdFat (https://github.com/greiman/SdFat) is already implemented as wrapper class in ESP8266 core library.
* Do not include SdFat.h library in ESP8266 target code which it conflicts with the wrapper one.
*/
#if defined(ESP32) || defined(ESP8266)
#include <SD.h>
#define ESP_MAIL_DEFAULT_SD_FS SD
#define ESP_MAIL_CARD_TYPE_SD 1
#endif
/* 📌 Debug port compilation option */
#ifdef ESP_MAIL_DEBUG_PORT
#define ESP_MAIL_DEFAULT_DEBUG_PORT ESP_MAIL_DEBUG_PORT
#endif
#ifndef ESP_MAIL_DEFAULT_DEBUG_PORT
#define ESP_MAIL_DEFAULT_DEBUG_PORT Serial
#endif
/** 📌 External Client Enable compilation option
*
* This macro allows library to use external basic Client and external SSL Client interface.
* The associated callback functions should be assigned based on port functions.
*/
// #define ENABLE_CUSTOM_CLIENT
/* 📌 ESP8266 W5100 Ethernet module Enable compilation option */
// #define ENABLE_ESP8266_W5100_ETH
/** 📌 ESP8266/ESP32 SSL engine for basic Client compilation option
*
* This macro allows library to use ESP8266 and ESP32 devices with
* basic Clients (EthernetClient, WiFiClient and GSMClient)
* directly without external SSL client required.
*/
#define ESP_MAIL_USE_SDK_SSL_ENGINE
#endif