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", "name": "Watchy",
"version": "1.3.2", "version": "1.3.3",
"description": "Watchy - An Open Source E-Paper Watch by SQFMI", "description": "Watchy - An Open Source E-Paper Watch by SQFMI",
"authors": [ "authors": [
{ {

View File

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

View File

@ -72,7 +72,7 @@ void Watchy::handleButtonPress(){
switch(menuIndex) switch(menuIndex)
{ {
case 0: case 0:
showBattery(); showAbout();
break; break;
case 1: case 1:
showBuzz(); showBuzz();
@ -154,7 +154,7 @@ void Watchy::handleButtonPress(){
switch(menuIndex) switch(menuIndex)
{ {
case 0: case 0:
showBattery(); showAbout();
break; break;
case 1: case 1:
showBuzz(); showBuzz();
@ -223,7 +223,7 @@ void Watchy::showMenu(byte menuIndex, bool partialRefresh){
uint16_t w, h; uint16_t w, h;
int16_t yPos; 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++){ for(int i=0; i<MENU_LENGTH; i++){
yPos = MENU_HEIGHT+(MENU_HEIGHT*i); yPos = MENU_HEIGHT+(MENU_HEIGHT*i);
display.setCursor(0, yPos); display.setCursor(0, yPos);
@ -252,7 +252,7 @@ void Watchy::showFastMenu(byte menuIndex){
uint16_t w, h; uint16_t w, h;
int16_t yPos; 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++){ for(int i=0; i<MENU_LENGTH; i++){
yPos = MENU_HEIGHT+(MENU_HEIGHT*i); yPos = MENU_HEIGHT+(MENU_HEIGHT*i);
display.setCursor(0, yPos); display.setCursor(0, yPos);
@ -272,17 +272,25 @@ void Watchy::showFastMenu(byte menuIndex){
guiState = MAIN_MENU_STATE; guiState = MAIN_MENU_STATE;
} }
void Watchy::showBattery(){ void Watchy::showAbout(){
display.setFullWindow(); display.setFullWindow();
display.fillScreen(GxEPD_BLACK); display.fillScreen(GxEPD_BLACK);
display.setFont(&FreeMonoBold9pt7b); display.setFont(&FreeMonoBold9pt7b);
display.setTextColor(GxEPD_WHITE); display.setTextColor(GxEPD_WHITE);
display.setCursor(20, 30); display.setCursor(0, 20);
display.println("Battery Voltage:");
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(); float voltage = getBatteryVoltage();
display.setCursor(70, 80);
display.print(voltage); display.print(voltage);
display.println("V"); display.println("V");
display.display(false); //full refresh display.display(false); //full refresh
guiState = APP_STATE; guiState = APP_STATE;

View File

@ -54,7 +54,7 @@ class Watchy {
void handleButtonPress(); void handleButtonPress();
void showMenu(byte menuIndex, bool partialRefresh); void showMenu(byte menuIndex, bool partialRefresh);
void showFastMenu(byte menuIndex); void showFastMenu(byte menuIndex);
void showBattery(); void showAbout();
void showBuzz(); void showBuzz();
void showAccelerometer(); void showAccelerometer();
void showUpdateFW(); void showUpdateFW();

View File

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

View File

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