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

read_data() clearification questions #13

Open
Roberto888888 opened this issue Feb 9, 2024 · 0 comments
Open

read_data() clearification questions #13

Roberto888888 opened this issue Feb 9, 2024 · 0 comments

Comments

@Roberto888888
Copy link

Hi Ole,
I hope you'll read this after so many years. It's not an issue, just a doubt I can't find an answer to and I don't know how to get in touch directly.

I'm using this library to learn Arduino and I don't fully understand a couple of point in the code for the method read_data() in dht_nonblocking.cpp, specifically the part regarding blocking interrupts.
I do understand how it works but not why it's programmed the way it is:

  1. Why is a DHT_interrupt object used to call the functions noInterrupt() and interrupt() through the constructor and destructor? Isn't it the same to just call the functions directly?
  2. Why does the same object need to be declared as volatile? The class doesn't have any member so what does the qualifier achieve?

Thank you.
Med venlig hilsen.

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

1 participant