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

Fix waveform missing edges on cycle rollover #4945

Merged
merged 2 commits into from
Jul 22, 2018

Conversation

earlephilhower
Copy link
Collaborator

When the ESP cycle counter rolls over, the "now" can be smaller than the
next-edge time of a waveform generator. This would cause the edge to be
missed on that specific pin, and make it look like PWM was hung.

Use proper comparison between current time and edge time.

Fixes #4944

Also remove the "sigma-delta.c.unused" file which was replaced by a
working one some time ago.

When the ESP cycle counter rolls over, the "now" can be smaller than the
next-edge time of a waveform generator.  This would cause the edge to be
missed on that specific pin, and make it look like PWM was hung.

Use proper comparison between current time and edge time.

Fixes esp8266#4944

Also remove the "sigma-delta.c.unused" file which was replaced by a
working one some time ago.
Copy link
Collaborator

@devyte devyte left a comment

Choose a reason for hiding this comment

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

That subtraction of unsigneds actually works.

@earlephilhower
Copy link
Collaborator Author

Got a little over 8hrs recorded before the logic analyzer aborted. Checked w/o any pwm freezes (on the same run I started about 24hrs ago) so I'm pretty sure we're clean.

@earlephilhower earlephilhower merged commit bde83e8 into esp8266:master Jul 22, 2018
@earlephilhower earlephilhower deleted the pwmfix branch July 22, 2018 01:47
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