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 — Refactors watch faces. Replace lv_tick_get() with xTaskGetTickCount() by SteveAmor · Pull Request #2264 · InfiniTimeOrg/InfiniTime

Conversation

@SteveAmor

@SteveAmor SteveAmor commented Feb 28, 2025

Copy link
Copy Markdown
Contributor

Tested on hardware and all timings are the same.
Also saved some flash memory.

Sorry, something went wrong.

Uh oh!

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

All reactions
@SteveAmor
Refactors watch faces. Replace lv_tick_get() with xTaskGetTickCount()
73e96dd
@github-actions

github-actions Bot commented Feb 28, 2025

Copy link
Copy Markdown

Build size and comparison to main:

Section Size Difference
text 373056B -32B
data 948B 0B
bss 22536B 0B

Run in InfiniEmu

All reactions

Sorry, something went wrong.

Uh oh!

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

@mark9064 mark9064 added the maintenance Background work label Mar 1, 2025
mark9064
mark9064 approved these changes Mar 1, 2025
View reviewed changes
@mark9064 mark9064 added this to the 1.16.0 milestone May 16, 2025
@JF002

JF002 commented May 19, 2025

Copy link
Copy Markdown
Collaborator

@SteveAmor What's the rational behind this change? I'm not sure I understand why we should use xTaskGetTickCount() instead of lv_tick_get() in apps.

All reactions

Sorry, something went wrong.

Uh oh!

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

@mark9064

mark9064 commented May 19, 2025

Copy link
Copy Markdown
Member

They're the same tick counter, and I think it's confusing to have two. I think it makes sense to unify on one tick counter API, and the system tick counter is the better choice of the two as it's used everywhere else. Important things to know about the tick counter such as its bit width, signed-ness (and therefore wraparound semantics) and tick rate are well known and defined for the system tick counter

All reactions

Sorry, something went wrong.

Uh oh!

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

@JF002

JF002 commented May 21, 2025

Copy link
Copy Markdown
Collaborator

Since apps are mostly based on LVGL, I think that it would make more sense to use LVGL API as much as possible, and reduce the dependencies to other libs as much as possible.
In this case, lv_tick_get() effectively abstract FreeRTOS which makes the code more portable and consistent.

All reactions

Sorry, something went wrong.

Uh oh!

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

@mark9064

mark9064 commented May 21, 2025

Copy link
Copy Markdown
Member

I agree, but I think simplicity is more important than perfect coupling

In this case, we will need to implement a millisecond level timer, as LVGL only works in milliseconds and currently we provide it FreeRTOS ticks (1024Hz rather than 1000Hz)

All reactions

Sorry, something went wrong.

Uh oh!

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

@JF002

JF002 commented May 21, 2025

Copy link
Copy Markdown
Collaborator

Yes OK, that makes sense 👍 . I guess we can still hide FreeRTOS in a utility class that do all the calculations if we need that kind of abstraction in the future.

All reactions

Sorry, something went wrong.

Uh oh!

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

JF002
JF002 approved these changes May 21, 2025
View reviewed changes
NeroBurner
NeroBurner approved these changes May 23, 2025
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.

I agree to use one timing related API makes things clearer. And if we use only one then that is the one that will get used by other contributors.
And for me personally I had more exposure to xTaskGetTickCount() than to lv_tick_get(). So just from a feeling perspective I would go with xTaskGetTickCount as well.

Changes look sane

Sorry, something went wrong.

Uh oh!

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

All reactions
@mark9064
mark9064 merged commit 9fb35cc into InfiniTimeOrg:main May 23, 2025
@mark9064 mark9064 mentioned this pull request Jun 16, 2025
Pride flag watchface #2201
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
@mark9064 mark9064 mark9064 approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

maintenance Background work

Projects

None yet

Milestone

1.16.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

4 participants

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