Version 1.3.2.
This commit is contained in:
parent
3e8921a0ed
commit
35801c60b2
@ -1,13 +1,16 @@
|
|||||||
#ifndef DEFINES_GSR_H
|
#ifndef DEFINES_GSR_H
|
||||||
#define DEFINES_GSR_H
|
#define DEFINES_GSR_H
|
||||||
|
|
||||||
|
// Watchy has the newer PCF8563 RTC clock.
|
||||||
|
//#define PCF8563RTC 1
|
||||||
|
|
||||||
//debug
|
//debug
|
||||||
#define USEDEBUG 1 // !0 is on, will not setup Serial OR print output if zero.
|
#define USEDEBUG 1 // !0 is on, will not setup Serial OR print output if zero.
|
||||||
|
|
||||||
//display
|
//display
|
||||||
#define SOFTWARE_VERSION_MAJOR 1
|
#define SOFTWARE_VERSION_MAJOR 1
|
||||||
#define SOFTWARE_VERSION_MINOR 3
|
#define SOFTWARE_VERSION_MINOR 3
|
||||||
#define SOFTWARE_VERSION_PATCH 1
|
#define SOFTWARE_VERSION_PATCH 2
|
||||||
#define HARDWARE_VERSION_MAJOR 1
|
#define HARDWARE_VERSION_MAJOR 1
|
||||||
#define HARDWARE_VERSION_MINOR 0
|
#define HARDWARE_VERSION_MINOR 0
|
||||||
|
|
||||||
|
|||||||
@ -148,7 +148,16 @@ RTC_DATA_ATTR struct dispUpdate {
|
|||||||
bool Drawn;
|
bool Drawn;
|
||||||
} Updates;
|
} Updates;
|
||||||
|
|
||||||
|
#ifndef WATCHY_H
|
||||||
|
RTC_DATA_ATTR BMA423 sensor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef PCF8563RTC
|
||||||
DS3232RTC WatchyGSR::RTC(false);
|
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));
|
GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> WatchyGSR::display(GxEPD2_154_D67(CS, DC, RESET, BUSY));
|
||||||
|
|
||||||
volatile uint8_t Button;
|
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 (Options.Orientated) { if (Direction != DIRECTION_DISP_UP && Direction != DIRECTION_TOP_EDGE) return; } // Don't accept it.
|
||||||
if (LastButton > 0 && (millis() - LastButton) < KEYPAUSE) return;
|
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.
|
if (Darkness.Went) { UpdateDisp=true; return; } // Don't do the button, just exit.
|
||||||
|
|
||||||
switch (Pressed){
|
switch (Pressed){
|
||||||
@ -2199,9 +2208,7 @@ void WatchyGSR::ManageTime(){
|
|||||||
|
|
||||||
void WatchyGSR::_rtcConfig() {
|
void WatchyGSR::_rtcConfig() {
|
||||||
tmElements_t TM;
|
tmElements_t TM;
|
||||||
//https://github.com/JChristensen/DS3232RTC
|
|
||||||
RTC.squareWave(SQWAVE_NONE); //disable square wave output
|
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.setAlarm(ALM2_EVERY_MINUTE, 0, 0, 0, 0); //alarm wakes up Watchy every minute
|
||||||
RTC.alarmInterrupt(ALARM_2, true); //enable alarm interrupt
|
RTC.alarmInterrupt(ALARM_2, true); //enable alarm interrupt
|
||||||
RTC.read(TM);
|
RTC.read(TM);
|
||||||
@ -3005,10 +3012,10 @@ void WatchyGSR::SetTurbo(){
|
|||||||
Darkness.Last=LastButton; // Keeps track of SleepMode.
|
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 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 (Options.SleepStyle == 2){
|
||||||
if (B) return B;
|
if (B) return B;
|
||||||
if (Options.SleepEnd > Options.SleepStart) { if (WatchTime.Local.Hour >= Options.SleepStart && WatchTime.Local.Hour < Options.SleepEnd) return false; }
|
if (Options.SleepEnd > Options.SleepStart) { if (WatchTime.Local.Hour >= Options.SleepStart && WatchTime.Local.Hour < Options.SleepEnd) return false; }
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#ifndef WATCHY_GSR_H
|
#ifndef WATCHY_GSR_H
|
||||||
#define WATCHY_GSR_H
|
#define WATCHY_GSR_H
|
||||||
|
|
||||||
#include <Watchy.h>
|
|
||||||
#include "Defines_GSR.h"
|
#include "Defines_GSR.h"
|
||||||
#include "Web-HTML.h"
|
#include "Web-HTML.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
@ -15,11 +14,15 @@
|
|||||||
#include <WiFiManager.h>
|
#include <WiFiManager.h>
|
||||||
#include <HTTPClient.h>
|
#include <HTTPClient.h>
|
||||||
#include <Arduino_JSON.h>
|
#include <Arduino_JSON.h>
|
||||||
|
#ifndef PCF8563RTC
|
||||||
#include <DS3232RTC.h>
|
#include <DS3232RTC.h>
|
||||||
|
#else
|
||||||
|
#include <PCF8563.h>
|
||||||
|
#endif
|
||||||
#include "GxEPD2_BW.h"
|
#include "GxEPD2_BW.h"
|
||||||
#include "mbedtls/base64.h"
|
#include "mbedtls/base64.h"
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
#include "bma.h"
|
#include <bma.h>
|
||||||
|
|
||||||
#include "icons.h"
|
#include "icons.h"
|
||||||
#include "Olsen2POSIX.h"
|
#include "Olsen2POSIX.h"
|
||||||
@ -33,7 +36,11 @@
|
|||||||
|
|
||||||
class WatchyGSR{
|
class WatchyGSR{
|
||||||
public:
|
public:
|
||||||
|
#ifndef PCF8563RTC
|
||||||
static DS3232RTC RTC;
|
static DS3232RTC RTC;
|
||||||
|
#else
|
||||||
|
static PCF8563 RTC;
|
||||||
|
#endif
|
||||||
static GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display;
|
static GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display;
|
||||||
public:
|
public:
|
||||||
WatchyGSR();
|
WatchyGSR();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user