mirror of https://github.com/sqfmi/Watchy.git
Compare commits
8 Commits
d76f1009c2
...
a67f92071a
Author | SHA1 | Date |
---|---|---|
bushmango | a67f92071a | |
SQFMI | 667d86737d | |
SQFMI | d65738fbaa | |
SQFMI | 2dd98737fb | |
SQFMI | 5a5b343737 | |
sqfmi | 2da3fd9ede | |
SQFMI | acbb6eeece | |
Unknown | 2aebb46823 |
|
@ -7,14 +7,31 @@ jobs:
|
|||
release:
|
||||
name: Build and Release
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
board-revisions: [v10, v15, v20]
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: ArminJo/arduino-test-compile@v3
|
||||
with:
|
||||
arduino-board-fqbn: esp32:esp32:watchy:Revision=v20,PartitionScheme=min_spiffs,UploadSpeed=921600,DebugLevel=none,EraseFlash=none
|
||||
arduino-board-fqbn: esp32:esp32:watchy:Revision=${{ matrix.board-revisions }},PartitionScheme=min_spiffs,UploadSpeed=921600,DebugLevel=none,EraseFlash=none
|
||||
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
|
||||
required-libraries: Adafruit GFX Library,Arduino_JSON,DS3232RTC,NTPClient,Rtc_Pcf8563,GxEPD2,WiFiManager
|
||||
set-build-path: true
|
||||
- name: Rename binaries with board revision
|
||||
run: |
|
||||
parent_dir="${{ github.workspace }}/examples/WatchFaces"
|
||||
for dir in "$parent_dir"/*; do
|
||||
if [ -d "$dir" ]; then
|
||||
cd "$dir/build"
|
||||
for file in *; do
|
||||
name="${file%%.*}"
|
||||
ext="${file#$name.}"
|
||||
mv "$file" "$name-${{ matrix.board-revisions }}.$ext"
|
||||
done
|
||||
cd -
|
||||
fi
|
||||
done
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
name: "Watchy Arduino Library ${{ github.ref_name }}"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Watchy",
|
||||
"version": "1.4.9",
|
||||
"version": "1.4.10",
|
||||
"description": "Watchy - An Open Source E-Paper Watch by SQFMI",
|
||||
"authors": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name=Watchy
|
||||
version=1.4.9
|
||||
version=1.4.10
|
||||
author=SQFMI
|
||||
maintainer=SQFMI
|
||||
sentence=Watchy - An Open Source E-Paper Watch by SQFMI
|
||||
|
|
|
@ -134,6 +134,7 @@ void Watchy::handleButtonPress() {
|
|||
} else if (guiState == FW_UPDATE_STATE) {
|
||||
showMenu(menuIndex, false); // exit to menu if already in app
|
||||
} else if (guiState == WATCHFACE_STATE) {
|
||||
button1();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -146,6 +147,7 @@ void Watchy::handleButtonPress() {
|
|||
}
|
||||
showMenu(menuIndex, true);
|
||||
} else if (guiState == WATCHFACE_STATE) {
|
||||
button2();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -158,6 +160,7 @@ void Watchy::handleButtonPress() {
|
|||
}
|
||||
showMenu(menuIndex, true);
|
||||
} else if (guiState == WATCHFACE_STATE) {
|
||||
button3();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -315,9 +318,8 @@ void Watchy::showAbout() {
|
|||
display.print("LibVer: ");
|
||||
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("Rev: v");
|
||||
display.println(getBoardRevision());
|
||||
|
||||
display.print("Batt: ");
|
||||
float voltage = getBatteryVoltage();
|
||||
|
@ -625,6 +627,17 @@ void Watchy::drawWatchFace() {
|
|||
display.println(currentTime.Minute);
|
||||
}
|
||||
|
||||
void Watchy::button1()
|
||||
{
|
||||
}
|
||||
void Watchy::button2()
|
||||
{
|
||||
}
|
||||
void Watchy::button3()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
weatherData Watchy::getWeatherData() {
|
||||
return _getWeatherData(settings.cityID, settings.lat, settings.lon,
|
||||
settings.weatherUnit, settings.weatherLang, settings.weatherURL,
|
||||
|
@ -702,6 +715,31 @@ float Watchy::getBatteryVoltage() {
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t Watchy::getBoardRevision() {
|
||||
esp_chip_info_t chip_info;
|
||||
esp_chip_info(&chip_info);
|
||||
if(chip_info.model == CHIP_ESP32){ //Revision 1.0 - 2.0
|
||||
Wire.beginTransmission(0x68); //v1.0 has DS3231
|
||||
if (Wire.endTransmission() == 0){
|
||||
return 10;
|
||||
}
|
||||
delay(1);
|
||||
Wire.beginTransmission(0x51); //v1.5 and v2.0 have PCF8563
|
||||
if (Wire.endTransmission() == 0){
|
||||
pinMode(35, INPUT);
|
||||
if(digitalRead(35) == 0){
|
||||
return 20; //in rev 2.0, pin 35 is BTN 3 and has a pulldown
|
||||
}else{
|
||||
return 15; //in rev 1.5, pin 35 is the battery ADC
|
||||
}
|
||||
}
|
||||
}
|
||||
if(chip_info.model == CHIP_ESP32S3){ //Revision 3.0
|
||||
return 30;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint16_t Watchy::_readRegister(uint8_t address, uint8_t reg, uint8_t *data,
|
||||
uint16_t len) {
|
||||
Wire.beginTransmission(address);
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "BLE.h"
|
||||
#include "bma.h"
|
||||
#include "config.h"
|
||||
#include "esp_chip_info.h"
|
||||
|
||||
typedef struct weatherData {
|
||||
int8_t temperature;
|
||||
|
@ -56,6 +57,7 @@ public:
|
|||
void init(String datetime = "");
|
||||
void deepSleep();
|
||||
float getBatteryVoltage();
|
||||
uint8_t getBoardRevision();
|
||||
void vibMotor(uint8_t intervalMs = 100, uint8_t length = 20);
|
||||
|
||||
virtual void handleButtonPress();
|
||||
|
@ -78,6 +80,9 @@ public:
|
|||
void showWatchFace(bool partialRefresh);
|
||||
virtual void drawWatchFace(); // override this method for different watch
|
||||
// faces
|
||||
virtual void button1(); // override these methods to handle different non-menu button presses
|
||||
virtual void button2();
|
||||
virtual void button3();
|
||||
|
||||
private:
|
||||
void _bmaConfig();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define CONFIG_H
|
||||
|
||||
// Versioning
|
||||
#define WATCHY_LIB_VER "1.4.9"
|
||||
#define WATCHY_LIB_VER "1.4.10"
|
||||
|
||||
//pins
|
||||
#if !defined(ARDUINO_WATCHY_V10) && !defined(ARDUINO_WATCHY_V15) && !defined(ARDUINO_WATCHY_V20)
|
||||
|
|
Loading…
Reference in New Issue