Compare commits

..

2 Commits

Author SHA1 Message Date
sqfmi c5b43d2eac small tweaks to "About Watchy" 2022-01-06 17:20:57 -05:00
Lyndon Nerenberg bf7425c7dc Add an "About Watchy" menu item.
This replaces "Check Battery" and adds the following info:

  * Firmware version
  * RTC chip type

The firmware version is #defined in Watchy.h.  There might be a
way to do this that's friendlier to the library release process,
but I'll leave that up to the people who actually build the releases.

I plan to extend the About menu with some radio-related info as
I work on getting BLE pairing working with my iPhone.
2022-01-05 00:25:22 -08:00
7 changed files with 25 additions and 16 deletions

View File

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

View File

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

View File

@ -72,7 +72,7 @@ void Watchy::handleButtonPress(){
switch(menuIndex)
{
case 0:
showBattery();
showAbout();
break;
case 1:
showBuzz();
@ -154,7 +154,7 @@ void Watchy::handleButtonPress(){
switch(menuIndex)
{
case 0:
showBattery();
showAbout();
break;
case 1:
showBuzz();
@ -223,7 +223,7 @@ void Watchy::showMenu(byte menuIndex, bool partialRefresh){
uint16_t w, h;
int16_t yPos;
const char *menuItems[] = {"Check Battery", "Vibrate Motor", "Show Accelerometer", "Set Time", "Setup WiFi", "Update Firmware", "Sync NTP"};
const char *menuItems[] = {"About Watchy", "Vibrate Motor", "Show Accelerometer", "Set Time", "Setup WiFi", "Update Firmware", "Sync NTP"};
for(int i=0; i<MENU_LENGTH; i++){
yPos = MENU_HEIGHT+(MENU_HEIGHT*i);
display.setCursor(0, yPos);
@ -252,7 +252,7 @@ void Watchy::showFastMenu(byte menuIndex){
uint16_t w, h;
int16_t yPos;
const char *menuItems[] = {"Check Battery", "Vibrate Motor", "Show Accelerometer", "Set Time", "Setup WiFi", "Update Firmware", "Sync NTP"};
const char *menuItems[] = {"About Watchy", "Vibrate Motor", "Show Accelerometer", "Set Time", "Setup WiFi", "Update Firmware", "Sync NTP"};
for(int i=0; i<MENU_LENGTH; i++){
yPos = MENU_HEIGHT+(MENU_HEIGHT*i);
display.setCursor(0, yPos);
@ -272,17 +272,25 @@ void Watchy::showFastMenu(byte menuIndex){
guiState = MAIN_MENU_STATE;
}
void Watchy::showBattery(){
void Watchy::showAbout(){
display.setFullWindow();
display.fillScreen(GxEPD_BLACK);
display.setFont(&FreeMonoBold9pt7b);
display.setTextColor(GxEPD_WHITE);
display.setCursor(20, 30);
display.println("Battery Voltage:");
display.setCursor(0, 20);
display.print("Lib Ver: v");
display.println(WATCHY_LIB_VER);
const char *RTC_HW[3] = { "<UNKNOWN>", "DS3231", "PCF8563" };
display.print("RTC: ");
display.println(RTC_HW[RTC.rtcType]); //0 = UNKNOWN, 1 = DS3231, 2 = PCF8563
display.print("Batt: ");
float voltage = getBatteryVoltage();
display.setCursor(70, 80);
display.print(voltage);
display.println("V");
display.display(false); //full refresh
guiState = APP_STATE;

View File

@ -54,7 +54,7 @@ class Watchy {
void handleButtonPress();
void showMenu(byte menuIndex, bool partialRefresh);
void showFastMenu(byte menuIndex);
void showBattery();
void showAbout();
void showBuzz();
void showAccelerometer();
void showUpdateFW();
@ -84,4 +84,4 @@ extern RTC_DATA_ATTR BMA423 sensor;
extern RTC_DATA_ATTR bool WIFI_CONFIGURED;
extern RTC_DATA_ATTR bool BLE_CONFIGURED;
#endif
#endif

View File

@ -130,4 +130,4 @@ String WatchyRTC::_getValue(String data, char separator, int index)
}
return found>index ? data.substring(strIndex[0], strIndex[1]) : "";
}
}

View File

@ -6,8 +6,8 @@
#include "config.h"
#include "time.h"
#define DS3231 0
#define PCF8563 1
#define DS3231 1
#define PCF8563 2
#define RTC_DS_ADDR 0x68
#define RTC_PCF_ADDR 0x51
#define YEAR_OFFSET_DS 1970

View File

@ -50,5 +50,6 @@
#define SOFTWARE_VERSION_PATCH 0
#define HARDWARE_VERSION_MAJOR 1
#define HARDWARE_VERSION_MINOR 0
//Versioning
#define WATCHY_LIB_VER "1.3.3"
#endif