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 — SystemTask state refactor by mark9064 · Pull Request #2109 · InfiniTimeOrg/InfiniTime

Conversation

@mark9064

@mark9064 mark9064 commented Aug 23, 2024

Copy link
Copy Markdown
Member

Currently SystemTask is somewhat fragile to duplicate state transitions and unusual state transition message orders. Most notably this can cause it to get stuck in GoingToSleep in some scenarios.

This PR introduces GoToSleep() and changes GoToRunning() as immediately executable functions. The guarantee that state transitions happen immediately reduces complexity when it comes to ensuring the device is awake for events such as Chimes

Fixes part of #1790 #2012 (there may be other issues contributing to these, but this is probably part of it)

Sorry, something went wrong.

Uh oh!

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

All reactions
@mark9064
Remove unused method declarations
7408b80
@github-actions

github-actions Bot commented Aug 23, 2024

Copy link
Copy Markdown

Build size and comparison to main:

Section Size Difference
text 378868B -32B
data 948B 0B
bss 63488B 0B
All reactions

Sorry, something went wrong.

Uh oh!

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

@mark9064
Refactor SystemTask state handling for resilience
4b6b9d3
State transitions now happen immediately where possible
This simplifies state management in general,
and prevents bugs such as the chime issue from occurring in the first place
@mark9064
mark9064 force-pushed the systemtask-state-refactor branch from c2a39b3 to 4b6b9d3 Compare August 25, 2024 22:07
@mark9064

mark9064 commented Aug 25, 2024

Copy link
Copy Markdown
Member Author

Inverted state check to make adding new states smoother

All reactions

Sorry, something went wrong.

Uh oh!

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

@mark9064 mark9064 mentioned this pull request Aug 25, 2024
AOD fixup #2106
Merged
JF002
JF002 reviewed Sep 14, 2024
View reviewed changes

@JF002 JF002 left a comment

Copy link
Copy Markdown
Collaborator

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.

A documentation of the states of SystemTask (a state diagram for example) would probably be helpful to understand this PR and for future us. This might be not blocking for this PR, but this would be a really nice addition for developers and contributors ;-)

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/components/ble/DfuService.cpp Resolved

Uh oh!

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

@mark9064

mark9064 commented Sep 14, 2024

Copy link
Copy Markdown
Member Author

I'm pretty terrible at graphics but I'll give it a go!

JF002 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@JF002 JF002 added this to the 1.15.0 milestone Sep 21, 2024
JF002
JF002 approved these changes Sep 21, 2024
View reviewed changes
NeroBurner added a commit to InfiniTimeOrg/InfiniSim that referenced this pull request Sep 21, 2024
@NeroBurner
sim/queue: support uxQueueMessagesWaiting for SysTask state refactor
9e3a623
PR InfiniTimeOrg/InfiniTime#2109 refactors the
`SystemTask.h` state machine to prevent `GoingToSleep` race conditions
(and similar state transistions).

In doing so the function `uxQueueMessagesWaiting()` from NRF SDK was
used. Implement this newly used function.
@NeroBurner NeroBurner mentioned this pull request Sep 21, 2024
sim/queue: support uxQueueMessagesWaiting for SysTask state refactor InfiniTimeOrg/InfiniSim#151
Merged
NeroBurner added a commit to InfiniTimeOrg/InfiniSim that referenced this pull request Sep 21, 2024
@NeroBurner
sim/queue: support uxQueueMessagesWaiting for SysTask state refactor
7989538
PR InfiniTimeOrg/InfiniTime#2109 refactors the
`SystemTask.h` state machine to prevent `GoingToSleep` race conditions
(and similar state transistions).

In doing so the function `uxQueueMessagesWaiting()` from NRF SDK was
used. Implement this newly used function.
@NeroBurner

NeroBurner commented Sep 21, 2024

Copy link
Copy Markdown
Contributor

Updating InfiniSim to support the newly used function uxQueueMessagesWaiting InfiniTimeOrg/InfiniSim#151

All reactions

Sorry, something went wrong.

Uh oh!

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

NeroBurner
NeroBurner approved these changes Sep 21, 2024
View reviewed changes

@NeroBurner NeroBurner left a comment

Copy link
Copy Markdown
Contributor

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.

Everything looking sound

Sorry, something went wrong.

Uh oh!

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

All reactions
@NeroBurner
NeroBurner merged commit c3d0590 into InfiniTimeOrg:main Sep 21, 2024
@NeroBurner NeroBurner mentioned this pull request Sep 21, 2024
Refactor doNotGoToSleep to a wakelock counter #2107
Merged
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
@NeroBurner NeroBurner NeroBurner approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

1.15.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@mark9064 @NeroBurner @JF002
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.