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

Commit

Permalink
v1.2.0 to autodetect ESP32 core version
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
khoih-prog committed Nov 26, 2021
1 parent 8e89ed7 commit 892fed7
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 23 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
Please ensure to specify the following:

* Arduino IDE version (e.g. 1.8.16) or Platform.io version
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.0)
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.2 or ESP32 v2.0.1)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
Expand All @@ -29,7 +29,7 @@ Please ensure to specify the following:
Arduino IDE version: 1.8.16
ESP8266 Core Version 3.0.2
OS: Ubuntu 20.04 LTS
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
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
Context:
I encountered a non-response while trying to press the reset button twice.
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ This [**ESP_DoubleResetDetector** library](https://github.com/khoih-prog/ESP_Dou
## Prerequisites

1. [`Arduino IDE 1.8.16+` for Arduino](https://www.arduino.cc/en/Main/Software)
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/)
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/)
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.

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+

---

## Installation
Expand Down Expand Up @@ -271,7 +273,7 @@ This is terminal debug output when running [ESP32_FSWebServer_DRD](https://githu
```cpp
Starting ESP32_FSWebServer_DRD with DoubleResetDetect using SPIFFS on ESP32_DEV
ESP_WiFiManager Version v1.7.5
ESP_DoubleResetDetector Version v1.1.2
ESP_DoubleResetDetector Version v1.2.0
FS File: /ConfigSW.json, size: 150B
FS File: /CanadaFlag_1.png, size: 40.25KB
FS File: /CanadaFlag_2.png, size: 8.12KB
Expand Down Expand Up @@ -337,7 +339,7 @@ This is terminal debug output when running [ConfigOnDoubleReset](https://github.
```
Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32_DEV
ESP_WiFiManager Version v1.7.5
ESP_DoubleResetDetector Version v1.1.2
ESP_DoubleResetDetector Version v1.2.0
[WM] RFC925 Hostname = ConfigOnDoubleReset
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
Stored: SSID = HueNet1, Pass = 12345678
Expand Down Expand Up @@ -381,7 +383,7 @@ entry 0x400806b8

Starting ConfigOnDoubleReset with DoubleResetDetect using LittleFS on ESP32_DEV
ESP_WiFiManager Version v1.7.5
ESP_DoubleResetDetector Version v1.1.2
ESP_DoubleResetDetector Version v1.2.0
[WM] RFC925 Hostname = ConfigOnDoubleReset
[WM] Set CORS Header to : Your Access-Control-Allow-Origin
Stored: SSID = HueNet1, Pass = jenniqqs
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Releases v1.2.0](#releases-v120)
* [Releases v1.1.2](#releases-v112)
* [Releases v1.1.1](#releases-v111)
* [Releases v1.1.0](#releases-v110)
Expand All @@ -24,6 +25,11 @@

## Changelog

### 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

### Releases v1.1.2

1. Update `platform.ini` and `library.json` to use original `khoih-prog` instead of `khoih.prog` after PIO fix
Expand Down
24 changes: 18 additions & 6 deletions examples/ConfigOnDoubleReset/ConfigOnDoubleReset.ino
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,25 @@
// Use LittleFS
#include "FS.h"

// The library will be depreciated after being merged to future major Arduino esp32 core release 2.x
// At that time, just remove this library inclusion
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS
// Check cores/esp32/esp_arduino_version.h
#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) ) //(ESP_ARDUINO_VERSION_MAJOR >= 2)
#warning Using ESP32 Core 1.0.6 or 2.0.0+
// The library has been merged into esp32 core from release 1.0.6
#include <LittleFS.h>

FS* filesystem = &LittleFS;
#define FileFS LittleFS
#define FS_Name "LittleFS"
#else
#warning Using ESP32 Core 1.0.4-. You must install LITTLEFS library
// The library has been merged into esp32 core from release 1.0.6
#include <LITTLEFS.h> // https://github.com/lorol/LITTLEFS

FS* filesystem = &LITTLEFS;
#define FileFS LITTLEFS
#define FS_Name "LittleFS"
#endif

FS* filesystem = &LITTLEFS;
#define FileFS LITTLEFS
#define FS_Name "LittleFS"
#elif USE_SPIFFS
#include <SPIFFS.h>
FS* filesystem = &SPIFFS;
Expand Down
5 changes: 3 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ESP_DoubleResetDetector",
"version": "1.1.2",
"version": "1.2.0",
"keywords": "rtc,eeprom,littlefs,spiffs,reset,data,esp32,esp8266,double-reset,detector",
"description": "Library to detect a double reset within a predetermined time, using RTC Memory, EEPROM, LittleFS or SPIFFS for ESP8266 and ESP32",
"authors":
Expand Down Expand Up @@ -33,5 +33,6 @@
],
"frameworks": "arduino",
"platforms": [ "espressif32", "espressif8266" ],
"examples": "examples/*/*/*.ino"
"examples": "examples/*/*/*.ino",
"headers": "ESP_DoubleResetDetector.h"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESP_DoubleResetDetector
version=1.1.2
version=1.2.0
author=Khoi Hoang
maintainer=Khoi Hoang <[email protected]>
license=MIT
Expand Down
2 changes: 1 addition & 1 deletion platformio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ board = nodemcuv2

[env:ESP32]
platform = espressif32
framework = arduino, espidf
framework = arduino
; ============================================================
; Board configuration
; choose your board by uncommenting one of the following lines
Expand Down
22 changes: 15 additions & 7 deletions src/ESP_DoubleResetDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/ESP_DoubleResetDetector
Licensed under MIT license
Version: 1.1.2
Version: 1.2.0
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -19,7 +19,8 @@
1.0.3 K Hoang 13/05/2020 Update to use LittleFS for ESP8266 core 2.7.1+
1.1.0 K Hoang 04/12/2020 Add support to LittleFS for ESP32 using LITTLEFS Library
1.1.1 K Hoang 28/12/2020 Suppress all possible compiler warnings
1.1.2 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.1.2 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
1.2.0 K Hoang 26/11/2021 Auto detect ESP32 core and use either built-in LittleFS or LITTLEFS library
*****************************************************************************************************************************/

#pragma once
Expand All @@ -33,7 +34,7 @@
#include <WProgram.h>
#endif

#define ESP_DOUBLE_RESET_DETECTOR_VERSION "ESP_DoubleResetDetector v1.1.2"
#define ESP_DOUBLE_RESET_DETECTOR_VERSION "ESP_DoubleResetDetector v1.2.0"
#define ESP_DOUBLERESETDETECTOR_VERSION ESP_DOUBLE_RESET_DETECTOR_VERSION

//#define ESP_DRD_USE_EEPROM false
Expand Down Expand Up @@ -82,10 +83,17 @@
#ifdef ESP32

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

0 comments on commit 892fed7

Please sign in to comment.