Skip to content

Commit 8f6c92a

Browse files
committed
Merge branch 'watchface_prime' of github.com:tituscmd/InfiniTime into watchface_prime
2 parents ca11288 + 473cbe7 commit 8f6c92a

File tree

8 files changed

+30
-10
lines changed

8 files changed

+30
-10
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ jobs:
3939
apt-get -y install --no-install-recommends python3-pil
4040
- name: Build
4141
shell: bash
42-
run: /opt/build.sh all
42+
run: |
43+
git config --global --add safe.directory /__w/InfiniTime/InfiniTime
44+
/opt/build.sh all
4345
- name: Output build size
4446
id: output-sizes
47+
shell: bash
4548
run: |
4649
. /opt/build.sh
4750
.github/workflows/getSize.sh "$BUILD_DIR"/src/pinetime-app-*.out >> $GITHUB_OUTPUT
@@ -159,6 +162,7 @@ jobs:
159162

160163
- name: Output build size
161164
id: output-sizes
165+
shell: bash
162166
run: |
163167
. /opt/build.sh
164168
.github/workflows/getSize.sh "$BUILD_DIR"/src/pinetime-app-*.out >> $GITHUB_OUTPUT

doc/buildAndProgram.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
To build this project, you'll need:
66

77
- A cross-compiler : [ARM-GCC (10.3-2021.10)](https://developer.arm.com/downloads/-/gnu-rm)
8-
- The NRF52 SDK 15.3.0 : [nRF-SDK v15.3.0](https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip)
8+
- The NRF52 SDK 15.3.0 : [nRF-SDK v15.3.0](https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/sdks/nrf5/binaries/nrf5sdk153059ac345.zip)
99
- The Python 3 modules `cbor`, `intelhex`, `click` and `cryptography` modules for the `mcuboot` tool (see [requirements.txt](../tools/mcuboot/requirements.txt))
1010
- To keep the system clean, you can install python modules into a python virtual environment (`venv`)
1111
```sh

docker/build.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export npm_config_cache="${NPM_DIR}"
1818
export BUILD_TYPE=${BUILD_TYPE:=Release}
1919
export GCC_ARM_VER=${GCC_ARM_VER:="10.3-2021.10"}
2020
export NRF_SDK_VER=${NRF_SDK_VER:="nRF5_SDK_15.3.0_59ac345"}
21+
# convert to lower case and remove _ and . character
22+
# the download URL uses the SLUG, but the extracted folder is named like the original value
23+
NRF_SDK_VER_SLUG=${NRF_SDK_VER,,}
24+
export NRF_SDK_VER_SLUG=${NRF_SDK_VER_SLUG//[_.]/}
2125

2226
MACHINE="$(uname -m)"
2327
[ "$MACHINE" = "arm64" ] && MACHINE="aarch64"
@@ -47,17 +51,29 @@ main() {
4751

4852
GetGcc() {
4953
wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/$GCC_ARM_VER/$GCC_ARM_PATH-$MACHINE-linux.tar.bz2 -O - | tar -xj -C $TOOLS_DIR/
54+
if [ ! -d "$TOOLS_DIR/$GCC_ARM_PATH" ]; then
55+
echo "missing GCC path: $TOOLS_DIR/$GCC_ARM_PATH"
56+
return 1
57+
fi
5058
}
5159

5260
GetMcuBoot() {
5361
git clone https://github.com/mcu-tools/mcuboot.git "$TOOLS_DIR/mcuboot"
5462
pip3 install -r "$TOOLS_DIR/mcuboot/scripts/requirements.txt"
63+
if [ ! -d "$TOOLS_DIR/mcuboot" ]; then
64+
echo "missing mcuboot path: $TOOLS_DIR/mcuboot"
65+
return 1
66+
fi
5567
}
5668

5769
GetNrfSdk() {
58-
wget -q "https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/$NRF_SDK_VER.zip" -O /tmp/$NRF_SDK_VER
70+
wget -q "https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/sdks/nrf5/binaries/$NRF_SDK_VER_SLUG.zip" -O /tmp/$NRF_SDK_VER
5971
unzip -q /tmp/$NRF_SDK_VER -d "$TOOLS_DIR/"
6072
rm /tmp/$NRF_SDK_VER
73+
if [ ! -d "$TOOLS_DIR/$NRF_SDK_VER" ]; then
74+
echo "missing NRF_SDK path: $TOOLS_DIR/$NRF_SDK_VER"
75+
return 1
76+
fi
6177
}
6278

6379
CmakeGenerate() {

src/components/ble/NotificationManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace Pinetime {
2828
using Id = uint8_t;
2929
using Idx = uint8_t;
3030

31-
std::array<char, MessageSize + 1> message;
31+
std::array<char, MessageSize + 1> message{};
3232
uint8_t size;
3333
Categories category = Categories::Unknown;
3434
Id id = 0;

src/displayapp/screens/WatchFaceInfineat.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ WatchFaceInfineat::~WatchFaceInfineat() {
316316
bool WatchFaceInfineat::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
317317
if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnSettings)) {
318318
lv_obj_set_hidden(btnSettings, false);
319-
savedTick = lv_tick_get();
319+
savedTick = xTaskGetTickCount();
320320
return true;
321321
}
322322
// Prevent screen from sleeping when double tapping with settings on
@@ -463,7 +463,7 @@ void WatchFaceInfineat::Refresh() {
463463
}
464464

465465
if (!lv_obj_get_hidden(btnSettings)) {
466-
if ((savedTick > 0) && (lv_tick_get() - savedTick > 3000)) {
466+
if ((savedTick > 0) && (xTaskGetTickCount() - savedTick > pdMS_TO_TICKS(3000))) {
467467
lv_obj_set_hidden(btnSettings, true);
468468
savedTick = 0;
469469
}

src/displayapp/screens/WatchFaceInfineat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ namespace Pinetime {
4545
static bool IsAvailable(Pinetime::Controllers::FS& filesystem);
4646

4747
private:
48-
uint32_t savedTick = 0;
4948
uint8_t chargingBatteryPercent = 101; // not a mistake ;)
49+
TickType_t savedTick = 0;
5050
TickType_t chargingAnimationTick = 0;
5151

5252
Utility::DirtyValue<uint8_t> batteryPercentRemaining {};

src/displayapp/screens/WatchFacePineTimeStyle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ bool WatchFacePineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents ev
407407
if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnClose)) {
408408
lv_obj_set_hidden(btnSetColor, false);
409409
lv_obj_set_hidden(btnSetOpts, false);
410-
savedTick = lv_tick_get();
410+
savedTick = xTaskGetTickCount();
411411
return true;
412412
}
413413
if ((event == Pinetime::Applications::TouchEvents::DoubleTap) && (lv_obj_get_hidden(btnClose) == false)) {
@@ -558,7 +558,7 @@ void WatchFacePineTimeStyle::Refresh() {
558558
}
559559

560560
if (!lv_obj_get_hidden(btnSetColor)) {
561-
if ((savedTick > 0) && (lv_tick_get() - savedTick > 3000)) {
561+
if ((savedTick > 0) && (xTaskGetTickCount() - savedTick > pdMS_TO_TICKS(3000))) {
562562
lv_obj_set_hidden(btnSetColor, true);
563563
lv_obj_set_hidden(btnSetOpts, true);
564564
savedTick = 0;

src/displayapp/screens/WatchFacePineTimeStyle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace Pinetime {
5252
Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown;
5353
Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown;
5454
uint8_t currentDay = 0;
55-
uint32_t savedTick = 0;
55+
TickType_t savedTick = 0;
5656

5757
Utility::DirtyValue<uint8_t> batteryPercentRemaining {};
5858
Utility::DirtyValue<bool> isCharging {};

0 commit comments

Comments
 (0)