This repository was archived by the owner on Sep 16, 2024. It is now read-only.
utime: Revert back the ticks_xxx functions to use short ints.#235
Closed
robert-hh wants to merge 1 commit intopycom:v1.20.0.rc0from
Closed
utime: Revert back the ticks_xxx functions to use short ints.#235robert-hh wants to merge 1 commit intopycom:v1.20.0.rc0from
robert-hh wants to merge 1 commit intopycom:v1.20.0.rc0from
Conversation
Side effects on the Lora fucntions have to be tested yet, because LOra uses ticks_cpu() and may use simple difference for timeouts.
Member
|
Sorry... I had some issues with the |
This was referenced Jan 5, 2019
peter-pycom
pushed a commit
that referenced
this pull request
Jun 22, 2021
The place at which the time for the next transition is noticed moves from the start of the respective block to it's end, when the RGB led has switched. Co-authored-by: robert-hh <robert@hammelrath.com>
X-Ryl669
pushed a commit
to X-Ryl669/pycom-micropython-sigfox
that referenced
this pull request
May 12, 2023
The place at which the time for the next transition is noticed moves from the start of the respective block to it's end, when the RGB led has switched. Co-authored-by: robert-hh <robert@hammelrath.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The ticks_xx functions wrap around at a certain value. For the initial micropython, this values is 2^30-1 (MP short int). For the pycom port, it is 2^32-1. Thats done by simply using C 32 bit integers. This implementation has two drawbacks:
to deal with. That may hurt if for instance ticks_diff and ticks_xx are used a tight timing loop.
So this PR just goes back to the initial code, with was still present in the codebase and just had to be enabled with a config flag in mpconfigport.h.
Only ticks_cpu() is kept, limited to a 2^30 period, since different from the mp.org version is counts us ticks and the timing call is also used by the SX1272 and SX1276 driver. Side effects on the Lora nanogateway have to be tested yet, but I am pretty confident that it works. The ticks_cpu() call itself behaves well with ticks_diff().