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

Great work and very clear flow chart! #4

Open
whatiskzCMU opened this issue Aug 27, 2024 · 2 comments
Open

Great work and very clear flow chart! #4

whatiskzCMU opened this issue Aug 27, 2024 · 2 comments

Comments

@whatiskzCMU
Copy link

I have read through your code, and that certainly is a lot of work! I think most of the code is fine and neat, but I still have one small question about the foreground ISR part.
4f4e878e3067ba6b9ac31d097e7b40d
In the highlighted "else" statement, if the ADC's job has not finished after 10 data are read from ADPD, then the interrupt routinue returns immediately, and the timer count will remain 0. As a result, the data read from ADPD will be refreshed to the next cycle (old data will be discarded), but the ADC conversion result will still be the old one from my understanding. If my analysis is valid, I am not sure if this will cause desychronization between the ADPD and ADC data, as they are captured in different time spot. From my understanding, both the ADPD and ADC data are processed and sent to ESP32 together in the main function, so in the ESP32 side, will it receive data from different time? Will this cause any undesirable result?

It is just my guess, and it can be, and hopefully, completely fine. Thanks again for your hardwork!

@thomas-y-li
Copy link

TODO: instead of returning, move StartConvert() into the if branch, and don't return in the else branch, just set the buffer values to 0.

@thomas-y-li
Copy link

TODO: make the timerCount more understandable (somehow)

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

No branches or pull requests

3 participants
@thomas-y-li @whatiskzCMU and others