-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathFirebaseFS.h
216 lines (184 loc) · 5.84 KB
/
FirebaseFS.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#include "./core/Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40408)
#error "Mixed versions compilation."
#endif
#ifndef FirebaseFS_H
#define FirebaseFS_H
#include <Arduino.h>
#include "./mbfs/MB_MCU.h"
/**📍 Default Main Class */
#define FIREBASE_ESP_CLIENT 1
/** 📌 Predefined Build Options
* ⛔ Use following build flag to disable all predefined options.
* -D FIREBASE_DISABLE_ALL_OPTIONS
*/
/**📍 For enabling the device or library time setup from NTP server
* ⛔ Use following build flag to disable.
* -D DISABLE_NTP_TIME
*/
#define ENABLE_NTP_TIME
/**📍 For enabling the error string from error reason
* ⛔ Use following build flag to disable.
* -D DISABLE_ERROR_STRING
*/
#define ENABLE_ERROR_STRING
/**📍 For RTDB class compilation
* ⛔ Use following build flag to disable.
* -D DISABLE_RTDB
*/
#define FIREBASE_ENABLE_RTDB
/**📍 For RTDB Error Queue compilation
* ⛔ Use following build flag to disable.
* -D DISABLE_ERROR_QUEUE
*/
#define FIREBASE_ENABLE_ERROR_QUEUE
/**📍 For Firestore compilation
* ⛔ Use following build flag to disable.
* -D DISABLE_FIRESTORE
*/
#define FIREBASE_ENABLE_FIRESTORE
/**📍 For Firebase Cloud Messaging compilation
* ⛔ Use following build flag to disable.
* -D DISABLE_FCM
*/
#define FIREBASE_ENABLE_FCM
/**📍 For Firebase Storage compilation
* ⛔ Use following build flag to disable.
* -D DISABLE_FB_STORAGE
*/
#define FIREBASE_ENABLE_FB_STORAGE
/**📍 For Google Cloud Storage compilation
* ⛔ Use following build flag to disable.
* -D DISABLE_GC_STORAGE
*/
#define FIREBASE_ENABLE_GC_STORAGE
/**📍 For Functions for Firebase compilation
* ⛔ Use following build flag to disable.
* -D DISABLE_FB_FUNCTIONS
*/
#define FIREBASE_ENABLE_FB_FUNCTIONS
/**📍 For enabling PSRAM support
* ⛔ Use following build flag to disable.
* -D DISABLE_PSRAM
*/
#define FIREBASE_USE_PSRAM
/**📍 For enabling OTA updates support via RTDB, Firebase Storage and Google Cloud Storage buckets
* ⛔ Use following build flag to disable.
* -D DISABLE_OTA
*/
#define ENABLE_OTA_FIRMWARE_UPDATE
/**📍 For enabling Keep Alive connection mode
* ⛔ Use following build flag to disable.
* -D DISABLE_KEEP_ALIVE
*/
#define USE_CONNECTION_KEEP_ALIVE_MODE
/**📌 For enabling flash filesystem support
*
* 📍 For SPIFFS
* #define DEFAULT_FLASH_FS SPIFFS
*
*
* 📍 For LittleFS Filesystem
* #include <LittleFS.h>
* #define DEFAULT_FLASH_FS LittleFS
*
*
* 📍 For SPIFFS Filesystem
* #if defined(ESP32)
* #include <SPIFFS.h>
* #endif
* #define DEFAULT_FLASH_FS SPIFFS
*
*
* 📍 For FAT Filesystem
* #include <FFat.h>
* #define DEFAULT_FLASH_FS FFat //For ESP32 FAT
*
* 🚫 Use following build flags to disable.
* -D DISABLE_FLASH or -DDISABLE_FLASH in PlatformIO
*/
#if defined(ESP32) || defined(ESP8266) || defined(MB_ARDUINO_PICO)
#if defined(ESP8266) || defined(MB_ARDUINO_PICO)
#include <LittleFS.h>
#define DEFAULT_FLASH_FS LittleFS
#elif defined(ESP_ARDUINO_VERSION) /* ESP32 core >= v2.0.x */ /* ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) */
#include <LittleFS.h>
#define DEFAULT_FLASH_FS LittleFS
#else
#include <SPIFFS.h>
#define DEFAULT_FLASH_FS SPIFFS
#endif
#endif
// For ESP32, format SPIFFS or FFat if mounting failed
#define FORMAT_FLASH_IF_MOUNT_FAILED 1
/**📌 For enabling SD filesystem support
*
* 📍 For SD
* #include <SD.h>
* #define DEFAULT_SD_FS SD
* #define CARD_TYPE_SD 1
*
* 📍 For SD MMC (ESP32)
* #include <SD_MMC.h>
* #define DEFAULT_SD_FS SD_MMC //For ESP32 SDMMC
* #define CARD_TYPE_SD_MMC 1
*
* 📍 For 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 DEFAULT_SD_FS sd_fat_fs
* #define CARD_TYPE_SD 1
* #define SD_FS_FILE SdFile
*
*
* ⛔ Use following build flags to disable.
* -D DISABLE_SD or -DDISABLE_SD in PlatformIO
*/
#if defined(ESP32) || defined(ESP8266)
#include <SD.h>
#define DEFAULT_SD_FS SD
#define CARD_TYPE_SD 1
#elif defined(MB_ARDUINO_PICO)
// Use SDFS (ESP8266SdFat) instead of SD
#include <SDFS.h>
#define DEFAULT_SD_FS SDFS
#define CARD_TYPE_SD 1
#endif
/** 🔖 Optional Build Options
*
* 🏷️ For external Ethernet module support.
* - Should define both library name and class object name.
* - FIREBASE_ETHERNET_MODULE_LIB is the Ethernet library name with extension (.h) and
* should be inside "" or <> e.g. "Ethernet.h".
* - FIREBASE_ETHERNET_MODULE_CLASS is the name of static object defined from class e.g. Ethernet.
* - FIREBASE_ETHERNET_MODULE_TIMEOUT is the time out in milliseconds to wait network connection.
*
* #define FIREBASE_ETHERNET_MODULE_LIB "EthernetLib.h"
* #define FIREBASE_ETHERNET_MODULE_CLASS EthernetClass
* #define FIREBASE_ETHERNET_MODULE_TIMEOUT 2000
*
* 🏷️ For native core library ENC28J60 Ethernet module support in ESP8266
* #define ENABLE_ESP8266_ENC28J60_ETH
*
* 🏷️ For native core library W5500 Ethernet module support in ESP8266
* #define ENABLE_ESP8266_W5500_ETH
*
* 🏷️ For native core library W5100 Ethernet module support in ESP8266
* #define ENABLE_ESP8266_W5100_ETH
*
* 🏷️ For disabling on-board WiFI functionality in case external Client usage
* #define FIREBASE_DISABLE_ONBOARD_WIFI
*
* 🏷️ For disabling native (sdk) Ethernet functionality in case external Client usage
* #define FIREBASE_DISABLE_NATIVE_ETHERNET
*
* 🏷️ For debug port assignment.
* #define FIREBASE_DEFAULT_DEBUG_PORT Serial
*
*/
#define ENABLE_ESP8266_ENC28J60_ETH
#if __has_include("CustomFirebaseFS.h")
#include "CustomFirebaseFS.h"
#endif
#include "./core/Firebase_Build_Options.h"
#endif