Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c830511

Browse filesBrowse files
per1234me-no-dev
authored andcommitted
EEPROM library: Move #include of Arduino.h to header file (espressif#1641)
EEPROM.h uses data types which are declared through Arduino.h but that file does not contain an #include directive for Arduino.h. This does not cause any problems when the EEPROM library is #included from a .ino file because the Arduino IDE automatically adds an #include directive for Arduino.h but this is not the case for .cpp files. If a .cpp file has an #include directive for EEPROM.h that does not follow an #include directive for Arduino.h then compilation fails: E:\arduino\hardware\espressif\esp32\libraries\EEPROM/EEPROM.h:91:5: error: 'float_t' does not name a type float_t readFloat(int address); ^ E:\arduino\hardware\espressif\esp32\libraries\EEPROM/EEPROM.h:92:5: error: 'double_t' does not name a type double_t readDouble(int address); ^ E:\arduino\hardware\espressif\esp32\libraries\EEPROM/EEPROM.h:95:5: error: 'String' does not name a type String readString(int address); ^ E:\arduino\hardware\espressif\esp32\libraries\EEPROM/EEPROM.h:110:36: error: 'float_t' has not been declared size_t writeFloat(int address, float_t value); ^ E:\arduino\hardware\espressif\esp32\libraries\EEPROM/EEPROM.h:111:37: error: 'double_t' has not been declared size_t writeDouble(int address, double_t value); ^ E:\arduino\hardware\espressif\esp32\libraries\EEPROM/EEPROM.h:114:37: error: 'String' has not been declared size_t writeString(int address, String value);
1 parent cbd4dc5 commit c830511
Copy full SHA for c830511

File tree

2 files changed

+1
-1
lines changed
Filter options

2 files changed

+1
-1
lines changed

‎libraries/EEPROM/EEPROM.cpp

Copy file name to clipboardExpand all lines: libraries/EEPROM/EEPROM.cpp
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2525
*/
2626

27-
#include "Arduino.h"
2827
#include "EEPROM.h"
2928

3029
#include <esp_log.h>

‎libraries/EEPROM/EEPROM.h

Copy file name to clipboardExpand all lines: libraries/EEPROM/EEPROM.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#ifndef EEPROM_FLASH_PARTITION_NAME
3030
#define EEPROM_FLASH_PARTITION_NAME "eeprom"
3131
#endif
32+
#include <Arduino.h>
3233
extern "C" {
3334

3435
#include <stddef.h>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.