8000 utime: Revert back the ticks_xxx functions to use short ints. by robert-hh · Pull Request #235 · pycom/pycom-micropython-sigfox · GitHub
[go: up one dir, main page]

Skip to content
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. 8000 #235

Closed
wants to merge 1 commit into from

Conversation

robert-hh
Copy link
Contributor

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:

  • uasyncio expects timers to be MP short ints.
  • using 32 bit ints cause the values to be standard ints in Python, which are more time-consuming
    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().

Side effects on the Lora fucntions have to be tested yet, because
LOra uses ticks_cpu() and may use simple difference for timeouts.
@Xykon Xykon closed this Dec 17, 2018
@Xykon
Copy link
Member
Xykon commented Dec 17, 2018

Sorry... I had some issues with the v1.20.0.rc0 branch so I deleted it after creating the new release-candidate branch. However this also closed this PR so I restored it and re-opened the PR.

@Xykon Xykon reopened this Dec 17, 2018
@iwahdan88 iwahdan88 closed this Feb 25, 2019
@robert-hh robert-hh deleted the v1.20.0.utime branch May 6, 2019 16:42
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>
Sign up for free to 5B96 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0