Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use supervisor.ticks_ms() instead of time.monotonic() if available #41

Merged
merged 2 commits into from
Dec 6, 2021
Merged

use supervisor.ticks_ms() instead of time.monotonic() if available #41

merged 2 commits into from
Dec 6, 2021

Conversation

jerryneedell
Copy link
Contributor

closes #40
for MCUs that have supervisor.ticks_ms() this change will avoid potential problems due to the loss of time.monotinic() accuracy when run for long periods of time.

Test on Raspberry Pi with rfm69 bonnet, feather_rp2040 with rfm69_featherwing and on feather_m0_rfm69.

The time.monotoinc() issue is not a concern for the Raspberry Pi. supervisor.tick_ms() is not available but the Pi does not lose accuracy as quickly as the other MCUS.

@jerryneedell jerryneedell requested a review from a team December 2, 2021 12:48
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Two suggestions. Thanks!

adafruit_rfm69.py Outdated Show resolved Hide resolved
adafruit_rfm69.py Outdated Show resolved Hide resolved
@jerryneedell
Copy link
Contributor Author

Implemented changes and tested on Raspberry Pi zero2w, feather_m4_express with rfm69 featherwing and on feather_m0_rfm69 (with frozen module)

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! No worries about not waiting. We can always change things later if we want to.

@tannewt tannewt merged commit 9ac4909 into adafruit:main Dec 6, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Dec 9, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_BME680 to 3.4.0 from 3.3.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_BME680#43 from caternuson/bme688_update
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_CharLCD to 3.3.12 from 3.3.11:
  > Merge pull request adafruit/Adafruit_CircuitPython_CharLCD#70 from dhalbert/make-package
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_DS3231 to 2.4.10 from 2.4.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_DS3231#39 from tekktrik/docfix/correct-example-wday-num
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol to 0.6.1 from 0.6.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP_ATcontrol#51 from dhalbert/make-package
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP_ATcontrol#50 from mperino/main
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_FRAM to 1.3.10 from 1.3.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_FRAM#28 from tekktrik/fix/slice-notation
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_OV5640 to 1.0.3 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_OV5640#10 from adafruit/stop-motion-example
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM69 to 2.1.6 from 2.1.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_RFM69#41 from jerryneedell/jerryn_ticks
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM9x to 2.2.2 from 2.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_RFM9x#68 from jerryneedell/jerryn_ticks
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 5.6.0 from 5.5.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#81 from kattni/create-and-get-feed
  > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#77 from aerialist/main
  > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#80 from dhalbert/make-examples-packages
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_asyncio to 0.5.1 from 0.5.0:
  > fix exception printing

Updating https://github.com/adafruit/Adafruit_CircuitPython_binascii to 1.2.7 from 1.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_binascii#13 from tekktrik/feature/add-typing
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout to 1.15.0 from 1.14.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_Layout#58 from FoamyGuy/cell_anchor_point

Updating https://github.com/adafruit/Adafruit_CircuitPython_FunHouse to 2.1.8 from 2.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_FunHouse#21 from RufusVS/tone_frequency_0_fix
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_Gizmo to 1.3.6 from 1.3.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_Gizmo#17 from caternuson/iss22
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_MagTag to 2.1.3 from 2.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MagTag#74 from dhalbert/make-package
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal to 3.0.3 from 3.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#81 from dhalbert/make-package
  > update rtd py version
@jerryneedell jerryneedell deleted the jerryn_ticks branch December 9, 2021 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replace time.monotonic() with supervisor.ticks_ms()
2 participants