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 — Fix MotorController::Init call order by pipe01 · Pull Request #2070 · InfiniTimeOrg/InfiniTime

Conversation

@pipe01

@pipe01 pipe01 commented Jun 2, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

The call to LoadNewScreen here (and the one below it) calls MotorController::StopRinging() here, which in turn calls xTimerStop to stop the ringing timer. However, this timer only gets created when DisplayApp::InitHw is called, which currently happens in DisplayApp::Process after the initial call to LoadNewScreen. This means that xTimerStop is called on uninitialized data, which has undefined behaviour.

This PR makes it so that the call to MotorController::Init happens before LoadNewScreen.

Sorry, something went wrong.

Uh oh!

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

Saarsk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@pipe01
Move motorController.Init call to DisplayApp::Start
b6f4234
@pipe01
pipe01 force-pushed the inithw-fix branch from 21e38b9 to b6f4234 Compare June 2, 2024 00:58
@pipe01 pipe01 changed the title Fix DisplayApp::InitHw call order Fix MotorController::Init call order Jun 2, 2024
@github-actions

github-actions Bot commented Jun 2, 2024

Copy link
Copy Markdown

Build checks have not completed. Possible reasons for this are:

  1. The checks need to be approved by a maintainer
  2. The branch has conflicts
  3. The firmware build has failed
All reactions

Sorry, something went wrong.

Uh oh!

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

JF002
JF002 approved these changes Jun 2, 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.

Good catch, thank you!

I'm wondering if those calls to LoadNewScreen shouldn't go in InitHw() or in Process() to make things more tidy, but I think your fix is valid anyway :)

Sorry, something went wrong.

Uh oh!

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

pipe01 reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@JF002 JF002 added this to the 1.15.0 milestone Jun 2, 2024
@JF002
JF002 merged commit 0c87bc2 into InfiniTimeOrg:main Jun 2, 2024
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

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.

2 participants

@pipe01 @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.