Skip to content

Conversation

@mark9064
Copy link
Member

@mark9064 mark9064 commented Nov 7, 2025

Also resolve the overflow in GetTimeRemaining for long timers

Prerequisite for #1971 (@vkareh any feedback please do chip in!)

It's a bit annoying to store a duplicate of the expiry time but I think it's the best way around xTimerGetExpiryTime being undefined after a timer expires

Should the API for timer remaining/since expired be two methods? I went with this as it allows getting the complete state with one function, but maybe this isn't a sensible API for a generic timer component

Untested!

Also resolve the overflow in GetTimeRemaining for long timers
@mark9064 mark9064 added the maintenance Background work label Nov 7, 2025
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Build size and comparison to main:

Section Size Difference
text 382012B 96B
data 944B 0B
bss 22624B 8B

Run in InfiniEmu

Copy link
Contributor

@minacode minacode left a comment

Choose a reason for hiding this comment

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

I think the API design is good and general enough, because you basically just implemented a signed timedelta w.r.t the expiry time. I see no problem with this being to specific for other use cases where timers are needed. Whenever the expiry is not needed, it can easily be ignored.

@mark9064 mark9064 added this to the 1.16.0 milestone Nov 8, 2025
Copy link
Collaborator

@JF002 JF002 left a comment

Choose a reason for hiding this comment

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

The API looks good to me. I prefer this option that use a single method to get the complete state of the timer over using 2 methods that return the remaining/expired time.

@minacode minacode merged commit 99ae2f3 into InfiniTimeOrg:main Nov 9, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Background work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants