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

Occasional timeouts on readADC() #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

deKees687
Copy link
Owner

Occasional Timeouts were detected when running on a ESP8266.
- See https://www.circuitsonline.net/forum/view/167087

Problem is due to timeout settings in readADC(). These leave very little margin.

  • The yield() may trigger a task switch on an ESP and processing may be suspended for several milliseconds. - Fixed by allowing a 10 millisecond margin on timeouts

Also fixed by postponing the yield() until after the timeout check
- This way the system performs at least one other round before going into timeout. - This is still not 100% fail-safe as the OS may allow for interrupts and task-switches outside of the yield function

Occasional Timeouts were detected when running on a ESP8266.
       - See https://www.circuitsonline.net/forum/view/167087
    
Problem is due to timeout settings in readADC(). These leave very little margin.
   - The yield() may trigger a task switch on an ESP and processing may be  suspended for several milliseconds.
       - Fixed by allowing a 10 millisecond margin on timeouts
    
Also fixed by postponing the yield() until after the timeout check
      -  This way the system performs at least one other round
          before going into timeout.
      -  This is still not 100% fail-safe as the OS may allow for interrupts and task-switches outside of the yield function
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.

1 participant