Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
07d2599
Started working on SleepTracker
cyberneel Oct 2, 2024
be0dca5
Began adding BPM data collection
cyberneel Oct 3, 2024
6297c7e
Started on data saving
cyberneel Oct 4, 2024
0eadfe3
Added basic data reading and clear data button
cyberneel Oct 4, 2024
f1921ee
Added functions for sleeptracking time detection. (First night of tes…
cyberneel Oct 5, 2024
bbfb05a
More changes tyo get the app on the watch
cyberneel Oct 5, 2024
3289107
trying to decrease flash and ram size
cyberneel Oct 6, 2024
298d92e
Got rid of Nevigation & removed vectors and proccessing in SleepTracker
cyberneel Oct 9, 2024
144e476
Put Navigation back for Sim to work, decreased bpm log interval for d…
cyberneel Oct 9, 2024
0b7a081
Reenable user apps
liamcharger Oct 10, 2024
636f1f2
Rename SleepTracker update button size
liamcharger Oct 11, 2024
d8f0246
Work on new Sleep Controller
cyberneel Oct 28, 2024
a84fa93
Ported Main Alarm into InfiniSleep, Need to add natural and gradual w…
cyberneel Oct 29, 2024
a14ced0
updated log messages
cyberneel Oct 29, 2024
b5dfc6c
Started working on screen states
cyberneel Oct 29, 2024
69611ae
Implemented Alarm page Function
cyberneel Oct 29, 2024
65750b5
Started Framework for settings page
cyberneel Oct 29, 2024
8325fdc
Made a sleep tracker settings struct in controller and made settings …
cyberneel Oct 30, 2024
703a6a5
Updated toggleEventHandler to check event type
cyberneel Oct 30, 2024
6981d77
added saving and reading of InfiniSleepSettings
cyberneel Oct 31, 2024
d4a1661
Started working on gradual wake, but not being triggered right now.
cyberneel Oct 31, 2024
4dd520e
Fixed gradual wake triggers
cyberneel Oct 31, 2024
eb7775b
fixed build error for always true conditions (dataType issues)
cyberneel Oct 31, 2024
33706aa
Moved gradualSteps array out of settings Struct, updated motor contro…
cyberneel Nov 2, 2024
fa52821
updated gradualWakeTriggered to use the defined constant
cyberneel Nov 2, 2024
97e788a
Switched settings to checkboxes
cyberneel Nov 2, 2024
a90791d
Changed start page and made update display go to alarm if alerting
cyberneel Nov 2, 2024
c5c5727
Removed timer on alerting so alerts indeffinately, started working on…
cyberneel Nov 2, 2024
b705a09
Made tracker toggle btn
cyberneel Nov 3, 2024
41032a0
Updated rescheduling of wake alarm when system time changed
cyberneel Nov 4, 2024
835f5cf
accoutning for abnormal data
cyberneel Nov 4, 2024
c6bff43
removed recursive
cyberneel Nov 4, 2024
0902e3e
moved else logic
cyberneel Nov 4, 2024
41b3e92
undid stuff, works now ?? idek
cyberneel Nov 4, 2024
62292e8
removed swiping while alerting
cyberneel Nov 4, 2024
388aa99
Added snoozing and made side button require 5 presses
cyberneel Nov 4, 2024
f177a81
More setup for sleep tracking
cyberneel Nov 5, 2024
9eabb40
Fixed bug that doesnt restore original alarm time after multiple snooze
cyberneel Nov 5, 2024
ff44385
Added basic HR periodic reading for sleep tracking and Fixed gradual …
cyberneel Nov 7, 2024
629d958
Made a define statement for file name
cyberneel Nov 7, 2024
6ca4cdc
Made a new alarm for sleep in motor controller
cyberneel Nov 8, 2024
1cbb9cb
Added refresh task for sleep app and added to info screen
cyberneel Nov 8, 2024
ced2ee2
Updated main.cpp and added display update when sleep tracker is updated
cyberneel Nov 8, 2024
7d8c8d9
Last commit didn't have the SleepTrackerUpdate message
cyberneel Nov 8, 2024
593bdd5
Fixed bug where snoozing and closing saved the snooze time as alarm i…
cyberneel Nov 10, 2024
8147ffa
Added ability to customize gradual wake intensity at each step
cyberneel Nov 18, 2024
d76144e
Added to info page and fixded total sleep display.
cyberneel Nov 19, 2024
1c18390
Made info screen show info from last session after tracker stopped
cyberneel Nov 19, 2024
2ad5dd9
Fixed bug with gradualWakeVibration not in sync with step when schedu…
cyberneel Nov 19, 2024
18a4d4e
Added suggestion alarm time based on desired sleep cycles constant
cyberneel Nov 19, 2024
1354a19
Fixed total sleep calculation and cycles display bugs
cyberneel Nov 20, 2024
e896e6a
Added a timeout to pushes required to stop alarm so the presses dont …
cyberneel Nov 20, 2024
c2b77d3
Made the watch open to the sleep app when in an active session
cyberneel Nov 20, 2024
8e56830
Restructured pushes to stop timeout
cyberneel Nov 21, 2024
797dc58
Added saving of prev sleep session info in case watch crashes so it c…
cyberneel Nov 21, 2024
19b51e8
Reset pushes needed to stop alarm when watch sleeps
cyberneel Nov 21, 2024
344f5b0
Moved pushes count reset to system task
cyberneel Nov 22, 2024
95e868b
Fixed some bugs with snooze time being set weird
cyberneel Nov 22, 2024
99c43fb
Code optimizations & brought back more memory
cyberneel Nov 22, 2024
38666de
Added buttons to set desired cycles count and duration per cycle.
cyberneel Nov 23, 2024
44a0ee2
Bug fixes
cyberneel Nov 23, 2024
3f06850
Switched vibration index variable to use the gradualStep and fixed is…
cyberneel Nov 23, 2024
3a35bd9
Formatted with clang-format
cyberneel Nov 24, 2024
4426c22
Updated DisplayAppRecovery
cyberneel Nov 24, 2024
245ebed
Trying to fix error from Github Build Action
cyberneel Nov 24, 2024
2773f28
Undid some edits that were for testing
cyberneel Nov 24, 2024
2583059
removed commented code
cyberneel Nov 24, 2024
4773274
Finally fixed errors during "make -j4 all"
cyberneel Nov 25, 2024
466bdbe
Removed sleep controller from recovery firmware
cyberneel Nov 25, 2024
fca1c48
Fixed Alert retriggering due to Display Update.
cyberneel Nov 26, 2024
50a9bf4
Formatted Code
cyberneel Nov 26, 2024
8ffc94f
Made suggested alarm time label more descriptive
cyberneel Nov 27, 2024
7f0a7c2
Made sure double clicking side button doesn't show notifications when…
cyberneel Nov 28, 2024
673873e
Added PWM to motor controller
cyberneel Nov 28, 2024
8b96598
Updated Gradual Wake Buzz values to try to match SleepTk
cyberneel Nov 28, 2024
be88829
Removed periodic file logging
cyberneel Nov 29, 2024
522315a
UI Tweaks
cyberneel Nov 29, 2024
c2f356f
Removed extra data write
cyberneel Nov 29, 2024
2b3bf38
Make app go to info page when alarm is turned off and also turn of tr…
cyberneel Nov 29, 2024
015808b
Added PWM to Motor Controller
cyberneel Nov 29, 2024
44fad6a
Reworked UI Layout
cyberneel Nov 30, 2024
db2febc
Added stop button to alerting UI, goal is to more it easier to unders…
cyberneel Nov 30, 2024
d736f03
Forgot to hide the auto icon
cyberneel Nov 30, 2024
a2de434
Added "Ramping Up" of Wake Alarm Buzz
cyberneel Nov 30, 2024
701d08b
Changed UI of Alerting Alarm screen and added page inditors with scro…
cyberneel Nov 30, 2024
560b118
Changed motor strength to use 0-255
cyberneel Nov 30, 2024
d51c319
Ran formatter
cyberneel Nov 30, 2024
dc9bc32
more formatting
cyberneel Nov 30, 2024
59db249
Fixed bug where snoozing causes crash due to widget not being on screen
cyberneel Nov 30, 2024
0e719b5
Fixed PWM controller number typo
cyberneel Dec 1, 2024
49b5955
Fixed make all error
cyberneel Dec 1, 2024
b0f8998
Fixed autosnooze crash
cyberneel Dec 1, 2024
27b5634
Changed the Alerting UI and removed gradual wake while snooze
cyberneel Dec 1, 2024
0608e0f
Formatting
cyberneel Dec 1, 2024
2fc156b
Added Setting to decide motor strength
cyberneel Dec 3, 2024
b8d27b9
Added Setting to select pushes required to stop alarm
cyberneel Dec 6, 2024
8d2e5f5
Disabled settings while alarm is active.
cyberneel Dec 6, 2024
073599e
Added natural wake alarm to motor controller.
cyberneel Dec 6, 2024
fe9f176
Made sure to wait for sleep app to load before doing things on wake
cyberneel Dec 7, 2024
01b3255
Updated info page to show current wake mode instead of just gradual wake
cyberneel Dec 7, 2024
aff5c7e
Removed suto display refresh on alarm screen, allows for holding down…
cyberneel Dec 7, 2024
3c7a205
Merge branch 'InfiniTimeOrg:main' into infinisleep
cyberneel Dec 7, 2024
101c0c9
Fixed display not upadting on alerting screen.
cyberneel Dec 9, 2024
8cfabea
Moved Code event code for settings page into btnHandler, better conve…
cyberneel Dec 9, 2024
860fcb6
Code Clean up
cyberneel Dec 9, 2024
37f81ba
Added a both option for wake mode that allows for natural wake with p…
cyberneel Dec 10, 2024
707eba8
Merge branch 'main' of https://github.com/InfiniTimeOrg/InfiniTime in…
cyberneel Dec 10, 2024
66aaaae
Enabling tracker sets brightness to low and resets to previous bright…
cyberneel Dec 13, 2024
14d173f
Opening app now sets lower brightness and restores when closing only …
cyberneel Dec 13, 2024
152f028
Fixed bug where brightness isn't low when watch turning on from sleep.
cyberneel Dec 13, 2024
7d1cfae
Updated SessionData struct and removed wakelock
cyberneel Dec 16, 2024
1892a90
Added total sleep minutes to SessionData
cyberneel Dec 17, 2024
1bfd33f
Added a variable to ignore button press during certion actions.
cyberneel Dec 17, 2024
cadd0f8
settings: vibrate on change of motor strength
liamcharger Dec 19, 2024
f09b548
Moved alerting logic, shouldn't change anything.
cyberneel Dec 19, 2024
214f91f
Merge branch 'infinisleep' of https://github.com/cyberneel/InfiniTime…
cyberneel Dec 19, 2024
a3af017
Bug fix and Changed Off to Normal.
cyberneel Dec 19, 2024
ee73c34
Pressing side button while alarm alerting snoozes.
cyberneel Dec 20, 2024
0e0e1f5
Made changes to the SnoozeAlarmTaskCallback, it uses the existing cod…
cyberneel Dec 20, 2024
7b8339c
Added startTimeStamp to SessionData
cyberneel Dec 20, 2024
37351cf
Added more checks in code
cyberneel Dec 22, 2024
578f06e
Showing wake mode on info screen only when alarm is active.
cyberneel Dec 22, 2024
2cdbfa5
Show alarm controller state in status icon
jmlich Dec 16, 2023
6e0da81
Alarm: Simplify alarm alerting screen (#2211)
ljahn Jan 21, 2025
8de2c2a
Fixes #2219: use artifact v4 instead of v3
jmlich Jan 10, 2025
29a7802
Add "Run on InfiniEmu" link to pull requests (#2150)
pipe01 Jan 28, 2025
333ca34
Improve no notification text (#2238)
tituscmd Feb 10, 2025
9ff7c14
Fix EOL related build issues on Windows (#2077)
madmini Feb 11, 2025
d8fd80b
Fix Infineat crash when charging with AOD (#2256)
SteveAmor Feb 26, 2025
59cc6d4
Set build context directory in devcontainer.json
dariusarnold Feb 23, 2025
ba868dd
Install sudo and ninja in the dev container Dockerfile
dariusarnold Feb 26, 2025
97ceb8b
Add basic CMakePresets.json file
dariusarnold Mar 1, 2025
2b10d4b
Add build script
dariusarnold Mar 1, 2025
7b32df9
Make vibration after timer ends more noticable
dariusarnold Mar 1, 2025
939caf3
add int calculator
Dec 3, 2022
8a98757
Fix comparison
minacode Dec 4, 2022
7c5070b
add offset
Dec 4, 2022
3a9ec99
added fixed point numbers, pow is still broken
Dec 4, 2022
8bb3d9b
added pow with floats
Dec 4, 2022
df09603
added calculator symbol
Dec 5, 2022
d0a1fdb
fixes and cleanup
Dec 5, 2022
7ef407f
make buttons bigger
Dec 7, 2022
53d9759
fixed number displays
Dec 7, 2022
7b98830
format
Dec 8, 2022
ea121a7
changed long int to int64_t
Dec 9, 2022
a5a99e1
change float to double
Dec 9, 2022
7dbf6da
fixed crashes
Dec 19, 2022
6abc42e
WIP: refactored the prints
Dec 19, 2022
c48dfe4
set value bounds and checks
Dec 20, 2022
0b8d205
add backspace button
Dec 20, 2022
57834eb
WIP: = repeats calculation
Dec 20, 2022
f983341
format
Dec 20, 2022
bae299d
fix offset bug from backspace
Dec 20, 2022
40262fa
fix backspace for zeros
Dec 20, 2022
2db56c9
colored current button
Dec 21, 2022
083fea0
format
Dec 21, 2022
70cfced
save changes
Dec 31, 2022
6d6fec5
fixed various issues
Dec 31, 2022
63b9d81
reset value after copy to result
Dec 31, 2022
fe0dd50
format
Dec 31, 2022
cea56b8
format and tidy
Dec 31, 2022
89c01e6
add power operation toggle
Jan 1, 2023
ac15ee8
checked buttons cleanup
Jan 5, 2023
1556a9c
removed swiping
Jan 5, 2023
901bdb0
add better colors
Jan 5, 2023
ec8b506
Remove power operation in calculator app
FintasticMan Jan 8, 2023
4a604db
format
Jan 9, 2023
770cf85
fixed negative number input
Jan 29, 2023
ca0241f
changes
Mar 4, 2023
5b41ae4
fix after rebase
Mar 4, 2023
6597fb8
format
Mar 4, 2023
389fcb5
fixed display of negative numbers smaller than 0
Mar 4, 2023
206adc8
only remove the operator if the value is zero
minacode Nov 12, 2023
ede3db6
lower maximum number size and number of digits
Nov 12, 2023
051ae2a
update to optional apps
Dec 10, 2023
4c2da3b
fix build and format warnings
Dec 10, 2023
242abf3
reduce heap size
Jan 13, 2024
04364d9
implement new CMake interface
Jan 13, 2024
35df4da
set heap size to 39
Jul 16, 2024
3285ebe
remove TODO
Jul 16, 2024
db946ae
add const
Aug 31, 2024
9700b33
add constexpr
Sep 1, 2024
f431121
Remove const
minacode Sep 3, 2024
f0bbbe3
fix compile error
Nov 24, 2024
ab7dac8
fix typo
minacode Nov 24, 2024
fc4bb83
explain number of digits
Nov 24, 2024
7204dfb
remove logging
Nov 24, 2024
6106e15
Specify auto types
minacode Dec 7, 2024
b98536e
Change variables to camel case
minacode Dec 7, 2024
df03059
Rename equalSignPressed to equalSignPressedBefore
minacode Dec 7, 2024
9619c75
Update header
minacode Dec 7, 2024
e0af268
fix constexpr position
minacode Dec 9, 2024
21b6908
Set sudo password for developer user in dev container
dariusarnold Mar 1, 2025
85bdbd8
Add option to enable ccache to build
dariusarnold Mar 1, 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
Prev Previous commit
Next Next commit
Implemented Alarm page Function
  • Loading branch information
cyberneel committed Nov 27, 2024
commit 69611aec1473a2ee5d1d1d3c2f2964dbc024bf6e
55 changes: 43 additions & 12 deletions src/displayapp/screens/Sleep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,44 @@ Sleep::Sleep(Controllers::InfiniSleepController& infiniSleepController,
Controllers::Settings::ClockType clockType,
System::SystemTask& systemTask,
Controllers::MotorController& motorController)
: infiniSleepController {infiniSleepController}, wakeLock(systemTask), motorController {motorController} {
: infiniSleepController {infiniSleepController}, wakeLock(systemTask), motorController {motorController}, clockType {clockType} {

UpdateDisplay();
}

Sleep::~Sleep() {
if (infiniSleepController.IsAlerting()) {
StopAlerting();
}
lv_obj_clean(lv_scr_act());
infiniSleepController.SaveWakeAlarm();
}

void Sleep::DisableWakeAlarm() {
if (infiniSleepController.IsEnabled()) {
infiniSleepController.DisableWakeAlarm();
lv_switch_off(enableSwitch, LV_ANIM_ON);
}
}

void Sleep::UpdateDisplay() {
// Clear the screen
lv_obj_clean(lv_scr_act());
// Draw the screen
switch (displayState) {
case SleepDisplayState::Alarm:
DrawAlarmScreen();
break;
case SleepDisplayState::Info:
DrawInfoScreen();
break;
case SleepDisplayState::Settings:
DrawSettingsScreen();
break;
}
}

void Sleep::DrawAlarmScreen() {
hourCounter.Create();
lv_obj_align(hourCounter.GetObject(), nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0);
if (clockType == Controllers::Settings::ClockType::H12) {
Expand Down Expand Up @@ -109,19 +145,12 @@ Sleep::Sleep(Controllers::InfiniSleepController& infiniSleepController,
}
}

Sleep::~Sleep() {
if (infiniSleepController.IsAlerting()) {
StopAlerting();
}
lv_obj_clean(lv_scr_act());
infiniSleepController.SaveWakeAlarm();
void Sleep::DrawInfoScreen() {

}

void Sleep::DisableWakeAlarm() {
if (infiniSleepController.IsEnabled()) {
infiniSleepController.DisableWakeAlarm();
lv_switch_off(enableSwitch, LV_ANIM_ON);
}
void Sleep::DrawSettingsScreen() {

}

void Sleep::OnButtonEvent(lv_obj_t* obj, lv_event_t event) {
Expand Down Expand Up @@ -172,12 +201,14 @@ bool Sleep::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
case TouchEvents::SwipeLeft:
if (displayState != SleepDisplayState::Alarm) {
displayState = static_cast<SleepDisplayState>(static_cast<int>(displayState) - 1);
UpdateDisplay();
}
NRF_LOG_INFO("SwipeLeft: %d", static_cast<int>(displayState));
return true;
case TouchEvents::SwipeRight:
if (displayState != SleepDisplayState::Settings) {
displayState = static_cast<SleepDisplayState>(static_cast<int>(displayState) + 1);
UpdateDisplay();
}
NRF_LOG_INFO("SwipeRight: %d", static_cast<int>(displayState));
return true;
Expand Down
7 changes: 6 additions & 1 deletion src/displayapp/screens/Sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Pinetime {
bool OnTouchEvent(TouchEvents event) override;
void OnValueChanged();
void StopAlerting();

void UpdateDisplay();
enum class SleepDisplayState { Alarm, Info, Settings };
SleepDisplayState displayState = SleepDisplayState::Alarm;

Expand All @@ -53,6 +53,7 @@ namespace Pinetime {
Controllers::InfiniSleepController& infiniSleepController;
System::WakeLock wakeLock;
Controllers::MotorController& motorController;
Controllers::Settings::ClockType clockType;

lv_obj_t *btnStop, *txtStop, *btnRecur, *txtRecur, *btnInfo, *enableSwitch;
lv_obj_t* lblampm = nullptr;
Expand All @@ -72,6 +73,10 @@ namespace Pinetime {
Widgets::Counter hourCounter = Widgets::Counter(0, 23, jetbrains_mono_76);
Widgets::Counter minuteCounter = Widgets::Counter(0, 59, jetbrains_mono_76);

void DrawAlarmScreen();
void DrawInfoScreen();
void DrawSettingsScreen();

// Controllers::HeartRateController& heartRateController;
// Controllers::DateTime& dateTimeController;
// Controllers::FS& fsController;
Expand Down