GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Alarm persist to flash by NeroBurner · Pull Request #1367 · InfiniTimeOrg/InfiniTime

Conversation

@NeroBurner

@NeroBurner NeroBurner commented Oct 12, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

rebase of #1333 with additional SaveAlarm() function as described below


Save the set alarm time to the SPI NOR flash, so it does not reset to
the default value when the watch resets, e.g. due to watchdog timeout
or a firmware update

Introduce SaveAlarm() member function which saves to file only if the
alarm setting is changed.
The alarmChanged boolean flag mimics the behavior of settingsChanged
flag from Settings.h

Also mark the SaveAlarmToFile() Save() SaveSettingsToFile function const, as it doesn't change
anything in the AlarmController object.


This PR needs InfiniTimeOrg/InfiniSim#67 to work on InfiniSim


Fixes: #1330

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ptman, tituscmd, and Saarsk reacted with thumbs up emoji
All reactions
  • 👍 3 reactions
@NeroBurner NeroBurner added the feature request label Oct 12, 2022
@NeroBurner NeroBurner added this to the 1.11.0 milestone Oct 12, 2022
@NeroBurner NeroBurner mentioned this pull request Oct 12, 2022
AlarmController: Add saving alarm time to file #1333
Closed
2 tasks done
@NeroBurner NeroBurner changed the title Alarm persist to flash neroburner Alarm persist to flash Oct 12, 2022
@NeroBurner NeroBurner modified the milestones: 1.11.0, 1.12.0 Oct 16, 2022
JF002
JF002 requested changes Oct 27, 2022
View reviewed changes
Comment thread src/components/alarm/AlarmController.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/components/alarm/AlarmController.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

@NeroBurner
NeroBurner force-pushed the alarm-persist-to-flash-neroburner branch from ac410fa to 3969a4a Compare October 27, 2022 22:01
JF002
JF002 approved these changes Oct 30, 2022
View reviewed changes
Riksu9000
Riksu9000 reviewed Jan 4, 2023
View reviewed changes
Comment thread src/components/alarm/AlarmController.cpp Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JF002 JF002 removed this from the 1.12.0 milestone Apr 2, 2023
NeroBurner added a commit to InfiniTimeOrg/InfiniSim that referenced this pull request Sep 19, 2024
@NeroBurner
Conditionally pass Controllers::FS to AlarmController to support save…
26395a4
… to file

Support for InfiniTimeOrg/InfiniTime#1367 which is a rebase/improvement
of InfiniTimeOrg/InfiniTime#1333 by @ght

The PR adds saving and restoring alarm state to the SPI NOR flash. So
the AlarmController needs the FileSystem-controller to work.

To support both the current `main` branch and the "save-alarm-to-file"
PR pass the Filesystem controller conditionally, only if
`Controller::FS` is mentioned in the `AlarmController.h` file
@NeroBurner NeroBurner mentioned this pull request Sep 19, 2024
Conditionally pass Controllers::FS to AlarmController to support save to file InfiniTimeOrg/InfiniSim#67
Merged
NeroBurner added a commit to InfiniTimeOrg/InfiniSim that referenced this pull request Sep 19, 2024
@NeroBurner
Conditionally pass Controllers::FS to AlarmController to support save…
7ade442
… to file

Support for InfiniTimeOrg/InfiniTime#1367 which is a rebase/improvement
of InfiniTimeOrg/InfiniTime#1333 by @ght

The PR adds saving and restoring alarm state to the SPI NOR flash. So
the AlarmController needs the FileSystem-controller to work.

To support both the current `main` branch and the "save-alarm-to-file"
PR pass the Filesystem controller conditionally, only if
`Controller::FS` is mentioned in the `AlarmController.h` file
@NeroBurner
NeroBurner force-pushed the alarm-persist-to-flash-neroburner branch from 3969a4a to 9694ccd Compare September 19, 2024 19:32
@github-actions

github-actions Bot commented Sep 19, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Build size and comparison to main:

Section Size Difference
text 374528B 296B
data 948B 0B
bss 63488B 8B
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@NeroBurner NeroBurner added this to the 1.16.0 milestone Sep 19, 2024
@NeroBurner
NeroBurner force-pushed the alarm-persist-to-flash-neroburner branch from 9694ccd to 89f0664 Compare September 19, 2024 19:59
@NeroBurner

