Skip to content

Commit 97a55d2

Browse files
authored
Merge branch 'InfiniTimeOrg:main' into loading-vibrations
2 parents 9a56679 + 505520d commit 97a55d2

File tree

25 files changed

+20
-2320
lines changed

25 files changed

+20
-2320
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "src/libs/QCBOR"]
88
path = src/libs/QCBOR
99
url = https://github.com/laurencelundblade/QCBOR.git
10+
[submodule "src/libs/arduinoFFT"]
11+
path = src/libs/arduinoFFT
12+
url = https://github.com/kosme/arduinoFFT.git

src/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,9 +672,9 @@ set(INCLUDE_FILES
672672
heartratetask/HeartRateTask.h
673673
components/heartrate/Ppg.h
674674
components/heartrate/HeartRateController.h
675-
libs/arduinoFFT-develop/src/arduinoFFT.h
676-
libs/arduinoFFT-develop/src/defs.h
677-
libs/arduinoFFT-develop/src/types.h
675+
libs/arduinoFFT/src/arduinoFFT.h
676+
libs/arduinoFFT/src/defs.h
677+
libs/arduinoFFT/src/types.h
678678
components/motor/MotorController.h
679679
buttonhandler/ButtonHandler.h
680680
touchhandler/TouchHandler.h

src/components/heartrate/Ppg.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
#include <cstdint>
66
// Note: Change internal define 'sqrt_internal sqrt' to
77
// 'sqrt_internal sqrtf' to save ~3KB of flash.
8+
#define sqrt_internal sqrtf
89
#define FFT_SPEED_OVER_PRECISION
9-
#include "libs/arduinoFFT-develop/src/arduinoFFT.h"
10+
#include "libs/arduinoFFT/src/arduinoFFT.h"
1011

1112
namespace Pinetime {
1213
namespace Controllers {

src/components/motion/MotionController.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ void MotionController::Update(int16_t x, int16_t y, int16_t z, uint32_t nbSteps)
1616
lastTime = time;
1717
time = xTaskGetTickCount();
1818

19+
lastX = this->x;
1920
this->x = x;
2021
lastY = this->y;
2122
this->y = y;
@@ -53,7 +54,7 @@ bool MotionController::ShouldRaiseWake(bool isSleeping) {
5354

5455
bool MotionController::ShouldShakeWake(uint16_t thresh) {
5556
/* Currently Polling at 10hz, If this ever goes faster scalar and EMA might need adjusting */
56-
int32_t speed = std::abs(z + (y / 2) + (x / 4) - lastY / 2 - lastZ) / (time - lastTime) * 100;
57+
int32_t speed = std::abs(z - lastZ + (y / 2) - (lastY / 2) + (x / 4) - (lastX / 4)) / (time - lastTime) * 100;
5758
//(.2 * speed) + ((1 - .2) * accumulatedSpeed);
5859
// implemented without floats as .25Alpha
5960
accumulatedSpeed = (speed / 5) + ((accumulatedSpeed / 5) * 4);

src/components/motion/MotionController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ namespace Pinetime {
6767
TickType_t lastTime = 0;
6868
TickType_t time = 0;
6969

70+
int16_t lastX = 0;
7071
int16_t x = 0;
7172
int16_t lastYForRaiseWake = 0;
7273
int16_t lastY = 0;

src/displayapp/screens/WatchFaceCasioStyleG7710.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(Controllers::DateTime& dateTi
4848
font_segment115 = lv_font_load("F:/fonts/7segments_115.bin");
4949
}
5050

51-
label_battery_vallue = lv_label_create(lv_scr_act(), nullptr);
52-
lv_obj_align(label_battery_vallue, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 0);
53-
lv_obj_set_style_local_text_color(label_battery_vallue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
54-
lv_label_set_text_static(label_battery_vallue, "00%");
51+
label_battery_value = lv_label_create(lv_scr_act(), nullptr);
52+
lv_obj_align(label_battery_value, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 0);
53+
lv_obj_set_style_local_text_color(label_battery_value, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
54+
lv_label_set_text_static(label_battery_value, "00%");
5555

5656
batteryIcon.Create(lv_scr_act());
5757
batteryIcon.SetColor(color_text);
58-
lv_obj_align(batteryIcon.GetObject(), label_battery_vallue, LV_ALIGN_OUT_LEFT_MID, -5, 0);
58+
lv_obj_align(batteryIcon.GetObject(), label_battery_value, LV_ALIGN_OUT_LEFT_MID, -5, 0);
5959

6060
batteryPlug = lv_label_create(lv_scr_act(), nullptr);
6161
lv_obj_set_style_local_text_color(batteryPlug, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
@@ -203,15 +203,15 @@ void WatchFaceCasioStyleG7710::Refresh() {
203203
if (batteryPercentRemaining.IsUpdated()) {
204204
auto batteryPercent = batteryPercentRemaining.Get();
205205
batteryIcon.SetBatteryPercentage(batteryPercent);
206-
lv_label_set_text_fmt(label_battery_vallue, "%d%%", batteryPercent);
206+
lv_label_set_text_fmt(label_battery_value, "%d%%", batteryPercent);
207207
}
208208

209209
bleState = bleController.IsConnected();
210210
bleRadioEnabled = bleController.IsRadioEnabled();
211211
if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) {
212212
lv_label_set_text_static(bleIcon, BleIcon::GetIcon(bleState.Get()));
213213
}
214-
lv_obj_realign(label_battery_vallue);
214+
lv_obj_realign(label_battery_value);
215215
lv_obj_realign(batteryIcon.GetObject());
216216
lv_obj_realign(batteryPlug);
217217
lv_obj_realign(bleIcon);

src/displayapp/screens/WatchFaceCasioStyleG7710.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ namespace Pinetime {
7676
lv_obj_t* backgroundLabel;
7777
lv_obj_t* bleIcon;
7878
lv_obj_t* batteryPlug;
79-
lv_obj_t* label_battery_vallue;
79+
lv_obj_t* label_battery_value;
8080
lv_obj_t* heartbeatIcon;
8181
lv_obj_t* heartbeatValue;
8282
lv_obj_t* stepIcon;

src/libs/arduinoFFT

Submodule arduinoFFT added at 419d7b0

src/libs/arduinoFFT-develop/.gitignore

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

src/libs/arduinoFFT-develop/Examples/FFT_01/FFT_01.ino

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

src/libs/arduinoFFT-develop/Examples/FFT_02/FFT_02.ino

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

0 commit comments

Comments
 (0)