From 04126ce5f632ca4049f957c3651bf5394dfddd16 Mon Sep 17 00:00:00 2001 From: Daniel Ansorregui Date: Wed, 3 Aug 2022 18:20:44 +0100 Subject: [PATCH 1/2] Tentative fixes for 2.0.3+ * Found that the Resets were caused by the timer wakeup being set * Also, some pins will crash the device if we access them. Maybe they were protected in 2.0.2 and now they are not. --- src/Watchy.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Watchy.cpp b/src/Watchy.cpp index 98e94e3..f0f0e53 100644 --- a/src/Watchy.cpp +++ b/src/Watchy.cpp @@ -52,10 +52,16 @@ void Watchy::displayBusyCallback(const void *) { void Watchy::deepSleep() { display.hibernate(); + if (displayFullInit) // For some reason, seems to be enabled on first boot + esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_TIMER); displayFullInit = false; // Notify not to init it again RTC.clearAlarm(); // resets the alarm flag in the RTC - // Set pins 0-39 to input to avoid power leaking out - for (int i = 0; i < 40; i++) { + + // Set GPIOs 0-39 to input to avoid power leaking out + const uint64_t ignore = 0b11110001000000110000100111000010; // Ignore some GPIOs due to resets + for (int i = 0; i < GPIO_NUM_MAX; i++) { + if ((ignore >> i) & 0b1) + continue; pinMode(i, INPUT); } esp_sleep_enable_ext0_wakeup((gpio_num_t)RTC_INT_PIN, From 8adde783bea4bab51d57c2cd9c7649ca0e20b6f3 Mon Sep 17 00:00:00 2001 From: sqfmi Date: Sat, 8 Oct 2022 16:22:33 -0400 Subject: [PATCH 2/2] update library --- library.json | 2 +- library.properties | 2 +- src/WatchyRTC.cpp | 2 +- src/config.h | 18 +++++++++++------- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/library.json b/library.json index efe21cf..0519f2c 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Watchy", - "version": "1.4.1", + "version": "1.4.2", "description": "Watchy - An Open Source E-Paper Watch by SQFMI", "authors": [ { diff --git a/library.properties b/library.properties index 5b2d87a..ee16e1d 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Watchy -version=1.4.1 +version=1.4.2 author=SQFMI maintainer=SQFMI sentence=Watchy - An Open Source E-Paper Watch by SQFMI diff --git a/src/WatchyRTC.cpp b/src/WatchyRTC.cpp index 313f4b7..0ee6d07 100644 --- a/src/WatchyRTC.cpp +++ b/src/WatchyRTC.cpp @@ -47,7 +47,7 @@ void WatchyRTC::read(tmElements_t &tm) { if (rtcType == DS3231) { rtc_ds.read(tm); } else { - rtc_pcf.getDateTime(); + rtc_pcf.getDate(); tm.Year = y2kYearToTm(rtc_pcf.getYear()); tm.Month = rtc_pcf.getMonth(); tm.Day = rtc_pcf.getDay(); diff --git a/src/config.h b/src/config.h index f5ff21f..4d84fa7 100644 --- a/src/config.h +++ b/src/config.h @@ -2,6 +2,14 @@ #define CONFIG_H //pins +#if !defined(ARDUINO_WATCHY_V10) && !defined(ARDUINO_WATCHY_V15) && !defined(ARDUINO_WATCHY_V20) + +#pragma message "Please install the latest ESP32 Arduino Core (2.0.5+) and choose Watchy as the target board" +#pragma message "Hardware revision is not defined at the project level, please define in config.h. Defaulting to ARDUINO_WATCHY_V20" + +//Change to your board version +#define ARDUINO_WATCHY_V20 + #define MENU_BTN_PIN 26 #define BACK_BTN_PIN 25 #define DOWN_BTN_PIN 4 @@ -14,12 +22,6 @@ #define VIB_MOTOR_PIN 13 #define RTC_INT_PIN 27 - -#if !defined(ARDUINO_WATCHY_V10) && !defined(ARDUINO_WATCHY_V15) && !defined(ARDUINO_WATCHY_V20) - #warning Hardware revision is not defined at the project level. Using hard-coded value - #define ARDUINO_WATCHY_V20 -#endif - #if defined (ARDUINO_WATCHY_V10) #define UP_BTN_PIN 32 #define BATT_ADC_PIN 33 @@ -43,6 +45,8 @@ #define ACC_INT_MASK GPIO_SEL_14 #define BTN_PIN_MASK MENU_BTN_MASK|BACK_BTN_MASK|UP_BTN_MASK|DOWN_BTN_MASK +#endif + //display #define DISPLAY_WIDTH 200 #define DISPLAY_HEIGHT 200 @@ -72,5 +76,5 @@ #define HARDWARE_VERSION_MAJOR 1 #define HARDWARE_VERSION_MINOR 0 // Versioning -#define WATCHY_LIB_VER "1.4.0" +#define WATCHY_LIB_VER "1.4.2" #endif