mirror of https://github.com/sqfmi/Watchy.git
parent
083b2d90d8
commit
3c9afbb6d2
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Watchy",
|
||||
"version": "1.3.3",
|
||||
"version": "1.4.0",
|
||||
"description": "Watchy - An Open Source E-Paper Watch by SQFMI",
|
||||
"authors": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name=Watchy
|
||||
version=1.3.3
|
||||
version=1.4.0
|
||||
author=SQFMI
|
||||
maintainer=SQFMI
|
||||
sentence=Watchy - An Open Source E-Paper Watch by SQFMI
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "Watchy.h"
|
||||
|
||||
WatchyRTC Watchy::RTC;
|
||||
GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> Watchy::display(GxEPD2_154_D67(CS, DC, RESET, BUSY));
|
||||
GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> Watchy::display(GxEPD2_154_D67(DISPLAY_CS, DISPLAY_DC, DISPLAY_RES, DISPLAY_BUSY));
|
||||
|
||||
RTC_DATA_ATTR int guiState;
|
||||
RTC_DATA_ATTR int menuIndex;
|
||||
|
@ -44,7 +44,7 @@ void Watchy::init(String datetime){
|
|||
}
|
||||
|
||||
void Watchy::displayBusyCallback(const void*){
|
||||
gpio_wakeup_enable((gpio_num_t)BUSY, GPIO_INTR_LOW_LEVEL);
|
||||
gpio_wakeup_enable((gpio_num_t)DISPLAY_BUSY, GPIO_INTR_LOW_LEVEL);
|
||||
esp_sleep_enable_gpio_wakeup();
|
||||
esp_light_sleep_start();
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ void Watchy::deepSleep(){
|
|||
for(int i=0; i<40; i++) {
|
||||
pinMode(i, INPUT);
|
||||
}
|
||||
esp_sleep_enable_ext0_wakeup(RTC_PIN, 0); //enable deep sleep wake on RTC interrupt
|
||||
esp_sleep_enable_ext0_wakeup((gpio_num_t)RTC_INT_PIN, 0); //enable deep sleep wake on RTC interrupt
|
||||
esp_sleep_enable_ext1_wakeup(BTN_PIN_MASK, ESP_EXT1_WAKEUP_ANY_HIGH); //enable deep sleep wake on button press
|
||||
esp_deep_sleep_start();
|
||||
}
|
||||
|
@ -612,9 +612,9 @@ weatherData Watchy::getWeatherData(String cityID, String units, String lang, Str
|
|||
|
||||
float Watchy::getBatteryVoltage(){
|
||||
if(RTC.rtcType == DS3231){
|
||||
return analogReadMilliVolts(V10_ADC_PIN) / 1000.0f * 2.0f; // Battery voltage goes through a 1/2 divider.
|
||||
return analogReadMilliVolts(BATT_ADC_PIN) / 1000.0f * 2.0f; // Battery voltage goes through a 1/2 divider.
|
||||
}else{
|
||||
return analogReadMilliVolts(V15_ADC_PIN) / 1000.0f * 2.0f;
|
||||
return analogReadMilliVolts(BATT_ADC_PIN) / 1000.0f * 2.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
23
src/config.h
23
src/config.h
|
@ -1,27 +1,6 @@
|
|||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
//pins
|
||||
#define SDA 21
|
||||
#define SCL 22
|
||||
#define V10_ADC_PIN 33 //OG v1.0 Watchy
|
||||
#define V15_ADC_PIN 35 //v1.5 Watchy with PCF8563 RTC
|
||||
#define RTC_PIN GPIO_NUM_27
|
||||
#define CS 5
|
||||
#define DC 10
|
||||
#define RESET 9
|
||||
#define BUSY 19
|
||||
#define VIB_MOTOR_PIN 13
|
||||
#define MENU_BTN_PIN 26
|
||||
#define BACK_BTN_PIN 25
|
||||
#define UP_BTN_PIN 32
|
||||
#define DOWN_BTN_PIN 4
|
||||
#define MENU_BTN_MASK GPIO_SEL_26
|
||||
#define BACK_BTN_MASK GPIO_SEL_25
|
||||
#define UP_BTN_MASK GPIO_SEL_32
|
||||
#define DOWN_BTN_MASK GPIO_SEL_4
|
||||
#define ACC_INT_MASK GPIO_SEL_14
|
||||
#define BTN_PIN_MASK MENU_BTN_MASK|BACK_BTN_MASK|UP_BTN_MASK|DOWN_BTN_MASK
|
||||
//display
|
||||
#define DISPLAY_WIDTH 200
|
||||
#define DISPLAY_HEIGHT 200
|
||||
|
@ -51,5 +30,5 @@
|
|||
#define HARDWARE_VERSION_MAJOR 1
|
||||
#define HARDWARE_VERSION_MINOR 0
|
||||
//Versioning
|
||||
#define WATCHY_LIB_VER "1.3.3dev"
|
||||
#define WATCHY_LIB_VER "1.4.0dev"
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue