Version 1.3.2.

This commit is contained in:
GuruSR 2021-11-24 20:38:34 -05:00 committed by GitHub
parent 3e8921a0ed
commit 35801c60b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 8 deletions

View File

@ -1,13 +1,16 @@
#ifndef DEFINES_GSR_H
#define DEFINES_GSR_H
// Watchy has the newer PCF8563 RTC clock.
//#define PCF8563RTC 1
//debug
#define USEDEBUG 1 // !0 is on, will not setup Serial OR print output if zero.
//display
#define SOFTWARE_VERSION_MAJOR 1
#define SOFTWARE_VERSION_MINOR 3
#define SOFTWARE_VERSION_PATCH 1
#define SOFTWARE_VERSION_PATCH 2
#define HARDWARE_VERSION_MAJOR 1
#define HARDWARE_VERSION_MINOR 0

View File

@ -148,7 +148,16 @@ RTC_DATA_ATTR struct dispUpdate {
bool Drawn;
} Updates;
#ifndef WATCHY_H
RTC_DATA_ATTR BMA423 sensor;
#endif
#ifndef PCF8563RTC
DS3232RTC WatchyGSR::RTC(false);
#else
PCF8563 WatchyGSR::RTC(false);
#endif
GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> WatchyGSR::display(GxEPD2_154_D67(CS, DC, RESET, BUSY));
volatile uint8_t Button;
@ -1408,7 +1417,7 @@ void WatchyGSR::handleButtonPress(uint8_t Pressed){
if (Options.Orientated) { if (Direction != DIRECTION_DISP_UP && Direction != DIRECTION_TOP_EDGE) return; } // Don't accept it.
if (LastButton > 0 && (millis() - LastButton) < KEYPAUSE) return;
LastButton=millis(); Darkness.Last=LastButton;
if (LastButton > 0) { LastButton=millis(); Darkness.Last=LastButton; }
if (Darkness.Went) { UpdateDisp=true; return; } // Don't do the button, just exit.
switch (Pressed){
@ -2199,9 +2208,7 @@ void WatchyGSR::ManageTime(){
void WatchyGSR::_rtcConfig() {
tmElements_t TM;
//https://github.com/JChristensen/DS3232RTC
RTC.squareWave(SQWAVE_NONE); //disable square wave output
//RTC.set(compileTime()); //set RTC time to compile time
RTC.setAlarm(ALM2_EVERY_MINUTE, 0, 0, 0, 0); //alarm wakes up Watchy every minute
RTC.alarmInterrupt(ALARM_2, true); //enable alarm interrupt
RTC.read(TM);
@ -3005,10 +3012,10 @@ void WatchyGSR::SetTurbo(){
Darkness.Last=LastButton; // Keeps track of SleepMode.
}
bool WatchyGSR::InTurbo() { return (!WatchTime.DeadRTC && Options.Turbo > 0 && millis() - TurboTime < (Options.Turbo * 1000)); }
bool WatchyGSR::InTurbo() { return (!WatchTime.DeadRTC && Options.Turbo > 0 && TurboTime != 0 && millis() - TurboTime < (Options.Turbo * 1000)); }
bool WatchyGSR::DarkWait(){
bool B = (Darkness.Last > 0 && (millis() - Darkness.Last) < (Options.SleepMode * 1000));
bool B = (Darkness.Last != 0 && (millis() - Darkness.Last) < (Options.SleepMode * 1000));
if (Options.SleepStyle == 2){
if (B) return B;
if (Options.SleepEnd > Options.SleepStart) { if (WatchTime.Local.Hour >= Options.SleepStart && WatchTime.Local.Hour < Options.SleepEnd) return false; }

View File

@ -1,7 +1,6 @@
#ifndef WATCHY_GSR_H
#define WATCHY_GSR_H
#include <Watchy.h>
#include "Defines_GSR.h"
#include "Web-HTML.h"
#include <Arduino.h>
@ -15,11 +14,15 @@
#include <WiFiManager.h>
#include <HTTPClient.h>
#include <Arduino_JSON.h>
#ifndef PCF8563RTC
#include <DS3232RTC.h>
#else
#include <PCF8563.h>
#endif
#include "GxEPD2_BW.h"
#include "mbedtls/base64.h"
#include <Wire.h>
#include "bma.h"
#include <bma.h>
#include "icons.h"
#include "Olsen2POSIX.h"
@ -33,7 +36,11 @@
class WatchyGSR{
public:
#ifndef PCF8563RTC
static DS3232RTC RTC;
#else
static PCF8563 RTC;
#endif
static GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display;
public:
WatchyGSR();