Version 1.3.5.
This commit is contained in:
parent
cdac98b767
commit
f1fef8926c
@ -1,17 +1,11 @@
|
||||
#ifndef DEFINES_GSR_H
|
||||
#define DEFINES_GSR_H
|
||||
|
||||
#define __cplusplus 1
|
||||
// Time Sync Server
|
||||
#define ntpServer "time.nrc.ca"
|
||||
|
||||
//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 4
|
||||
#define HARDWARE_VERSION_MAJOR 1
|
||||
#define HARDWARE_VERSION_MINOR 0
|
||||
#define USEDEBUG 0 // !0 is on, will not setup Serial OR print output if zero.
|
||||
|
||||
// WiFi
|
||||
#define WiFi_AP_SSID "Watchy Connect"
|
||||
@ -25,10 +19,11 @@
|
||||
#define WiFi_DEF_PASS ""
|
||||
|
||||
// Battery
|
||||
#define MaxBattery 4.37
|
||||
#define MinBattery 3.58
|
||||
#define LowBattery 3.45
|
||||
|
||||
// functions
|
||||
#define clamp(v,lo,hi) (((v)<(lo))?(lo):((v)>(hi))?(hi):(v))
|
||||
#define roller(v,lo,hi) (((v)<(lo))?(hi):((v)>(hi))?(lo):(v))
|
||||
#define gobig(v,lo) ((v)>(lo)?(v):(lo))
|
||||
#define golow(v,hi) ((v)<(hi)?(v):(hi))
|
||||
@ -75,14 +70,16 @@
|
||||
#define MENU_TRBO 18
|
||||
#define MENU_DARK 19
|
||||
#define MENU_SAVE 20
|
||||
#define MENU_TRBL 21
|
||||
#define MENU_SYNC 22
|
||||
#define MENU_WIFI 23
|
||||
#define MENU_OTAU 24
|
||||
#define MENU_OTAM 25
|
||||
#define MENU_SCRN 26
|
||||
#define MENU_RSET 27
|
||||
#define MENU_TOFF 28 // Time Diff offset.
|
||||
#define MENU_TPWR 21
|
||||
#define MENU_INFO 22
|
||||
#define MENU_TRBL 23
|
||||
#define MENU_SYNC 24
|
||||
#define MENU_WIFI 25
|
||||
#define MENU_OTAU 26
|
||||
#define MENU_OTAM 27
|
||||
#define MENU_SCRN 28
|
||||
#define MENU_RSET 29
|
||||
#define MENU_TOFF 30 // Time Diff offset.
|
||||
|
||||
// Menu segments.
|
||||
#define MENU_INNORMAL 0
|
||||
@ -92,7 +89,7 @@
|
||||
#define MENU_INTROUBLE 4
|
||||
|
||||
// Button debounce.
|
||||
#define KEYPAUSE 293
|
||||
#define KEYPAUSE 728
|
||||
|
||||
//ALARM flags.
|
||||
#define ALARM_REPEAT 128
|
||||
|
||||
1058
src/Watchy_GSR.cpp
1058
src/Watchy_GSR.cpp
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
||||
#ifndef WATCHY_GSR_H
|
||||
#define WATCHY_GSR_H
|
||||
|
||||
#include <core_version.h>
|
||||
#include <Watchy.h>
|
||||
#include "Defines_GSR.h"
|
||||
#include "Web-HTML.h"
|
||||
@ -11,19 +12,17 @@
|
||||
#include <WiFiClient.h>
|
||||
#include <ArduinoOTA.h>
|
||||
#include <Update.h>
|
||||
#include <WiFiUdp.h>
|
||||
#include <WiFiManager.h>
|
||||
#include <HTTPClient.h>
|
||||
#include <Arduino_JSON.h>
|
||||
#include <DS3232RTC.h>
|
||||
#include <Rtc_Pcf8563.h>
|
||||
#include "SmallRTC.h"
|
||||
#include "SmallNTP.h"
|
||||
#include "GxEPD2_BW.h"
|
||||
#include <mbedtls/base64.h>
|
||||
#include <Wire.h>
|
||||
#include <bma.h>
|
||||
|
||||
#include "icons.h"
|
||||
#include "Olsen2POSIX.h"
|
||||
#include "Olson2POSIX.h"
|
||||
#include "ArduinoNvs.h"
|
||||
|
||||
#include "aAntiCorona15pt7b.h"
|
||||
@ -34,8 +33,11 @@
|
||||
|
||||
class WatchyGSR{
|
||||
public:
|
||||
static WatchyRTC RTC;
|
||||
static SmallRTC SRTC;
|
||||
// static WatchyRTC SRTC;
|
||||
static SmallNTP SNTP;
|
||||
static GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display;
|
||||
static constexpr const char* Build = "1.3.5";
|
||||
public:
|
||||
WatchyGSR();
|
||||
void init(String datetime = "");
|
||||
@ -68,6 +70,7 @@ class WatchyGSR{
|
||||
void _bmaConfig();
|
||||
static uint16_t _readRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len);
|
||||
static uint16_t _writeRegister(uint8_t address, uint8_t reg, uint8_t *data, uint16_t len);
|
||||
uint16_t FontColor();
|
||||
String MakeTime(int Hour, int Minutes, bool& Alarm);
|
||||
String MakeHour(uint8_t Hour);
|
||||
String MakeSeconds(uint8_t Seconds);
|
||||
@ -87,6 +90,9 @@ class WatchyGSR{
|
||||
void AskForWiFi();
|
||||
void processWiFiRequest();
|
||||
String WiFiIndicator(uint8_t Index);
|
||||
void UpdateWiFiPower(String SSID, String PSK);
|
||||
void UpdateWiFiPower(String SSID);
|
||||
void UpdateWiFiPower(uint8_t PWRIndex = 0);
|
||||
wl_status_t currentWiFi();
|
||||
void endWiFi();
|
||||
static void WiFiStationDisconnected(WiFiEvent_t event, WiFiEventInfo_t info);
|
||||
@ -98,20 +104,20 @@ class WatchyGSR{
|
||||
void initZeros();
|
||||
String GetSettings();
|
||||
void StoreSettings(String FromUser);
|
||||
String RetrieveSettings();
|
||||
void RetrieveSettings();
|
||||
void RecordSettings();
|
||||
void SetTurbo();
|
||||
bool InTurbo();
|
||||
bool BedTime();
|
||||
bool UpRight();
|
||||
bool DarkWait();
|
||||
bool Showing();
|
||||
void RefreshCPU();
|
||||
void RefreshCPU(int Value);
|
||||
void DBug(String Value);
|
||||
String ToHex(uint64_t Value);
|
||||
uint8_t getTXOffset(wifi_power_t Current);
|
||||
void DisplayInit(bool ForceDark = false);
|
||||
void DisplaySleep();
|
||||
};
|
||||
|
||||
extern RTC_DATA_ATTR BMA423 sensor;
|
||||
extern RTC_DATA_ATTR bool WIFI_CONFIGURED;
|
||||
extern RTC_DATA_ATTR bool BLE_CONFIGURED;
|
||||
|
||||
#endif
|
||||
|
||||
@ -338,7 +338,7 @@ static const char wifiIndexA[] = {
|
||||
0x69, 0x5F, 0x66, 0x6F, 0x72, 0x6D, 0x27, 0x3E, 0x3C, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x20, 0x77,
|
||||
0x69, 0x64, 0x74, 0x68, 0x3D, 0x27, 0x32, 0x30, 0x25, 0x27, 0x20, 0x61, 0x6C, 0x69, 0x67, 0x6E,
|
||||
0x3D, 0x27, 0x63, 0x65, 0x6E, 0x74, 0x65, 0x72, 0x27, 0x3E, 0x3C, 0x74, 0x72, 0x3E, 0x3C, 0x74,
|
||||
0x64, 0x20, 0x63, 0x6F, 0x6C, 0x73, 0x70, 0x61, 0x6E, 0x3D, 0x34, 0x3E, 0x3C, 0x63, 0x65, 0x6E,
|
||||
0x64, 0x20, 0x63, 0x6F, 0x6C, 0x73, 0x70, 0x61, 0x6E, 0x3D, 0x35, 0x3E, 0x3C, 0x63, 0x65, 0x6E,
|
||||
0x74, 0x65, 0x72, 0x3E, 0x3C, 0x66, 0x6F, 0x6E, 0x74, 0x20, 0x73, 0x69, 0x7A, 0x65, 0x3D, 0x34,
|
||||
0x3E, 0x3C, 0x62, 0x3E, 0x3C, 0x75, 0x3E, 0x57, 0x61, 0x74, 0x63, 0x68, 0x79, 0x20, 0x41, 0x64,
|
||||
0x64, 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x61, 0x6C, 0x20, 0x57, 0x69, 0x46, 0x69, 0x20, 0x41, 0x63,
|
||||
@ -372,7 +372,22 @@ static const char wifiIndexC[] = {
|
||||
0x74, 0x6F, 0x6D, 0x27, 0x20, 0x61, 0x6C, 0x69, 0x67, 0x6E, 0x3D, 0x27, 0x6C, 0x65, 0x66, 0x74,
|
||||
0x27, 0x3E, 0x3C, 0x6C, 0x61, 0x62, 0x65, 0x6C, 0x20, 0x6F, 0x6E, 0x63, 0x6C, 0x69, 0x63, 0x6B,
|
||||
0x3D, 0x22, 0x74, 0x6F, 0x67, 0x67, 0x6C, 0x65, 0x28, 0x27, 0x50, 0x41, 0x23, 0x27, 0x29, 0x22,
|
||||
0x3E, 0x3F, 0x3C, 0x2F, 0x6C, 0x61, 0x62, 0x65, 0x6C, 0x3E, 0x3C, 0x2F, 0x74, 0x64, 0x3E, 0x00
|
||||
0x3E, 0x3F, 0x3C, 0x2F, 0x6C, 0x61, 0x62, 0x65, 0x6C, 0x3E, 0x3C, 0x2F, 0x74, 0x64, 0x3E, 0x3C,
|
||||
0x74, 0x64, 0x20, 0x76, 0x61, 0x6C, 0x69, 0x67, 0x6E, 0x3D, 0x27, 0x62, 0x6F, 0x74, 0x74, 0x6F,
|
||||
0x6D, 0x27, 0x20, 0x61, 0x6C, 0x69, 0x67, 0x6E, 0x3D, 0x27, 0x6C, 0x65, 0x66, 0x74, 0x27, 0x3E,
|
||||
0x3C, 0x66, 0x6F, 0x6E, 0x74, 0x20, 0x73, 0x69, 0x7A, 0x65, 0x3D, 0x32, 0x3E, 0x3C, 0x73, 0x65,
|
||||
0x6C, 0x65, 0x63, 0x74, 0x20, 0x6E, 0x61, 0x6D, 0x65, 0x3D, 0x22, 0x54, 0x58, 0x23, 0x22, 0x20,
|
||||
0x69, 0x64, 0x3D, 0x22, 0x54, 0x58, 0x23, 0x22, 0x3E, 0x00
|
||||
};
|
||||
|
||||
static const char wifiIndexC1[] = {
|
||||
0x3C, 0x6F, 0x70, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x3D, 0x22, 0x23,
|
||||
0x22, 0x25, 0x3E, 0x24, 0x3C, 0x2F, 0x6F, 0x70, 0x74, 0x69, 0x6F, 0x6E, 0x3E, 0x00
|
||||
};
|
||||
|
||||
static const char wifiIndexC2[] = {
|
||||
0x3C, 0x2F, 0x73, 0x65, 0x6C, 0x65, 0x63, 0x74, 0x3E, 0x3C, 0x2F, 0x66, 0x6F, 0x6E, 0x74, 0x3E,
|
||||
0x3C, 0x2F, 0x74, 0x64, 0x3E, 0x00
|
||||
};
|
||||
|
||||
static const char wifiIndexD[] = {
|
||||
|
||||
@ -17,6 +17,15 @@ const unsigned char ChargeMe[] PROGMEM = {
|
||||
0x00, 0x3F, 0xFF, 0xF8, 0x00, 0x00, 0x3F, 0xFF, 0xF8, 0x00
|
||||
};
|
||||
|
||||
// 'ChargeMeBad', 40x17px
|
||||
const unsigned char ChargeMeBad [] PROGMEM = {
|
||||
0x00, 0x3f, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xf8, 0x00, 0xff, 0xf0, 0x00, 0x18, 0x00, 0xff,
|
||||
0xf0, 0x38, 0x18, 0x00, 0xc0, 0x30, 0x38, 0x18, 0x00, 0xc0, 0x30, 0x38, 0x18, 0x00, 0xce, 0x30,
|
||||
0x38, 0x18, 0x00, 0xce, 0x30, 0x38, 0x18, 0x00, 0xc0, 0x30, 0x38, 0x1f, 0xff, 0xce, 0x30, 0x38,
|
||||
0x18, 0x00, 0xce, 0x30, 0x00, 0x18, 0x00, 0xc0, 0x30, 0x38, 0x18, 0x00, 0xc0, 0x30, 0x38, 0x18,
|
||||
0x00, 0xff, 0xf0, 0x38, 0x18, 0x00, 0xff, 0xf0, 0x00, 0x18, 0x00, 0x00, 0x3f, 0xff, 0xf8, 0x00,
|
||||
0x00, 0x3f, 0xff, 0xf8, 0x00
|
||||
};
|
||||
// 'Charging' 40x17px
|
||||
const unsigned char Charging[] PROGMEM = {
|
||||
0x00, 0x3F, 0xFF, 0xF8, 0x00, 0x00, 0x3F, 0xFF, 0xF8, 0x00, 0xFF, 0xF0, 0x00, 0x18, 0x00,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user