Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 892fed7

Browse files
authored
v1.2.0 to autodetect ESP32 core version
### Releases v1.2.0 1. Auto detect ESP32 core and use either built-in LittleFS or [LITTLEFS](https://github.com/lorol/LITTLEFS) library 2. Update `library.json` to use new `headers` for PIO
1 parent 8e89ed7 commit 892fed7

File tree

8 files changed

+52
-23
lines changed

8 files changed

+52
-23
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.16) or Platform.io version
18-
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.0)
18+
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.1)
1919
* Contextual information (e.g. what you were trying to achieve)
2020
* Simplest possible steps to reproduce
2121
* Anything that might be relevant in your opinion, such as:
@@ -29,7 +29,7 @@ Please ensure to specify the following:
2929
Arduino IDE version: 1.8.16
3030
ESP8266 Core Version 3.0.2
3131
OS: Ubuntu 20.04 LTS
32-
Linux Inspiron 5.4.0-86-generic #97-Ubuntu SMP Fri Sep 17 19:19:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux Inspiron 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
I encountered a non-response while trying to press the reset button twice.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ This [**ESP_DoubleResetDetector** library](https://github.com/khoih-prog/ESP_Dou
9999
## Prerequisites
100100

101101
1. [`Arduino IDE 1.8.16+` for Arduino](https://www.arduino.cc/en/Main/Software)
102-
2. [`ESP32 Core 2.0.0+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/)
102+
2. [`ESP32 Core 2.0.1+`](https://github.com/espressif/arduino-esp32) for ESP32-based boards. [![Latest release](https://img.shields.io/github/release/espressif/arduino-esp32.svg)](https://github.com/espressif/arduino-esp32/releases/latest/)
103103
3. [`ESP8266 Core 3.0.2+`](https://github.com/esp8266/Arduino) for ESP8266-based boards. [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/). SPIFFS is deprecated from ESP8266 core 2.7.1+, to use LittleFS.
104104

105+
4. [`LITTLEFS v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS with ESP32 core v1.0.4-. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32). **Notice**: This [`LITTLEFS library`](https://github.com/lorol/LITTLEFS) has been integrated to Arduino [ESP32 core v1.0.6+](https://github.com/espressif/arduino-esp32/tree/master/libraries/LITTLEFS) and you don't need to install it if using ESP32 core v1.0.6+
106+
105107
---
106108

107109
## Installation
@@ -271,7 +273,7 @@ This is terminal debug output when running [ESP32_FSWebServer_DRD](https://githu
271273
```cpp
272274
Starting ESP32_FSWebServer_DRD with DoubleResetDetect using SPIFFS on ESP32_DEV
273275
ESP_WiFiManager Version v1.7.5
274-
ESP_DoubleResetDetector Version v1.1.2
276+
ESP_DoubleResetDetector Version v1.2.0
275277
FS File: /ConfigSW.json, size: 150B
276278
FS File: /CanadaFlag_1.png, size: 40.25KB
277279
FS File: /CanadaFlag_2.png, size: 8.12KB
@@ -337,7 +339,7 @@ This is terminal debug output when running [ConfigOnDoubleReset](https://github.
337339
```
338340
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32_DEV
339341
ESP_WiFiManager Version v1.7.5
340-
ESP_DoubleResetDetector Version v1.1.2
342+
ESP_DoubleResetDetector Version v1.2.0
341343
[WM] RFC925 Hostname = ConfigOnDoubleReset
342344
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
343345
Stored: SSID = HueNet1, Pass = 12345678
@@ -381,7 +383,7 @@ entry 0x400806b8
381383

382384
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32_DEV
383385
ESP_WiFiManager Version v1.7.5
384-
ESP_DoubleResetDetector Version v1.1.2
386+
ESP_DoubleResetDetector Version v1.2.0
385387
[WM] RFC925 Hostname = ConfigOnDoubleReset
386388
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
387389
Stored: SSID = HueNet1, Pass = jenniqqs

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Releases v1.2.0](#releases-v120)
1516
* [Releases v1.1.2](#releases-v112)
1617
* [Releases v1.1.1](#releases-v111)
1718
* [Releases v1.1.0](#releases-v110)
@@ -24,6 +25,11 @@
2425

2526
## Changelog
2627

28+
### Releases v1.2.0
29+
30+
1. Auto detect ESP32 core and use either built-in LittleFS or [LITTLEFS](https://github.com/lorol/LITTLEFS) library
31+
2. Update `library.json` to use new `headers` for PIO
32+
2733
### Releases v1.1.2
2834

2935
1. Update `platform.ini` and `library.json` to use original `khoih-prog` instead of `khoih.prog` after PIO fix

examples/ConfigOnDoubleReset/ConfigOnDoubleReset.ino

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,25 @@
6565
// Use LittleFS
6666
#include "FS.h"
6767

68-
// The library will be depreciated after being merged to future major Arduino esp32 core release 2.x
69-
// At that time, just remove this library inclusion
70-
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
68+
// Check cores/esp32/esp_arduino_version.h
69+
#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
70+
#warning Using ESP32 Core 1.0.6 or 2.0.0+
71+
// The library has been merged into esp32 core from release 1.0.6
72+
#include <LittleFS.h>
73+
74+
FS* filesystem = &LittleFS;
75+
#define FileFS LittleFS
76+
#define FS_Name "LittleFS"
77+
#else
78+
#warning Using ESP32 Core 1.0.4-. You must install LITTLEFS library
79+
// The library has been merged into esp32 core from release 1.0.6
80+
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
81+
82+
FS* filesystem = &LITTLEFS;
83+
#define FileFS LITTLEFS
84+
#define FS_Name "LittleFS"
85+
#endif
7186

72-
FS* filesystem = &LITTLEFS;
73-
#define FileFS LITTLEFS
74-
#define FS_Name "LittleFS"
7587
#elif USE_SPIFFS
7688
#include <SPIFFS.h>
7789
FS* filesystem = &SPIFFS;

library.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ESP_DoubleResetDetector",
3-
"version": "1.1.2",
3+
"version": "1.2.0",
44
"keywords": "rtc,eeprom,littlefs,spiffs,reset,data,esp32,esp8266,double-reset,detector",
55
"description": "Library to detect a double reset within a predetermined time, using RTC Memory, EEPROM, LittleFS or SPIFFS for ESP8266 and ESP32",
66
"authors":
@@ -33,5 +33,6 @@
3333
],
3434
"frameworks": "arduino",
3535
"platforms": [ "espressif32", "espressif8266" ],
36-
"examples": "examples/*/*/*.ino"
36+
"examples": "examples/*/*/*.ino",
37+
"headers": "ESP_DoubleResetDetector.h"
3738
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP_DoubleResetDetector
2-
version=1.1.2
2+
version=1.2.0
33
author=Khoi Hoang
44
maintainer=Khoi Hoang <[email protected]>
55
license=MIT

platformio/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ board = nodemcuv2
8686

8787
[env:ESP32]
8888
platform = espressif32
89-
framework = arduino, espidf
89+
framework = arduino
9090
; ============================================================
9191
; Board configuration
9292
; choose your board by uncommenting one of the following lines

src/ESP_DoubleResetDetector.h

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
Built by Khoi Hoang https://github.com/khoih-prog/ESP_DoubleResetDetector
1111
Licensed under MIT license
12-
Version: 1.1.2
12+
Version: 1.2.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -19,7 +19,8 @@
1919
1.0.3 K Hoang 13/05/2020 Update to use LittleFS for ESP8266 core 2.7.1+
2020
1.1.0 K Hoang 04/12/2020 Add support to LittleFS for ESP32 using LITTLEFS Library
2121
1.1.1 K Hoang 28/12/2020 Suppress all possible compiler warnings
22-
1.1.2 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
22+
1.1.2 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
23+
1.2.0 K Hoang 26/11/2021 Auto detect ESP32 core and use either built-in LittleFS or LITTLEFS library
2324
*****************************************************************************************************************************/
2425

2526
#pragma once
@@ -33,7 +34,7 @@
3334
#include <WProgram.h>
3435
#endif
3536

36-
#define ESP_DOUBLE_RESET_DETECTOR_VERSION "ESP_DoubleResetDetector v1.1.2"
37+
#define ESP_DOUBLE_RESET_DETECTOR_VERSION "ESP_DoubleResetDetector v1.2.0"
3738
#define ESP_DOUBLERESETDETECTOR_VERSION ESP_DOUBLE_RESET_DETECTOR_VERSION
3839

3940
//#define ESP_DRD_USE_EEPROM false
@@ -82,10 +83,17 @@
8283
#ifdef ESP32
8384

8485
#if ESP_DRD_USE_LITTLEFS
85-
// The library will be depreciated after being merged to future major Arduino esp32 core release 2.x
86-
// At that time, just remove this library inclusion
87-
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
88-
#define FileFS LITTLEFS
86+
// Check cores/esp32/esp_arduino_version.h
87+
#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
88+
#warning Using ESP32 Core 1.0.6 or 2.0.0+
89+
#include <LittleFS.h> // https://github.com/lorol/LITTLEFS
90+
#define FileFS LittleFS
91+
#else
92+
#warning Using ESP32 Core 1.0.4-. You must install LITTLEFS library
93+
// The library has been merged into esp32 core from release 1.0.6
94+
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
95+
#define FileFS LITTLEFS
96+
#endif
8997
#else
9098
#include "SPIFFS.h"
9199
// ESP32 core 1.0.4 still uses SPIFFS

0 commit comments

Comments
 (0)