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

Fixes API usage and possible division by 0 for wind speed #108

Merged
merged 2 commits into from
Nov 11, 2022

Conversation

PascalKern
Copy link

@PascalKern PascalKern commented Oct 25, 2022

  • There is no sub method on the time.ticks_xx() API'. So use of the time.ticks_diff(a, b) is the proper usage of the API.
  • There is the possibility of having a division by 0 when the ticks are evaluated. I had this at least once.

It might fix some issues reported in: #99. At least will a division by 0 bringing the board into sort of a limbo state which might end freezing (RTC wakeup issue because of ZeroDivisionError)

Tested and running over a week without any issues on a weather board.

@PascalKern PascalKern marked this pull request as ready for review October 31, 2022 10:43
@ZodiusInfuser
Copy link
Member

Hi @PascalKern, thank you for raising these issues. I was not aware of the ticks_diff function, so switching to that makes sense. It looks like there's other places throughout the code that need switching to that too.

@ZodiusInfuser ZodiusInfuser merged commit e2ea806 into pimoroni:main Nov 11, 2022
@PascalKern PascalKern deleted the my_develop/fixes branch November 12, 2022 08:38
@PascalKern
Copy link
Author

Hi @ZodiusInfuser

Sorry my late reply. Some troublesome weeks behind and around me and not the time I want for coding etc.
Anyway. Finally some time! :)

First of all thanks for using my code updates and merging them. Secondly, you are very welcome I do like it when we can help out each other and improve our skills and knowledge. Open source is great! :D
To be honest I had a little help 😇 With PyCharm (a "propper" IDE ;)) such issues [ticks_xx has no sub] can be spotted much easier.

And thanks a lot for fixing all other instances of the ticks_xx - ticks_xx. I was only focused on the weather board and its issues.

Best, Pascal

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.

2 participants