Compare commits

...

5 Commits

Author SHA1 Message Date
SQFMI 9c0b7e6b45
arduino-platform: esp32:esp32@2.0.17 2024-07-04 14:32:57 -04:00
SQFMI 819b3319aa
arduino-platform: esp32:esp32@2.0.17 2024-07-04 14:32:39 -04:00
SQFMI b21516f9ee merged fixes for compilation issues 2024-07-04 14:21:04 -04:00
SQFMI d7bb52d34c
Merge pull request #256 from OlegGirko/fix_btn_mask_size
Use correct 64-bit integer size for button masks.
2024-07-04 13:07:03 -04:00
Oleg Girko 1e07dc53d4 Use correct 64-bit integer size for button masks.
The esp_sleep_get_ext1_wakeup_status() function returns 64-bit value.
Hence, masks this value is checked against should be 64-bit as well.
Especially, this is important because UP_BTN_MASK for Watchy V2 does not
fit inside 32-bit integer (it's bit 35).

This change fixes this problem by using BIT64 macro instead of BIT one.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
2024-07-04 17:28:06 +01:00
7 changed files with 30 additions and 22 deletions

View File

@ -16,6 +16,7 @@ jobs:
with:
arduino-board-fqbn: esp32:esp32:watchy:Revision=v20,PartitionScheme=min_spiffs,UploadSpeed=921600,DebugLevel=none,EraseFlash=none
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
arduino-platform: esp32:esp32@2.0.17
required-libraries: Adafruit GFX Library,Arduino_JSON,DS3232RTC,NTPClient,Rtc_Pcf8563,GxEPD2,WiFiManager
set-build-path: true
- uses: actions/upload-artifact@v3

View File

@ -16,6 +16,7 @@ jobs:
with:
arduino-board-fqbn: esp32:esp32:watchy:Revision=${{ matrix.board-revisions }},PartitionScheme=min_spiffs,UploadSpeed=921600,DebugLevel=none,EraseFlash=none
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
arduino-platform: esp32:esp32@2.0.17
required-libraries: Adafruit GFX Library,Arduino_JSON,DS3232RTC,NTPClient,Rtc_Pcf8563,GxEPD2,WiFiManager
set-build-path: true
- name: Rename binaries with board revision

View File

@ -1,6 +1,6 @@
{
"name": "Watchy",
"version": "1.4.12",
"version": "1.4.13",
"description": "Watchy - An Open Source E-Paper Watch by SQFMI",
"authors": [
{

View File

@ -1,5 +1,5 @@
name=Watchy
version=1.4.12
version=1.4.13
author=SQFMI
maintainer=SQFMI
sentence=Watchy - An Open Source E-Paper Watch by SQFMI

View File

@ -19,9 +19,11 @@
RTC_DATA_ATTR bool displayFullInit = true;
void WatchyDisplay::busyCallback(const void *) {
#ifndef ARDUINO_ESP32S3_DEV
gpio_wakeup_enable((gpio_num_t)DISPLAY_BUSY, GPIO_INTR_LOW_LEVEL);
esp_sleep_enable_gpio_wakeup();
esp_light_sleep_start();
#endif
}
WatchyDisplay::WatchyDisplay() :

View File

@ -88,7 +88,6 @@ void Watchy::deepSleep() {
esp_sleep_enable_ext1_wakeup(
BTN_PIN_MASK,
ESP_EXT1_WAKEUP_ANY_LOW); // enable deep sleep wake on button press
rtc_clk_32k_enable(true);
//rtc_clk_slow_freq_set(RTC_SLOW_FREQ_32K_XTAL);
struct tm timeinfo;
@ -109,7 +108,7 @@ void Watchy::deepSleep() {
BTN_PIN_MASK,
ESP_EXT1_WAKEUP_ANY_HIGH); // enable deep sleep wake on button press
#endif
gpio_deep_sleep_hold_dis();
esp_deep_sleep_start();
}

View File

@ -2,13 +2,9 @@
#define CONFIG_H
// Versioning
#define WATCHY_LIB_VER "1.4.12"
#define WATCHY_LIB_VER "1.4.13"
//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"
#ifdef ARDUINO_ESP32S3_DEV //V3
@ -37,15 +33,22 @@
#define USB_DET_PIN 21
#define RTC_INT_PIN -1 //not used
#define MENU_BTN_MASK (BIT(7))
#define BACK_BTN_MASK (BIT(6))
#define UP_BTN_MASK (BIT(0))
#define DOWN_BTN_MASK (BIT(8))
#define ACC_INT_MASK (BIT(14))
#define BTN_PIN_MASK MENU_BTN_MASK|BACK_BTN_MASK|DOWN_BTN_MASK
#define MENU_BTN_MASK (BIT64(7))
#define BACK_BTN_MASK (BIT64(6))
#define UP_BTN_MASK (BIT64(0))
#define DOWN_BTN_MASK (BIT64(8))
#define ACC_INT_MASK (BIT64(14))
#define BTN_PIN_MASK MENU_BTN_MASK|BACK_BTN_MASK|UP_BTN_MASK|DOWN_BTN_MASK
#else //V1,V1.5,V2
#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"
#define ARDUINO_WATCHY_V20
#define MENU_BTN_PIN 26
#define BACK_BTN_PIN 25
#define DOWN_BTN_PIN 4
@ -61,28 +64,30 @@
#if defined (ARDUINO_WATCHY_V10)
#define UP_BTN_PIN 32
#define BATT_ADC_PIN 33
#define UP_BTN_MASK (BIT(32))
#define UP_BTN_MASK (BIT64(32))
#define RTC_TYPE 1 //DS3231
#elif defined (ARDUINO_WATCHY_V15)
#define UP_BTN_PIN 32
#define BATT_ADC_PIN 35
#define UP_BTN_MASK (BIT(32))
#define UP_BTN_MASK (BIT64(32))
#define RTC_TYPE 2 //PCF8563
#elif defined (ARDUINO_WATCHY_V20)
#define UP_BTN_PIN 35
#define BATT_ADC_PIN 34
#define UP_BTN_MASK (BIT(35))
#define UP_BTN_MASK (BIT64(35))
#define RTC_TYPE 2 //PCF8563
#endif
#define MENU_BTN_MASK (BIT(26))
#define BACK_BTN_MASK (BIT(25))
#define DOWN_BTN_MASK (BIT(4))
#define ACC_INT_MASK (BIT(14))
#define MENU_BTN_MASK (BIT64(26))
#define BACK_BTN_MASK (BIT64(25))
#define DOWN_BTN_MASK (BIT64(4))
#define ACC_INT_MASK (BIT64(14))
#define BTN_PIN_MASK MENU_BTN_MASK|BACK_BTN_MASK|UP_BTN_MASK|DOWN_BTN_MASK
#endif
#endif
//display
#define DISPLAY_WIDTH 200
#define DISPLAY_HEIGHT 200