NeroBurner commented Sep 19, 2024

Copy link
Copy Markdown
Contributor Author

rebased and squashed on current main

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mark9064
mark9064 reviewed Sep 19, 2024
View reviewed changes

@mark9064 mark9064 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested but looks sensible to me

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/components/alarm/AlarmController.cpp Resolved

Uh oh!

There was an error while loading. Please reload this page.

ght
ght reviewed Sep 19, 2024
View reviewed changes
Comment thread src/systemtask/SystemTask.cpp Resolved

Uh oh!

There was an error while loading. Please reload this page.

@NeroBurner
NeroBurner force-pushed the alarm-persist-to-flash-neroburner branch from 89f0664 to 299d19f Compare September 21, 2024 19:26
mark9064
mark9064 approved these changes Sep 21, 2024
View reviewed changes

@mark9064 mark9064 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested but all LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

NeroBurner reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@NeroBurner
NeroBurner force-pushed the alarm-persist-to-flash-neroburner branch from 579be33 to 0d41924 Compare September 21, 2024 20:22
@NeroBurner NeroBurner modified the milestones: 1.16.0, 1.15.0 Sep 21, 2024
@mark9064

mark9064 commented Sep 21, 2024

Copy link
Copy Markdown
Member

I considered opening a comment on that text you just changed but decided it was too minor LOL

NeroBurner reacted with laugh emoji
All reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@NeroBurner
NeroBurner force-pushed the alarm-persist-to-flash-neroburner branch from 0d41924 to ae860cc Compare September 21, 2024 20:47
@ght @NeroBurner
AlarmController: Add saving alarm time to file
7d7d847
Save the set alarm time to the SPI NOR flash, so it does not reset to
the default value when the watch resets, e.g. due to watchdog timeout
or reflashing of a new version of InfiniTime.

Just like the `Settings.h` `LoadSettingsFromFile()` the previous alarm
at boot (if available) and `SaveSettingsToFile()` the current alarm when
the `Alarm.h` screen is closed (only if the settings have changed).

The alarm-settings file is stored in `.system/alarm.dat`. The `.system`
folder is created if it doesn't yet exist.

Fixes: #1330
@NeroBurner

NeroBurner commented Sep 23, 2024

Copy link
Copy Markdown
Contributor Author

There is a segfault or freeze leading to a reboot on the second time when changing the alarm setting and exit the Alarm setting screen. Need to investigate

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@NeroBurner
alarmController: close .system dir after usage
b0ab1c4
Close the `lfs_dir` object for the `.system` dir after usage. Otherwise
on the second changed alarm the system will lockup because the `.system`
dir is already open and was never closed.
@NeroBurner
NeroBurner force-pushed the alarm-persist-to-flash-neroburner branch from ae860cc to b0ab1c4 Compare September 23, 2024 17:34
@NeroBurner

NeroBurner commented Sep 23, 2024

Copy link
Copy Markdown
Contributor Author

found it, need to close the lfs_dir after checking if the .system dir already exists or if we need to create it ourselfs

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mark9064

mark9064 commented Sep 23, 2024

Copy link
Copy Markdown
Member

Did I miss that or did you only just add .system?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@NeroBurner

NeroBurner commented Sep 24, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Second. I did add it recently, based in an old Diskussion about where to put pinetime system files and that they shouldn't be in the root for the user to be directly available. JF and Riksu9000 agreed that a subfolder .system is a goog place to put our configs. And the user can put their files at the root

#1367 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@NeroBurner
NeroBurner merged commit a0cd439 into main Sep 28, 2024
@NeroBurner
NeroBurner deleted the alarm-persist-to-flash-neroburner branch September 28, 2024 06:14
@minacode minacode mentioned this pull request Nov 13, 2025
timer: Add launcher with recent timer history #2360
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JF002 JF002 JF002 approved these changes
@mark9064 mark9064 mark9064 approved these changes
+2 more reviewers
@ght ght ght left review comments
@Riksu9000 Riksu9000 Riksu9000 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

feature request

Projects

None yet

Milestone

1.15.0

Development

Successfully merging this pull request may close these issues.

Alarm doesn't persist through resets

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@NeroBurner @mark9064 @ght @JF002 @Riksu9000
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.