Compare commits

...

8 Commits

Author SHA1 Message Date
bushmango a67f92071a
Merge 2aebb46823 into 667d86737d 2024-04-15 13:59:32 +01:00
SQFMI 667d86737d
Update main.actions.yml 2024-04-03 16:15:58 -04:00
SQFMI d65738fbaa
Update main.actions.yml 2024-04-03 16:09:29 -04:00
SQFMI 2dd98737fb
Update main.actions.yml 2024-04-03 16:08:09 -04:00
SQFMI 5a5b343737
fix path in GH actions 2024-04-03 15:57:14 -04:00
sqfmi 2da3fd9ede add board revision function 2024-04-03 15:10:09 -04:00
SQFMI acbb6eeece
Compile for different board revisions 2024-04-03 14:55:30 -04:00
Unknown 2aebb46823 basic button support 2022-05-11 17:33:32 -05:00
6 changed files with 67 additions and 7 deletions

View File

@ -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 }}"

View File

@ -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": [
{

View File

@ -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

View File

@ -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);

View File

@ -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();

View File

@ -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)