Compare commits
No commits in common. "a9a36793ad23be8b672f901be7be8d925fae7678" and "3a0d673df420411a4db3a2acf57d04436446430c" have entirely different histories.
a9a36793ad
...
3a0d673df4
5
.github/workflows/main.yml
vendored
|
@ -56,11 +56,6 @@ jobs:
|
|||
with:
|
||||
name: InfiniTime MCUBoot image ${{ github.head_ref }}
|
||||
path: ./build/output/pinetime-mcuboot-app-image-*.bin
|
||||
- name: Upload standalone ELF artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: InfiniTime image ${{ github.head_ref }}
|
||||
path: ./build/output/src/pinetime-app-*.out
|
||||
- name: Upload resources artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
|
|
@ -9,8 +9,6 @@ Fast open-source firmware for the [PineTime smartwatch](https://pine64.org/devic
|
|||
- [Getting started with InfiniTime](doc/gettingStarted/gettingStarted-1.0.md)
|
||||
- [Updating the software](doc/gettingStarted/updating-software.md)
|
||||
- [About the firmware and bootloader](doc/gettingStarted/about-software.md)
|
||||
- [Available apps](doc/gettingStarted/Applications.md)
|
||||
- [Available watch faces](/doc/gettingStarted/Watchfaces.md)
|
||||
- [PineTimeStyle Watch face](https://pine64.org/documentation/PineTime/Watchfaces/PineTimeStyle)
|
||||
- [Weather integration](https://pine64.org/documentation/PineTime/Software/InfiniTime_weather/)
|
||||
|
||||
|
@ -37,7 +35,7 @@ Fast open-source firmware for the [PineTime smartwatch](https://pine64.org/devic
|
|||
|
||||
### Contributing
|
||||
|
||||
- [How to contribute](CONTRIBUTING.md)
|
||||
- [How to contribute?](CONTRIBUTING.md)
|
||||
- [Coding conventions](doc/coding-convention.md)
|
||||
|
||||
### Build, flash and debug
|
||||
|
|
10
default.nix
|
@ -1,10 +0,0 @@
|
|||
(import
|
||||
(
|
||||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
|
||||
fetchTarball {
|
||||
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}
|
||||
)
|
||||
{ src = ./.; }
|
||||
).defaultNix
|
|
@ -1,99 +0,0 @@
|
|||
# Applications
|
||||
|
||||
InfiniTime has 13 apps on the `main` branch at the time of writing.
|
||||
|
||||
## List of apps
|
||||
- Stopwatch
|
||||
- Alarm
|
||||
- Timer
|
||||
- Steps
|
||||
- Heartrate
|
||||
- Music
|
||||
- InfiniPaint
|
||||
- Paddle
|
||||
- 2
|
||||
- InfiniDice
|
||||
- Metronome
|
||||
- Maps
|
||||
- Weather
|
||||
|
||||
### Stopwatch
|
||||
![Stopwatch UI](/doc/gettingStarted/AppsScreenshots/stopwatch.png)
|
||||
- Press the Start button (bottom right) to start or stop the timer.
|
||||
- You can also press the side button while the timer is running to pause the timer.
|
||||
- Press the Flag button (bottom left) to add a lap.
|
||||
- The stopwatch will not yet continue counting time while the app is closed.
|
||||
|
||||
### Alarm
|
||||
![Alarm UI](/doc/gettingStarted/AppsScreenshots/alarm.png)
|
||||
- Ajust the time with the time picker.
|
||||
- Press the Info button in the top middle to see time remaning.
|
||||
- Use the toggle in the bottom left to turn the alarm on/off.
|
||||
- Use the button in the bottom right to change the alarm frequency.
|
||||
- You can choose between once, daily, or Monday - Friday.
|
||||
|
||||
### Timer
|
||||
![Timer UI](/doc/gettingStarted/AppsScreenshots/timer.png)
|
||||
- Ajust how long the timer should go for with the time picker.
|
||||
- Press the Start button at the bottom to start/stop the timer.
|
||||
|
||||
### Steps
|
||||
![Steps UI](/doc/gettingStarted/AppsScreenshots/steps.png)
|
||||
- The total count of steps for the current display will show in the middle of the screen.
|
||||
- The Reset button in the bottom middle resets the Trip counter. (Total of all steps taken.)
|
||||
- The progress circle shows the percentage of your daily goal completed.
|
||||
|
||||
### Heartrate
|
||||
![Heartrate UI](/doc/gettingStarted/AppsScreenshots/Heartrate.png)
|
||||
- Press Start to start measuring your heartrate.
|
||||
- It may take a bit to get the first measurement.
|
||||
|
||||
### Music
|
||||
![Music UI](/doc/gettingStarted/AppsScreenshots/Music.png)
|
||||
- This app shows currently playing music.
|
||||
- Please note that this app is not very useful without a device connected.
|
||||
- Press the button in the center to play/pause, and the buttons on the left and right to go to the previous and next tracks, respectively.
|
||||
- Swipe up to get to volume controls.
|
||||
|
||||
### InfiniPaint
|
||||
![InfiniPaint UI](/doc/gettingStarted/AppsScreenshots/Paint.png)
|
||||
- This app does not allow you to swipe from the top to exit, use the side button instead.
|
||||
- Draw on the screen to add lines.
|
||||
- Hold down in one spot to change paint colors.
|
||||
|
||||
### Paddle
|
||||
![Paddle UI](/doc/gettingStarted/AppsScreenshots/Pong.png)
|
||||
- This app does not allow you to swipe from the top to exit, use the side button instead.
|
||||
- Drag your finger to move the paddle.
|
||||
- Goal: Don't let the ball go off the left side of the screen.
|
||||
|
||||
### 2
|
||||
![2 UI](/doc/gettingStarted/AppsScreenshots/2048.png)
|
||||
- This app does not allow you to swipe from the top to exit, use the side button instead.
|
||||
- Play a game of 2048.
|
||||
- Swipe up, down, left, or right tomove the tiles.
|
||||
- When two tiles with the same number run into each other, they will add together.
|
||||
- Goal: Don't let the screen fill up with tiles, and get to the 2048 tile to win.
|
||||
|
||||
### InfiniDice
|
||||
![InfiniDice UI](/doc/gettingStarted/AppsScreenshots/Dice.png)
|
||||
- Ajust the count to change the number of dice.
|
||||
- Ajust the sides to change the number of sides.
|
||||
- Press the button at the bottom to roll.
|
||||
- The result will be on the right side of the screen.
|
||||
|
||||
### Metronome
|
||||
![Metronome UI](/doc/gettingStarted/AppsScreenshots/Metronome.png)
|
||||
- Ajust the BPM with the circular slider.
|
||||
- A bug currently makes it always snap to 98 BPM.
|
||||
- Use the button in the bottom left to start the metronome.
|
||||
|
||||
### Maps
|
||||
![Maps UI](/doc/gettingStarted/AppsScreenshots/Maps.png)
|
||||
- This app shows info from a navigation app.
|
||||
- Please note that this app is not very useful without a device connected.
|
||||
|
||||
### Weather
|
||||
![Weather UI](/doc/gettingStarted/AppsScreenshots/Weather.png)
|
||||
- This app shows weather info.
|
||||
- Please note that this app is not very useful without a device connected.
|
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 5 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.4 KiB |
|
@ -1,31 +0,0 @@
|
|||
# Watchfaces
|
||||
|
||||
InfiniTime has 6 apps on the `main` branch at the time of writing.
|
||||
|
||||
## List of apps
|
||||
- Digital
|
||||
- Analog
|
||||
- PineTimeStyle
|
||||
- Terminal
|
||||
- Infinineat
|
||||
- Casio G7710
|
||||
|
||||
### Digital
|
||||
![Digital face](/doc/gettingStarted/Watchfaces/Digital.png)
|
||||
|
||||
### Analog
|
||||
![Analog face](/doc/gettingStarted/Watchfaces/Analog.png)
|
||||
|
||||
### PineTimeStyle
|
||||
![PineTimeStyle face](/doc/gettingStarted/Watchfaces/PineTimeStyle.png)
|
||||
- You can long-press on the display to change colors, step style, and weather.
|
||||
|
||||
### Terminal
|
||||
![Terminal face](/doc/gettingStarted/Watchfaces/Terminal.png)
|
||||
|
||||
### Infinineat
|
||||
![Infinineat face](/doc/gettingStarted/Watchfaces/Infinineat.png)
|
||||
- You can long-press on the display to change colors.
|
||||
|
||||
### Casio G7710
|
||||
![Casio G7710 face](/doc/gettingStarted/Watchfaces/CasioG7710.png)
|
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 256 KiB After Width: | Height: | Size: 33 KiB |
|
@ -14,7 +14,7 @@ You can sync the time using companion apps.
|
|||
|
||||
- Gadgetbridge automatically synchronizes the time when you connect it to your watch. More information on Gadgetbridge [here](/doc/gettingStarted/ota-gadgetbridge.md)
|
||||
- [Sync the time with NRFConnect](/doc/gettingStarted/time-nrfconnect.md)
|
||||
- [Sync the time with your browser](https://hubmartin.github.io/WebBLEWatch/)
|
||||
- Sync the time with your browser https://hubmartin.github.io/WebBLEWatch/
|
||||
|
||||
You can also set the time in the settings without a companion app. (version >1.7.0)
|
||||
|
||||
|
@ -46,7 +46,7 @@ On the bottom right, you can see how many steps you have taken today.
|
|||
![Settings](ui/settings.jpg)
|
||||
|
||||
- Swipe **up** to display the application menus. Apps (stopwatch, music, step, games,...) can be started from this menu.
|
||||
- Swipe **down** to display the notification panel. Notifications sent by your companion app will be displayed here.
|
||||
- Swipe **down** to display the notification panel. Notification sent by your companion app will be displayed here.
|
||||
- Swipe **right** to display the Quick Actions menu. This menu allows you to
|
||||
- Set the brightness of the display
|
||||
- Start the **flashlight** app
|
||||
|
|
|
@ -1,35 +1,29 @@
|
|||
# Connecting to Gadgetbridge
|
||||
|
||||
Launch Gadgetbridge and tap on the menu button in the top left:
|
||||
Launch Gadgetbridge and tap on the **"+"** button on the bottom right to add a new device:
|
||||
|
||||
![Gadgetbridge 0](gadgetbridge0.jpg)
|
||||
|
||||
Press the "Connect new device" button:
|
||||
Wait for the scan to complete, your PineTime should be detected:
|
||||
|
||||
![Gadgetbridge 1](gadgetbridge1.jpg)
|
||||
|
||||
Your PineTime should appear on the list. Tap on it.
|
||||
|
||||
Tap on it. Gadgdetbridge will pair and connect to your device:
|
||||
|
||||
![Gadgetbridge 2](gadgetbridge2.jpg)
|
||||
|
||||
# Updating with Gadgetbridge
|
||||
|
||||
Now that Gadgetbridge is connected to your PineTime, press the three dots on the device card:
|
||||
Now that Gadgetbridge is connected to your PineTime, use a file browser application and find the DFU file (`pinetime-mcuboot-app-dfu-x.x.x.zip`) you downloaded previously. Tap on it and open it using the Gadgetbridge application/firmware installer:
|
||||
|
||||
![Gadgetbridge 3](gadgetbridge3.jpg)
|
||||
|
||||
Now press the "File Installer" button:
|
||||
Read the warning carefully and tap **Install**:
|
||||
|
||||
![Gadgetbridge 4](gadgetbridge4.jpg)
|
||||
|
||||
Select the firmware you downloaded (`pinetime-mcuboot-app-dfu-x.x.x.zip`) from the [Releases tab](https://github.com/InfiniTimeOrg/InfiniTime/releases/latest):
|
||||
Wait for the transfer to finish. Your PineTime should reset and reboot with the new version of InfiniTime!
|
||||
|
||||
Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used.
|
||||
|
||||
![Gadgetbridge 5](gadgetbridge5.jpg)
|
||||
|
||||
Wait for the transfer to finish. There will be a progress bar on both the watch and the phone. Your PineTime should reboot with the new version of InfiniTime!
|
||||
|
||||
Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and scroll to the Firmware option and click **validate**. Otherwise, after reboot the previous firmware will be used.
|
||||
|
||||
![Validate](validate.png)
|
||||
|
|
|
@ -6,7 +6,7 @@ If you just want to flash or upgrade InfiniTime on your PineTime, this page is f
|
|||
|
||||
You can check the InfiniTime version by first swiping right on the watch face to open quick settings, tapping the cogwheel to open settings, swipe up until you find an entry named "About" and tap on it.
|
||||
|
||||
![InfiniTime 1.14 version](version.png)
|
||||
![InfiniTime 1.0 version](version-1.0.jpg)
|
||||
|
||||
PineTimes shipped after June 2021 will ship with the latest version of [the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/tag/1.0.0) and [recovery firmware](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1)
|
||||
|
||||
|
@ -49,7 +49,7 @@ Since those resources are not part of the firmware, they need to be flashed and
|
|||
Resources are packaged into a single .zip file named `infinitime-resources-x.y.z.zip` (where `x`, `y` and `z` are the version numbers of InfiniTime).
|
||||
You can use the companion app of your choice to flash the resources.
|
||||
|
||||
**Note: at the time of writing this page, [Amazfish](https://github.com/piggz/harbour-amazfish) and [ITD](https://gitea.arsenm.dev/Arsen6331/itd) have already integrated this functionality. Other companion apps will hopefully implement it soon!*
|
||||
**Note : at the time of writing this page, [Amazfish](https://github.com/piggz/harbour-amazfish) and [ITD](https://gitea.arsenm.dev/Arsen6331/itd) have already integrated this functionality. Other companion apps will hopefully implement it soon!*
|
||||
|
||||
## Amazfish
|
||||
Use the `Download file` functionality of Amazfish.
|
||||
|
|
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 3.7 KiB |
42
flake.lock
|
@ -1,42 +0,0 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"revCount": 57,
|
||||
"type": "tarball",
|
||||
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1725634671,
|
||||
"narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
113
flake.nix
|
@ -1,113 +0,0 @@
|
|||
{
|
||||
description = "A very basic flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
|
||||
};
|
||||
|
||||
outputs = { self, ... }@inputs:
|
||||
let
|
||||
forAllSystems = function:
|
||||
inputs.nixpkgs.lib.genAttrs [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
]
|
||||
(system: function (import inputs.nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
}));
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (pkgs:
|
||||
let
|
||||
infinitime-nrf5-sdk = pkgs.nrf5-sdk.overrideAttrs (old: {
|
||||
version = "15.3.0";
|
||||
src = pkgs.fetchzip {
|
||||
url = "https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/sdks/nrf5/binaries/nrf5sdk153059ac345.zip";
|
||||
sha256 = "sha256-pfmhbpgVv5x2ju489XcivguwpnofHbgVA7bFUJRTj08=";
|
||||
};
|
||||
});
|
||||
in
|
||||
with pkgs; {
|
||||
default = stdenv.mkDerivation rec {
|
||||
name = "infinitime";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "InfiniTimeOrg";
|
||||
repo = "InfiniTime";
|
||||
rev = "1.14.1";
|
||||
hash = "sha256-IrsN+9LgEjgfoRR6H7FhsdLMK+GLxc41IBnSbdpwv/E=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
nodePackages.lv_font_conv
|
||||
python3
|
||||
python3.pkgs.cbor
|
||||
python3.pkgs.click
|
||||
python3.pkgs.cryptography
|
||||
python3.pkgs.intelhex
|
||||
python3.pkgs.pillow
|
||||
adafruit-nrfutil
|
||||
patch
|
||||
git
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# /usr/bin/env is not available in the build sandbox
|
||||
substituteInPlace src/displayapp/fonts/generate.py --replace "'/usr/bin/env', 'patch'" "'patch'"
|
||||
substituteInPlace tools/mcuboot/imgtool.py --replace "/usr/bin/env python3" "${python3}/bin/python3"
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
''-DARM_NONE_EABI_TOOLCHAIN_PATH=${gcc-arm-embedded-10}''
|
||||
''-DNRF5_SDK_PATH=${infinitime-nrf5-sdk}/share/nRF5_SDK''
|
||||
''-DBUILD_DFU=1''
|
||||
''-DBUILD_RESOURCES=1''
|
||||
''-DCMAKE_SOURCE_DIR=${src}''
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
SOURCES_DIR=${src} BUILD_DIR=. OUTPUT_DIR=$out ./post_build.sh
|
||||
'';
|
||||
};
|
||||
});
|
||||
|
||||
devShells = forAllSystems (pkgs:
|
||||
let
|
||||
infinitime-nrf5-sdk = pkgs.nrf5-sdk.overrideAttrs (old: {
|
||||
version = "15.3.0";
|
||||
src = pkgs.fetchzip {
|
||||
url = "https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/sdks/nrf5/binaries/nrf5sdk153059ac345.zip";
|
||||
sha256 = "sha256-pfmhbpgVv5x2ju489XcivguwpnofHbgVA7bFUJRTj08=";
|
||||
};
|
||||
});
|
||||
in
|
||||
{
|
||||
default =
|
||||
pkgs.buildFHSUserEnv {
|
||||
name = "infinitime-devenv";
|
||||
# build tools
|
||||
targetPkgs = pkgs: (with pkgs; [
|
||||
cmake
|
||||
nodePackages.lv_font_conv
|
||||
python3
|
||||
python3.pkgs.cbor
|
||||
python3.pkgs.click
|
||||
python3.pkgs.cryptography
|
||||
python3.pkgs.intelhex
|
||||
adafruit-nrfutil
|
||||
|
||||
(pkgs.writeShellScriptBin "cmake_infinitime" ''
|
||||
cmake -DARM_NONE_EABI_TOOLCHAIN_PATH="${pkgs.gcc-arm-embedded-10}" \
|
||||
-DNRF5_SDK_PATH="${infinitime-nrf5-sdk}/share/nRF5_SDK" \
|
||||
"$@"
|
||||
'')
|
||||
]);
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
10
shell.nix
|
@ -1,10 +0,0 @@
|
|||
(import
|
||||
(
|
||||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
|
||||
fetchTarball {
|
||||
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}
|
||||
)
|
||||
{ src = ./.; }
|
||||
).shellNix
|
|
@ -860,6 +860,7 @@ target_compile_options(nrf-sdk PRIVATE
|
|||
$<$<CONFIG:RELEASE>: ${RELEASE_FLAGS}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>: ${CXX_FLAGS}>
|
||||
$<$<COMPILE_LANGUAGE:ASM>: ${ASM_FLAGS}>
|
||||
-O3
|
||||
)
|
||||
|
||||
# NimBLE
|
||||
|
|
|
@ -77,10 +77,6 @@ namespace Pinetime {
|
|||
uint16_t ComputeCrc(uint8_t const* p_data, uint32_t size, uint16_t const* p_crc);
|
||||
};
|
||||
|
||||
static constexpr ble_uuid128_t serviceUuid {
|
||||
.u {.type = BLE_UUID_TYPE_128},
|
||||
.value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, 0xDE, 0xEF, 0x12, 0x12, 0x30, 0x15, 0x00, 0x00}};
|
||||
|
||||
private:
|
||||
Pinetime::System::SystemTask& systemTask;
|
||||
Pinetime::Controllers::Ble& bleController;
|
||||
|
@ -94,6 +90,10 @@ namespace Pinetime {
|
|||
|
||||
uint16_t revision {0x0008};
|
||||
|
||||
static constexpr ble_uuid128_t serviceUuid {
|
||||
.u {.type = BLE_UUID_TYPE_128},
|
||||
.value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, 0xDE, 0xEF, 0x12, 0x12, 0x30, 0x15, 0x00, 0x00}};
|
||||
|
||||
static constexpr ble_uuid128_t packetCharacteristicUuid {
|
||||
.u {.type = BLE_UUID_TYPE_128},
|
||||
.value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, 0xDE, 0xEF, 0x12, 0x12, 0x32, 0x15, 0x00, 0x00}};
|
||||
|
|
|
@ -21,14 +21,14 @@ namespace Pinetime {
|
|||
void SubscribeNotification(uint16_t attributeHandle);
|
||||
void UnsubscribeNotification(uint16_t attributeHandle);
|
||||
|
||||
static constexpr uint16_t heartRateServiceId {0x180D};
|
||||
static constexpr ble_uuid16_t heartRateServiceUuid {.u {.type = BLE_UUID_TYPE_16}, .value = heartRateServiceId};
|
||||
|
||||
private:
|
||||
NimbleController& nimble;
|
||||
Controllers::HeartRateController& heartRateController;
|
||||
static constexpr uint16_t heartRateServiceId {0x180D};
|
||||
static constexpr uint16_t heartRateMeasurementId {0x2A37};
|
||||
|
||||
static constexpr ble_uuid16_t heartRateServiceUuid {.u {.type = BLE_UUID_TYPE_16}, .value = heartRateServiceId};
|
||||
|
||||
static constexpr ble_uuid16_t heartRateMeasurementUuid {.u {.type = BLE_UUID_TYPE_16}, .value = heartRateMeasurementId};
|
||||
|
||||
struct ble_gatt_chr_def characteristicDefinition[2];
|
||||
|
|
|
@ -158,10 +158,7 @@ void NimbleController::StartAdvertising() {
|
|||
}
|
||||
|
||||
fields.flags = BLE_HS_ADV_F_DISC_GEN | BLE_HS_ADV_F_BREDR_UNSUP;
|
||||
fields.uuids16 = &HeartRateService::heartRateServiceUuid;
|
||||
fields.num_uuids16 = 1;
|
||||
fields.uuids16_is_complete = 1;
|
||||
fields.uuids128 = &DfuService::serviceUuid;
|
||||
fields.uuids128 = &dfuServiceUuid;
|
||||
fields.num_uuids128 = 1;
|
||||
fields.uuids128_is_complete = 1;
|
||||
fields.tx_pwr_lvl = BLE_HS_ADV_TX_PWR_LVL_AUTO;
|
||||
|
|
|
@ -112,6 +112,10 @@ namespace Pinetime {
|
|||
uint16_t connectionHandle = BLE_HS_CONN_HANDLE_NONE;
|
||||
uint8_t fastAdvCount = 0;
|
||||
uint8_t bondId[16] = {0};
|
||||
|
||||
ble_uuid128_t dfuServiceUuid {
|
||||
.u {.type = BLE_UUID_TYPE_128},
|
||||
.value = {0x23, 0xD1, 0xBC, 0xEA, 0x5F, 0x78, 0x23, 0x15, 0xDE, 0xEF, 0x12, 0x12, 0x30, 0x15, 0x00, 0x00}};
|
||||
};
|
||||
|
||||
static NimbleController* nptr;
|
||||
|
|
|
@ -209,6 +209,21 @@ void DisplayApp::Refresh() {
|
|||
LoadScreen(returnAppStack.Pop(), returnDirection);
|
||||
};
|
||||
|
||||
auto DimScreen = [this]() {
|
||||
if (brightnessController.Level() != Controllers::BrightnessController::Levels::Off) {
|
||||
isDimmed = true;
|
||||
brightnessController.Set(Controllers::BrightnessController::Levels::Low);
|
||||
}
|
||||
};
|
||||
|
||||
auto RestoreBrightness = [this]() {
|
||||
if (brightnessController.Level() != Controllers::BrightnessController::Levels::Off) {
|
||||
isDimmed = false;
|
||||
lv_disp_trig_activity(nullptr);
|
||||
ApplyBrightness();
|
||||
}
|
||||
};
|
||||
|
||||
auto IsPastDimTime = [this]() -> bool {
|
||||
return lv_disp_get_inactive_time(nullptr) >= pdMS_TO_TICKS(settingsController.GetScreenTimeOut() - 2000);
|
||||
};
|
||||
|
@ -252,16 +267,14 @@ void DisplayApp::Refresh() {
|
|||
|
||||
if (!systemTask->IsSleepDisabled() && IsPastDimTime()) {
|
||||
if (!isDimmed) {
|
||||
isDimmed = true;
|
||||
brightnessController.Set(Controllers::BrightnessController::Levels::Low);
|
||||
DimScreen();
|
||||
}
|
||||
if (IsPastSleepTime()) {
|
||||
systemTask->PushMessage(System::Messages::GoToSleep);
|
||||
state = States::Idle;
|
||||
}
|
||||
} else if (isDimmed) {
|
||||
isDimmed = false;
|
||||
ApplyBrightness();
|
||||
RestoreBrightness();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -272,32 +285,23 @@ void DisplayApp::Refresh() {
|
|||
Messages msg;
|
||||
if (xQueueReceive(msgQueue, &msg, queueTimeout) == pdTRUE) {
|
||||
switch (msg) {
|
||||
case Messages::DimScreen:
|
||||
DimScreen();
|
||||
break;
|
||||
case Messages::GoToSleep:
|
||||
while (brightnessController.Level() != Controllers::BrightnessController::Levels::Low) {
|
||||
brightnessController.Lower();
|
||||
vTaskDelay(100);
|
||||
}
|
||||
// Turn brightness down (or set to AlwaysOn mode)
|
||||
// Don't actually turn off the display for AlwaysOn mode
|
||||
if (settingsController.GetAlwaysOnDisplay()) {
|
||||
brightnessController.Set(Controllers::BrightnessController::Levels::AlwaysOn);
|
||||
} else {
|
||||
brightnessController.Set(Controllers::BrightnessController::Levels::Off);
|
||||
}
|
||||
// Since the active screen is not really an app, go back to Clock.
|
||||
if (currentApp == Apps::Launcher || currentApp == Apps::Notifications || currentApp == Apps::QuickSettings ||
|
||||
currentApp == Apps::Settings) {
|
||||
LoadScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None);
|
||||
// Wait for the clock app to load before moving on.
|
||||
while (!lv_task_handler()) {
|
||||
};
|
||||
}
|
||||
// Turn LCD display off (or set to low power for AlwaysOn mode)
|
||||
if (settingsController.GetAlwaysOnDisplay()) {
|
||||
lcd.LowPowerOn();
|
||||
// Record idle entry time
|
||||
alwaysOnTickCount = 0;
|
||||
alwaysOnStartTime = xTaskGetTickCount();
|
||||
} else {
|
||||
brightnessController.Set(Controllers::BrightnessController::Levels::Off);
|
||||
lcd.Sleep();
|
||||
}
|
||||
PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping);
|
||||
|
@ -317,7 +321,8 @@ void DisplayApp::Refresh() {
|
|||
state = States::Running;
|
||||
break;
|
||||
case Messages::UpdateBleConnection:
|
||||
// Only used for recovery firmware
|
||||
// clockScreen.SetBleConnectionState(bleController.IsConnected() ? Screens::Clock::BleConnectionStates::Connected :
|
||||
// Screens::Clock::BleConnectionStates::NotConnected);
|
||||
break;
|
||||
case Messages::NewNotification:
|
||||
LoadNewScreen(Apps::NotificationsPreview, DisplayApp::FullRefreshDirections::Down);
|
||||
|
@ -432,11 +437,16 @@ void DisplayApp::Refresh() {
|
|||
case Messages::BleRadioEnableToggle:
|
||||
PushMessageToSystemTask(System::Messages::BleRadioEnableToggle);
|
||||
break;
|
||||
case Messages::UpdateDateTime:
|
||||
// Added to remove warning
|
||||
// What should happen here?
|
||||
break;
|
||||
case Messages::Chime:
|
||||
LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None);
|
||||
motorController.RunForDuration(35);
|
||||
break;
|
||||
case Messages::OnChargingEvent:
|
||||
RestoreBrightness();
|
||||
motorController.RunForDuration(15);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ namespace Pinetime {
|
|||
enum class Messages : uint8_t {
|
||||
GoToSleep,
|
||||
GoToRunning,
|
||||
UpdateDateTime,
|
||||
UpdateBleConnection,
|
||||
TouchEvent,
|
||||
ButtonPushed,
|
||||
|
@ -16,8 +17,7 @@ namespace Pinetime {
|
|||
NewNotification,
|
||||
TimerDone,
|
||||
BleFirmwareUpdateStarted,
|
||||
// Resets the screen timeout timer when awake
|
||||
// Does nothing when asleep
|
||||
DimScreen,
|
||||
NotifyDeviceActivity,
|
||||
ShowPairingKey,
|
||||
AlarmTriggered,
|
||||
|
|
|
@ -17,8 +17,8 @@ namespace {
|
|||
FirmwareValidation::FirmwareValidation(Pinetime::Controllers::FirmwareValidator& validator) : validator {validator} {
|
||||
labelVersion = lv_label_create(lv_scr_act(), nullptr);
|
||||
lv_label_set_text_fmt(labelVersion,
|
||||
"Version: %lu.%lu.%lu\n"
|
||||
"ShortRef: %s",
|
||||
"Version : %lu.%lu.%lu\n"
|
||||
"ShortRef : %s",
|
||||
Version::Major(),
|
||||
Version::Minor(),
|
||||
Version::Patch(),
|
||||
|
|
|
@ -104,7 +104,9 @@ void Timer::UpdateMask() {
|
|||
|
||||
void Timer::Refresh() {
|
||||
if (timer.IsRunning()) {
|
||||
DisplayTime();
|
||||
auto secondsRemaining = std::chrono::duration_cast<std::chrono::seconds>(timer.GetTimeRemaining());
|
||||
minuteCounter.SetValue(secondsRemaining.count() / 60);
|
||||
secondCounter.SetValue(secondsRemaining.count() % 60);
|
||||
} else if (buttonPressing && xTaskGetTickCount() > pressTime + pdMS_TO_TICKS(150)) {
|
||||
lv_label_set_text_static(txtPlayPause, "Reset");
|
||||
maskPosition += 15;
|
||||
|
@ -117,14 +119,6 @@ void Timer::Refresh() {
|
|||
}
|
||||
}
|
||||
|
||||
void Timer::DisplayTime() {
|
||||
displaySeconds = std::chrono::duration_cast<std::chrono::seconds>(timer.GetTimeRemaining());
|
||||
if (displaySeconds.IsUpdated()) {
|
||||
minuteCounter.SetValue(displaySeconds.Get().count() / 60);
|
||||
secondCounter.SetValue(displaySeconds.Get().count() % 60);
|
||||
}
|
||||
}
|
||||
|
||||
void Timer::SetTimerRunning() {
|
||||
minuteCounter.HideControls();
|
||||
secondCounter.HideControls();
|
||||
|
@ -139,7 +133,9 @@ void Timer::SetTimerStopped() {
|
|||
|
||||
void Timer::ToggleRunning() {
|
||||
if (timer.IsRunning()) {
|
||||
DisplayTime();
|
||||
auto secondsRemaining = std::chrono::duration_cast<std::chrono::seconds>(timer.GetTimeRemaining());
|
||||
minuteCounter.SetValue(secondsRemaining.count() / 60);
|
||||
secondCounter.SetValue(secondsRemaining.count() % 60);
|
||||
timer.StopTimer();
|
||||
SetTimerStopped();
|
||||
} else if (secondCounter.GetValue() + minuteCounter.GetValue() > 0) {
|
||||
|
@ -151,6 +147,7 @@ void Timer::ToggleRunning() {
|
|||
}
|
||||
|
||||
void Timer::Reset() {
|
||||
DisplayTime();
|
||||
minuteCounter.SetValue(0);
|
||||
secondCounter.SetValue(0);
|
||||
SetTimerStopped();
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "systemtask/SystemTask.h"
|
||||
#include "displayapp/LittleVgl.h"
|
||||
#include "displayapp/widgets/Counter.h"
|
||||
#include "utility/DirtyValue.h"
|
||||
#include <lvgl/lvgl.h>
|
||||
|
||||
#include "components/timer/Timer.h"
|
||||
|
@ -27,7 +26,6 @@ namespace Pinetime::Applications {
|
|||
void SetTimerRunning();
|
||||
void SetTimerStopped();
|
||||
void UpdateMask();
|
||||
void DisplayTime();
|
||||
Pinetime::Controllers::Timer& timer;
|
||||
|
||||
lv_obj_t* btnPlayPause;
|
||||
|
@ -45,7 +43,6 @@ namespace Pinetime::Applications {
|
|||
bool buttonPressing = false;
|
||||
lv_coord_t maskPosition = 0;
|
||||
TickType_t pressTime = 0;
|
||||
Utility::DirtyValue<std::chrono::seconds> displaySeconds;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "systemtask/SystemTask.h"
|
||||
#if NRF_LOG_ENABLED
|
||||
#if configUSE_TRACE_FACILITY == 1
|
||||
// FreeRtosMonitor
|
||||
#include <FreeRTOS.h>
|
||||
#include <task.h>
|
||||
|
|
|
@ -194,6 +194,7 @@ void SystemTask::Work() {
|
|||
if (!bleController.IsFirmwareUpdating()) {
|
||||
doNotGoToSleep = false;
|
||||
}
|
||||
displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
|
||||
break;
|
||||
case Messages::DisableSleeping:
|
||||
doNotGoToSleep = true;
|
||||
|
@ -244,6 +245,8 @@ void SystemTask::Work() {
|
|||
heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::GoToSleep);
|
||||
break;
|
||||
case Messages::OnNewTime:
|
||||
displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
|
||||
displayApp.PushMessage(Pinetime::Applications::Display::Messages::UpdateDateTime);
|
||||
if (alarmController.State() == Controllers::AlarmController::AlarmState::Set) {
|
||||
alarmController.ScheduleAlarm();
|
||||
}
|
||||
|
@ -252,6 +255,8 @@ void SystemTask::Work() {
|
|||
if (settingsController.GetNotificationStatus() == Pinetime::Controllers::Settings::Notification::On) {
|
||||
if (state == SystemTaskState::Sleeping) {
|
||||
GoToRunning();
|
||||
} else {
|
||||
displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
|
||||
}
|
||||
displayApp.PushMessage(Pinetime::Applications::Display::Messages::NewNotification);
|
||||
}
|
||||
|
|