Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.18.0 🎉 #425

Merged
merged 60 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
bcde413
Resize Time and Date data type size
RuffaloLavoisier Oct 23, 2024
160a01c
workflows: upload firmware binary
RuffaloLavoisier Nov 22, 2024
752ef0a
workflows: upload firmware binary (#419)
RuffaloLavoisier Nov 24, 2024
d3eec13
workflows: upgrade artifact version to v4
RuffaloLavoisier Dec 11, 2024
db0ecc2
workflows: rename artifact to specific model type
RuffaloLavoisier Dec 11, 2024
2cc0a02
workflows: upgrade artifact version to v4 (#420)
RuffaloLavoisier Dec 11, 2024
02a65b8
corrected troubleshooting link
simonmicro Jan 11, 2025
0cb87ae
Reimplemented display+bl init order to prevent flashing
simonmicro Jan 11, 2025
d78edf0
Interaction on unlocked console also counts as user interaction
simonmicro Jan 11, 2025
f4041b7
Also reset fonts upon redraw
simonmicro Jan 11, 2025
d2512c8
Toast on default watchface change
simonmicro Jan 11, 2025
3117ea3
Added "dd/mm/yyyy" as date format
simonmicro Jan 11, 2025
0bc41af
Add note how to use default buttons
simonmicro Jan 11, 2025
f3e07c5
Fixed select button bug on analog+fitness watchface
simonmicro Jan 11, 2025
ed032c9
OswAppWatchfaceDigital: resize date type
RuffaloLavoisier Jan 11, 2025
ea1b121
Resize time data type for time structure
RuffaloLavoisier Jan 11, 2025
97fe4ed
Resize Time/Date date type (#401)
simonmicro Jan 11, 2025
7c1f12d
Fixed broken time on watchface
simonmicro Jan 11, 2025
db03a2c
A few bugs and minor issues (#423)
simonmicro Jan 12, 2025
8d58087
Added BLE server task
simonmicro May 19, 2024
05672fe
Free memory before enabling the webserver
simonmicro May 19, 2024
aeca104
Added new BLE enable-on-boot setting
simonmicro May 19, 2024
323422e
Added OSW_FEATURE_BLE_SERVER
simonmicro May 19, 2024
0b08d8d
Fixed compile problem of BLE without WIFI
simonmicro May 19, 2024
ea42c24
Fixed crash due to stack limit reached
simonmicro May 19, 2024
739cce8
Added "Battery Level Status"
simonmicro May 19, 2024
c4f5849
Added current time service
simonmicro May 19, 2024
c85b06f
Added device information BLE service
simonmicro May 19, 2024
35d3242
Fixed NimBLE shutdown
simonmicro May 19, 2024
02c7c83
Enable hostname also with BLE
simonmicro May 19, 2024
55f970c
Added BLE mode to console
simonmicro May 19, 2024
8567ed9
Secure BLE server
simonmicro May 20, 2024
429eaf4
Fixed colliding pin definition problems
simonmicro May 20, 2024
a939e3f
Redraw on nitification change
simonmicro May 20, 2024
117a265
Added shorthand to toast
simonmicro May 20, 2024
0ae1b21
Added toast support for BLE esrver
simonmicro May 20, 2024
16d071c
Added untested notice
simonmicro May 20, 2024
3e62d39
Allow dynamic-height notifications
simonmicro May 20, 2024
af4f53f
Added toast command to console
simonmicro May 20, 2024
d5562a4
Typo
simonmicro May 20, 2024
f06ff6f
Added custom OSW service for toasts
simonmicro May 20, 2024
10f2cc9
Added missing include
simonmicro May 20, 2024
416b7a2
BLE: add step count service
RuffaloLavoisier Oct 7, 2024
aa12970
get step history array
RuffaloLavoisier Oct 23, 2024
ef97a94
Rename bytes value to feature part
RuffaloLavoisier Nov 13, 2024
ed60469
Also rename bytes value to feature part
RuffaloLavoisier Nov 13, 2024
12bf426
OswServiceTaskBLEServer: fix typo lower case on random uuid
RuffaloLavoisier Jan 11, 2025
b0991cf
OswServiceTaskBLEServer: fix data type comments
RuffaloLavoisier Jan 11, 2025
12f0afa
OswServiceTaskBLEServer: remove comment
RuffaloLavoisier Jan 11, 2025
729e9d9
Fixed changed date/time interface
simonmicro Jan 11, 2025
0c91430
Typo
simonmicro Jan 11, 2025
a47acab
Follow offset getter pattern
simonmicro Jan 12, 2025
6014ee9
Address comment requesting better define-names
simonmicro Jan 12, 2025
1590abd
Label magic time-per-line durations
simonmicro Jan 12, 2025
377a086
Added comment explaining what the for-loop does
simonmicro Jan 12, 2025
37b4cc5
Implemented basic BLE server (#424)
simonmicro Jan 12, 2025
6531f79
Applied formatting
actions-user Jan 12, 2025
c323002
Address review comments
simonmicro Jan 13, 2025
a6ba489
Fix compile waring
RuffaloLavoisier Jan 12, 2025
9478a8e
Address review comment: Use new OswDate/OswTime in watchfaces
simonmicro Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-EMULATOR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ jobs:
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
name: test-results-${{ matrix.build-configuration }}
path: |
build/Testing
5 changes: 5 additions & 0 deletions .github/workflows/test-OS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@ jobs:
run: mv include/config.h.example include/config.h
- name: Compile language ${{ matrix.language }} model ${{ matrix.model }}
run: python3 .github/buildFirmware.py -l "${{ matrix.language }}" -m "${{ matrix.model }}" -b debug
- name: Upload ${{ matrix.os }} firmware artifacts
uses: actions/upload-artifact@v4
with:
name: firmwares-${{ matrix.os }}-${{ matrix.language }}-${{ matrix.model }}
path: "*.bin"
10 changes: 5 additions & 5 deletions .github/workflows/test-OSW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ jobs:
- name: Compile language ${{ matrix.language }} model ${{ matrix.model }}
run: python3 .github/buildFirmware.py -l "${{ matrix.language }}" -m "${{ matrix.model }}" -b "${{ matrix.build-configuration }}"
- name: Upload firmware artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: firmwares
name: firmwares-${{ matrix.language }}-${{ matrix.model }}-${{ matrix.build-configuration }}
path: "*.bin"

# do this last step seperately to avoid race conditions with firmware upload
Expand All @@ -96,14 +96,14 @@ jobs:
needs: build-OSW
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
pattern: "*.bin"
pattern: firmwares*
merge-multiple: true
- name: Create release and upload firmware to it
uses: softprops/action-gh-release@v2
with:
files: "firmwares/*.bin"
files: "*.bin"
draft: true
prerelease: true
generate_release_notes: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ $ ./createScreenshot.sh <IP_OF_WATCH> <SCREENSHOT>

## Troubleshooting

For more information on troubleshooting, see [Wiki](https://open-smartwatch.github.io/resources/firmware/#troubleshooting).
For more information on troubleshooting, see [Wiki](https://open-smartwatch.github.io/firmware/troubleshooting/).

### Arduino_TFT.h: No such file or directory

Expand Down
2 changes: 2 additions & 0 deletions docs/firmware/apps/watchfaces.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Watchfaces

## Default
!!! tip
On most watchfaces, you can control the screen brightness by pressing the `UP` and `DOWN` buttons and store it quickly as default by long-pressing the `DOWN` button.

### Analog

Expand Down
1 change: 1 addition & 0 deletions docs/firmware/flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The table below list all currently available features of the OSW-OS. These featu
| `OSW_FEATURE_STATS_STEPS` | Enable step history (displayed on the watchfaces) | - |
| `OSW_FEATURE_WIFI` | Enable all wifi related functions (services, webinterface) | - |
| `OSW_FEATURE_WIFI_ONBOOT` | Allow the user to enable the wifi on boot | `OSW_FEATURE_WIFI` |
| `OSW_FEATURE_BLE_SERVER` | Enable BLE server for the watch | - |
| `OSW_FEATURE_BLE_MEDIA_CTRL` | Enables media control via BLE | - |
| `OSW_FEATURE_LUA` | Enable LUA scripting support for apps | `LUA_C89_NUMBERS` |
| `SERVICE_BLE_COMPANION=1` | Enables the BLE Companion Service (unstable, requires custom smartphone application) | - |
Expand Down
6 changes: 3 additions & 3 deletions include/apps/watchfaces/OswAppWatchfaceDigital.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class OswAppWatchfaceDigital: public OswAppV2 {
void onDraw() override;
void onButton(Button id, bool up, ButtonStateNames state) override;

inline static uint8_t getDateFormat(); // Return 0 : mm/dd/yyyy 1 : dd.mm.yyyy 2 : yy.mm/dd
inline static uint8_t getDateFormat();
static void refreshDateFormatCache();
static void drawSteps();
static void digitalWatch(short timeZone, uint8_t fontSize, uint8_t dateCoordY, uint8_t timeCoordY);
static void timeOutput(uint32_t hour, uint32_t minute, uint32_t second, bool showSecond = true);
static void dateOutput(uint32_t yearInt, uint32_t monthInt, uint32_t dayInt);
static void timeOutput(uint8_t hour, uint8_t minute, uint8_t second, bool showSecond = true);
static void dateOutput(uint16_t yearInt, uint8_t monthInt, uint8_t dayInt);
static void displayWeekDay3(const char* weekday);

private:
Expand Down
4 changes: 2 additions & 2 deletions include/apps/watchfaces/OswAppWatchfaceFitnessAnalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class OswAppWatchfaceFitnessAnalog : public OswAppV2 {
unsigned screen = 0;

void showFitnessTracking(OswHal* hal);
void drawWatchFace(OswHal* hal, uint32_t hour, uint32_t minute, uint32_t second, bool afterNoon);
void drawDateFace(OswHal* hal, uint32_t hour, uint32_t minute, uint32_t second, bool afterNoon);
void drawWatchFace(OswHal* hal, uint8_t hour, uint8_t minute, uint8_t second, bool afterNoon);
void drawDateFace(OswHal* hal, uint8_t hour, uint8_t minute, uint8_t second, bool afterNoon);

#ifdef GIF_BG
OswAppGifPlayer* bgGif = nullptr;
Expand Down
12 changes: 9 additions & 3 deletions include/config_defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
#define CONFIG_FALLBACK_2ND_WIFI_PASS ""
#endif

#ifndef BLE_ON_BOOT
#define BLE_ON_BOOT false
#endif

#ifndef DISPLAY_BRIGHTNESS
// DISPLAY_MIN_BRIGHTNESS - 255
#define DISPLAY_BRIGHTNESS 128
Expand Down Expand Up @@ -174,7 +178,7 @@
// The following settings are configurable later on using the web ui, you can still set the defaults here.

#ifndef CONFIG_DATE_FORMAT
// possibilities: "mm/dd/yyyy","dd.mm.yyyy" and "yy.mm/dd"
// see src/osw_config_keys.cpp for possible values (look for this define in the file)
#define CONFIG_DATE_FORMAT "mm/dd/yyyy"
#endif

Expand Down Expand Up @@ -238,8 +242,10 @@
#define TOOL_TIMER_BTN_TIMEOUT 1800
#endif

/*
* Experimentals/Services:
/**
* Experimentals/Services
*
* Keep in mind, that the OSW may not be tested with these flags (un)set. Be prepared to fix some bugs ;)
*/

// Experimentals (1 = enable, 0 = disable):
Expand Down
2 changes: 1 addition & 1 deletion include/gfx_2d_print.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ class Graphics2DPrint : public Graphics2D, public Print {
* @brief Set the text size.
*
* Size "1" mean a size of 8px height and 6 px width.
* Size "2" mean a double size => 18px height x 12px width
* Size "2" mean a double size => 16px height x 12px width
*
* @param s Size of the text
*/
Expand Down
3 changes: 3 additions & 0 deletions include/locales/de-DE.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
#define LANG_WEBSRV_AP_PASSWORD_ON "AutoAP PW an"
#define LANG_WEBSRV_AP_PASSWORD_OFF "AutoAP PW aus"

// App: Watchface Parent Class
#define LANG_WATCHFACE_DEFAULT_SET "Standard Uhr Design\ngespeichert."

// App: Watchface Binary
#define LANG_WATCHFACE_BINARY_STEPS "Schritte"

Expand Down
5 changes: 5 additions & 0 deletions include/locales/en-US.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@
#define LANG_WEBSRV_AP_PASSWORD_OFF "AutoAP PW OFF"
#endif

// App: Watchface Parent Class
#ifndef LANG_WATCHFACE_DEFAULT_SET
#define LANG_WATCHFACE_DEFAULT_SET "Default watchface\nchanged."
#endif

// App: Watchface Binary
#ifndef LANG_WATCHFACE_BINARY_STEPS
#define LANG_WATCHFACE_BINARY_STEPS "steps"
Expand Down
7 changes: 6 additions & 1 deletion include/osw_config_keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ class OswConfigKeyRGB;

// All externally accessible keys are listed here (add them to osw_config_keys.cpp oswConfigKeys for config ui)
namespace OswConfigAllKeys {
#ifdef OSW_FEATURE_WIFI
#if defined(OSW_FEATURE_WIFI) || defined(OSW_FEATURE_BLE_SERVER)
extern OswConfigKeyString hostname;
#endif
#ifdef OSW_FEATURE_WIFI
extern OswConfigKeyBool hostPasswordEnabled;
extern OswConfigKeyPassword hostPass;
#ifdef OSW_FEATURE_WIFI_ONBOOT
Expand All @@ -40,6 +42,9 @@ extern OswConfigKeyPassword fallbackWifiPass1st;
extern OswConfigKeyString fallbackWifiSsid2nd;
extern OswConfigKeyPassword fallbackWifiPass2nd;
#endif
#ifdef OSW_FEATURE_BLE_SERVER
extern OswConfigKeyBool bleBootEnabled;
#endif
extern OswConfigKeyRGB themeBackgroundColor;
extern OswConfigKeyRGB themeBackgroundDimmedColor;
extern OswConfigKeyRGB themeForegroundColor;
Expand Down
17 changes: 9 additions & 8 deletions include/osw_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
#define ERR_SD_MOUNT_FAILED 2

typedef struct {
uint32_t hour;
uint32_t minute;
uint32_t second;
uint8_t hour;
uint8_t minute;
uint8_t second;
bool afterNoon;
} OswTime;

typedef struct {
uint32_t year;
uint32_t month;
uint32_t day;
uint32_t weekDay;
uint16_t year;
uint8_t month;
uint8_t day;
uint8_t weekDay;
} OswDate;

class OswHal {
Expand Down Expand Up @@ -79,14 +79,15 @@ class OswHal {
void setup(bool fromLightSleep);
void setupFileSystem(void);
void setupButtons();
void setupDisplay();
void setupDisplay(bool fromLightSleep);
void setupPower(bool fromLightSleep);
#if defined(GPS_EDITION) || defined(GPS_EDITION_ROTATED)
void setupGps(void);
#endif

// Stop
void stop(bool toLightSleep);
void stopDisplay(bool toLightSleep);
void stopPower();

// Buttons (Engine-Style)
Expand Down
8 changes: 2 additions & 6 deletions include/osw_pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// SD_MISO 19
// for SCK, MOSI see TFT

#define GPS_RX 14
#define GPS_TX 27
#define GPS_RX 27
#define GPS_TX 14
#define GPS_FON 26
#define GPS_3D_FIX 36
#define GPS_GEO_FENCE 39
Expand All @@ -16,14 +16,10 @@
#define BTN_1 0
#define BTN_2 13
#define BTN_3 33
#define GPS_RX1 27
#define GPS_TX1 14
#elif defined(GPS_EDITION_ROTATED)
#define BTN_1 13
#define BTN_2 33
#define BTN_3 0
#define GPS_RX1 27
#define GPS_TX1 14
#else
#define BTN_1 0
#define BTN_2 13
Expand Down
16 changes: 14 additions & 2 deletions include/osw_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,26 @@ class OswUI {
return message;
}

unsigned char getMessageLines() const {
return lines;
}

unsigned long getEndTime() const {
return endTime;
}

const static unsigned char sDrawHeight = 16; // EVERY notification must not be taller than this!
unsigned char getDrawHeight() const;

private:
size_t id{};
unsigned char countLines(const std::string& message) const;

const unsigned long notificationDurationPerLinePersistant = 300'000;
const unsigned long notificationDurationPerLine = 5'000;

static size_t count;
const size_t id{};
const String message{};
const unsigned char lines;
const unsigned long endTime{};
};

Expand Down Expand Up @@ -87,6 +97,7 @@ class OswUI {
size_t showNotification(std::string message, bool isPersistent);
void hideNotification(size_t id);

void resetTextFont();
void resetTextColors();
void resetTextAlignment();
void setTextCursor(Button btn);
Expand All @@ -109,6 +120,7 @@ class OswUI {
unsigned int lastBGFlush = 0;
std::mutex mNotificationsLock;
std::list<OswUINotification> mNotifications;
bool mSelfNeedsRedraw = false;
OswAppV2* mRootApplication = nullptr;
};

Expand Down
2 changes: 2 additions & 0 deletions include/services/NotifierClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class NotifierClient {
NotificationData createNotification(int hours, int minutes,
std::string message = {}, std::array<bool, 7> daysOfWeek = {}, bool isPersistent = {});

NotificationData showToast(std::string message);

std::vector<NotificationData> readNotifications();

void deleteNotification(unsigned id);
Expand Down
13 changes: 9 additions & 4 deletions include/services/OswServiceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ class OswServiceManager {
instance.reset();
}

//Temp workaround until #137 is done
// Temp workaround until #137 is done
#ifdef OSW_FEATURE_WIFI
#define _SERVICE_WIFI 1
#define _ADDITIONAL_STACK_SIZE_FOR_WIFI 8192
#else
#define _SERVICE_WIFI 0
#define _ADDITIONAL_STACK_SIZE_FOR_WIFI 0
#endif
const unsigned workerStackSize = 2048 + (8192 * _SERVICE_WIFI); // If wifi is active, set to same size as core 0
#ifdef OSW_FEATURE_BLE_SERVER
#define _ADDITIONAL_STACK_SIZE_FOR_BLE 2048
#else
#define _ADDITIONAL_STACK_SIZE_FOR_BLE 0
#endif
const unsigned workerStackSize = 2048 + _ADDITIONAL_STACK_SIZE_FOR_WIFI + _ADDITIONAL_STACK_SIZE_FOR_BLE; // base stack size is 2k
const unsigned workerStartupDelay = 2000;
const unsigned workerLoopDelay = 10;

Expand Down
6 changes: 2 additions & 4 deletions include/services/OswServiceTaskBLECompanion.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#ifndef OSW_SERVICE_COMPANION_H
#define OSW_SERVICE_COMPANION_H
#pragma once

#ifndef OSW_EMULATOR
#if SERVICE_BLE_COMPANION == 1
#ifndef OSW_EMULATOR
#include <BLECharacteristic.h>
#include <BLEDevice.h>
#include <osw_hal.h>
Expand Down Expand Up @@ -45,4 +44,3 @@ class OswServiceTaskBLECompanion : public OswServiceTask {

#endif
#endif
#endif
Loading