removed reset() and MODE_IDLE from constructor #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the call to
self.reset()
and the switch toMODE_IDLE
from the constructor.Both statements are at best harmless, but in important use-cases harmful. The ENS160 has an internal timer for the warmup period after POR (three minutes). Resetting or switching to idle-mode resets this timer.
After power-on, the call to
reset()
is redundant, since the device is in reset mode anyhow. Otherwise, the call will reset the timer although this is not necessary. In my use-case, I sample data in intervals and use deep-sleep in between. Deep sleep keeps the device powered (at least on the Pico (W)), so only an initial warm up period is necessary. But after exiting from deep sleep the program (and the constructor) run again and this driver resets the timer causing a wait of three minutes every iteration.If there is really a need for a reset, the method can be called any time explicitly.