Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix timing bug in pulseIn()#76

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
SpenceKonde wants to merge2 commits intoarduino:master
base:master
Choose a base branch
Loading
fromSpenceKonde:master

Conversation

SpenceKonde
Copy link
Contributor

Timeout ticked by at 16/11ths of the specified speed prior to the beginning of the pulse being measured (and, as far as I can tell, always has!)

Prior to seeing the pulse start, the timeout would tick by at 16/11ths of the speed it should because the first two loops - the first two loops aren't also incrementing width, which requires 5 cycles, so of course they'll run faster! This change adds 5 cycles of nops to each loop (3 instructions - 2 rjmp+0, 1 nop). This cost 6 instruction words of flash - however, the compiler missed a chance to share the set of pop instructions between the two paths to return; doing this saved 6 instruction words, getting us back the flash the timing fix took away.
@CLAassistant
Copy link

CLAassistant commentedApr 9, 2021
edited
Loading

CLA assistant check
All committers have signed the CLA.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@SpenceKonde@CLAassistant

[8]ページ先頭

©2009-2025 Movatter.jp