Skip to content

Commit ec4b3a7

Browse files
authored
Merge branch 'InfiniTimeOrg:main' into main
2 parents c73f016 + 6a6981c commit ec4b3a7

12 files changed

Lines changed: 55 additions & 41 deletions

File tree

.gitattributes

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Set the default behavior, in case people don't have core.autocrlf set.
2-
* text=auto
2+
# Prevent build errors on non lf systems (like Windows), we need files with lf as newlines.
3+
* text=auto eol=lf
34

45
# Explicitly declare text files you want to always be normalized and converted
5-
# to native line endings on checkout.
6+
# to lf line endings on checkout.
67
*.c text
78
*.cpp text
89
*.h text

.gitconfig

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run: tests/test-format.sh
3030

3131
- name: Upload patches
32-
uses: actions/upload-artifact@v3
32+
uses: actions/upload-artifact@v4
3333
if: failure()
3434
with:
3535
name: Patches

.github/workflows/main.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
text_size: ${{ steps.output-sizes.outputs.text_size }}
2323
data_size: ${{ steps.output-sizes.outputs.data_size }}
2424
bss_size: ${{ steps.output-sizes.outputs.bss_size }}
25+
firmware_artifact: ${{ steps.upload-firmware.outputs.artifact-id }}
26+
resources_artifact: ${{ steps.upload-resources.outputs.artifact-id }}
2527
env:
2628
# InfiniTime sources are downloaded to the current directory.
2729
# Override SOURCES_DIR in build.sh
@@ -52,22 +54,24 @@ jobs:
5254
ref_name: ${{ github.head_ref || github.ref_name }}
5355
run: echo "REF_NAME=${ref_name//\//-}" >> $GITHUB_ENV
5456
- name: Upload DFU artifacts
55-
uses: actions/upload-artifact@v3
57+
uses: actions/upload-artifact@v4
5658
with:
5759
name: InfiniTime DFU ${{ env.REF_NAME }}
5860
path: ./build/output/pinetime-mcuboot-app-dfu/*
5961
- name: Upload MCUBoot image artifacts
60-
uses: actions/upload-artifact@v3
62+
uses: actions/upload-artifact@v4
6163
with:
6264
name: InfiniTime MCUBoot image ${{ env.REF_NAME }}
6365
path: ./build/output/pinetime-mcuboot-app-image-*.bin
6466
- name: Upload standalone ELF artifacts
65-
uses: actions/upload-artifact@v3
67+
uses: actions/upload-artifact@v4
68+
id: upload-firmware
6669
with:
6770
name: InfiniTime image ${{ env.REF_NAME }}
6871
path: ./build/output/src/pinetime-app-*.out
6972
- name: Upload resources artifacts
70-
uses: actions/upload-artifact@v3
73+
uses: actions/upload-artifact@v4
74+
id: upload-resources
7175
with:
7276
name: InfiniTime resources ${{ env.REF_NAME }}
7377
path: ./build/output/infinitime-resources-*.zip
@@ -108,7 +112,7 @@ jobs:
108112
cmake --build build_lv_sim
109113
110114
- name: Upload simulator executable
111-
uses: actions/upload-artifact@v3
115+
uses: actions/upload-artifact@v4
112116
with:
113117
name: infinisim-${{ env.REF_NAME }}
114118
path: build_lv_sim/infinisim
@@ -205,10 +209,12 @@ jobs:
205209
| text | ${{ needs.build-firmware.outputs.text_size }}B | ${{ steps.output-sizes-diff.outputs.text_diff }}B |
206210
| data | ${{ needs.build-firmware.outputs.data_size }}B | ${{ steps.output-sizes-diff.outputs.data_diff }}B |
207211
| bss | ${{ needs.build-firmware.outputs.bss_size }}B | ${{ steps.output-sizes-diff.outputs.bss_diff }}B |
212+
213+
[Run in InfiniEmu](https://infiniemu.pipe01.net/?firmware=artifact://${{ github.repository }}/${{ needs.build-firmware.outputs.firmware_artifact }}&resources=artifact://${{ github.repository }}/${{ needs.build-firmware.outputs.resources_artifact }})
208214
EOF
209215
210216
- name: Upload comment
211-
uses: actions/upload-artifact@v3
217+
uses: actions/upload-artifact@v4
212218
with:
213219
name: comment
214220
path: comment

doc/buildAndProgram.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ DFU files are the files you'll need to install your build of InfiniTime using OT
6666
#### CMake command
6767
6868
```
69-
cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=... -DNRF5_SDK_PATH=...
69+
cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=... -DNRF5_SDK_PATH=... -S ..
7070
```
7171
7272
### Build the project

doc/code/Apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ MyApp.h:
124124
```cpp
125125
#pragma once
126126

127-
#include "displayapp/Apps.h"
127+
#include "displayapp/apps/Apps.h"
128128
#include "displayapp/screens/Screen.h"
129129
#include "displayapp/Controllers.h"
130130
#include "Symbols.h"

src/displayapp/screens/BatteryInfo.cpp

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,35 @@ BatteryInfo::BatteryInfo(const Pinetime::Controllers::Battery& batteryController
1010
batteryPercent = batteryController.PercentRemaining();
1111
batteryVoltage = batteryController.Voltage();
1212

13-
charging_bar = lv_bar_create(lv_scr_act(), nullptr);
14-
lv_obj_set_size(charging_bar, 200, 15);
15-
lv_bar_set_range(charging_bar, 0, 100);
16-
lv_obj_align(charging_bar, nullptr, LV_ALIGN_CENTER, 0, 10);
17-
lv_bar_set_anim_time(charging_bar, 1000);
18-
lv_obj_set_style_local_radius(charging_bar, LV_BAR_PART_BG, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
19-
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_BG, LV_STATE_DEFAULT, Colors::bgAlt);
20-
lv_obj_set_style_local_bg_opa(charging_bar, LV_BAR_PART_BG, LV_STATE_DEFAULT, LV_OPA_100);
21-
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_RED);
22-
lv_bar_set_value(charging_bar, batteryPercent, LV_ANIM_ON);
13+
chargingArc = lv_arc_create(lv_scr_act(), nullptr);
14+
lv_arc_set_rotation(chargingArc, 270);
15+
lv_arc_set_bg_angles(chargingArc, 0, 360);
16+
lv_arc_set_adjustable(chargingArc, false);
17+
lv_obj_set_size(chargingArc, 180, 180);
18+
lv_obj_align(chargingArc, nullptr, LV_ALIGN_CENTER, 0, -30);
19+
lv_arc_set_value(chargingArc, batteryPercent);
20+
lv_obj_set_style_local_bg_opa(chargingArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, LV_OPA_0);
21+
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, Colors::bgAlt);
22+
lv_obj_set_style_local_border_width(chargingArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, 2);
23+
lv_obj_set_style_local_radius(chargingArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
24+
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_LIME);
2325

2426
status = lv_label_create(lv_scr_act(), nullptr);
2527
lv_label_set_text_static(status, "Reading Battery status");
2628
lv_label_set_align(status, LV_LABEL_ALIGN_CENTER);
27-
lv_obj_align(status, charging_bar, LV_ALIGN_OUT_BOTTOM_MID, 0, 20);
29+
lv_obj_align(status, nullptr, LV_ALIGN_IN_BOTTOM_MID, 0, -17);
2830

2931
percent = lv_label_create(lv_scr_act(), nullptr);
30-
lv_obj_set_style_local_text_font(percent, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76);
32+
lv_obj_set_style_local_text_font(percent, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42);
3133
lv_label_set_text_fmt(percent, "%02i%%", batteryPercent);
3234
lv_label_set_align(percent, LV_LABEL_ALIGN_LEFT);
33-
lv_obj_align(percent, nullptr, LV_ALIGN_CENTER, 0, -60);
35+
lv_obj_align(percent, chargingArc, LV_ALIGN_CENTER, 0, 0);
3436

3537
voltage = lv_label_create(lv_scr_act(), nullptr);
3638
lv_obj_set_style_local_text_color(voltage, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::orange);
3739
lv_label_set_text_fmt(voltage, "%1i.%02i volts", batteryVoltage / 1000, batteryVoltage % 1000 / 10);
3840
lv_label_set_align(voltage, LV_LABEL_ALIGN_CENTER);
39-
lv_obj_align(voltage, nullptr, LV_ALIGN_CENTER, 0, 95);
41+
lv_obj_align(voltage, nullptr, LV_ALIGN_IN_BOTTOM_MID, 0, -7);
4042

4143
taskRefresh = lv_task_create(RefreshTaskCallback, 5000, LV_TASK_PRIO_MID, this);
4244
Refresh();
@@ -53,22 +55,23 @@ void BatteryInfo::Refresh() {
5355
batteryVoltage = batteryController.Voltage();
5456

5557
if (batteryController.IsCharging()) {
56-
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_RED);
58+
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_LIME);
5759
lv_label_set_text_static(status, "Charging");
5860
} else if (batteryPercent == 100) {
59-
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_BLUE);
61+
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_BLUE);
6062
lv_label_set_text_static(status, "Fully charged");
6163
} else if (batteryPercent < 10) {
62-
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_YELLOW);
64+
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_RED);
6365
lv_label_set_text_static(status, "Battery low");
6466
} else {
65-
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, Colors::highlight);
67+
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_GREEN);
6668
lv_label_set_text_static(status, "Discharging");
6769
}
6870

6971
lv_label_set_text_fmt(percent, "%02i%%", batteryPercent);
72+
lv_obj_align(percent, chargingArc, LV_ALIGN_CENTER, 0, 0);
7073

71-
lv_obj_align(status, charging_bar, LV_ALIGN_OUT_BOTTOM_MID, 0, 20);
74+
lv_obj_align(status, voltage, LV_ALIGN_IN_BOTTOM_MID, 0, -27);
7275
lv_label_set_text_fmt(voltage, "%1i.%02i volts", batteryVoltage / 1000, batteryVoltage % 1000 / 10);
73-
lv_bar_set_value(charging_bar, batteryPercent, LV_ANIM_ON);
76+
lv_arc_set_value(chargingArc, batteryPercent);
7477
}

src/displayapp/screens/BatteryInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Pinetime {
2424

2525
lv_obj_t* voltage;
2626
lv_obj_t* percent;
27-
lv_obj_t* charging_bar;
27+
lv_obj_t* chargingArc;
2828
lv_obj_t* status;
2929

3030
lv_task_t* taskRefresh;

src/displayapp/screens/Notifications.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ namespace {
246246

247247
Notifications::NotificationItem::NotificationItem(Pinetime::Controllers::AlertNotificationService& alertNotificationService,
248248
Pinetime::Controllers::MotorController& motorController)
249-
: NotificationItem("Notification",
250-
"No notification to display",
249+
: NotificationItem("Notifications",
250+
"No notifications to display",
251251
0,
252252
Controllers::NotificationManager::Categories::Unknown,
253253
0,

src/displayapp/screens/SystemInfo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,12 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen4() {
241241
lv_table_set_col_width(infoTask, 3, 90);
242242

243243
auto nb = uxTaskGetSystemState(tasksStatus, maxTaskCount, nullptr);
244+
// g++ emits a spurious warning (and thus error because we compile with -Werror)
245+
// due to the way std::sort is implemented
246+
#pragma GCC diagnostic push
247+
#pragma GCC diagnostic ignored "-Warray-bounds"
244248
std::sort(tasksStatus, tasksStatus + nb, sortById);
249+
#pragma GCC diagnostic pop
245250
for (uint8_t i = 0; i < nb && i < maxTaskCount; i++) {
246251
char buffer[11] = {0};
247252

0 commit comments

Comments
 (0)