Adaptation to the Arduino IDE for ESP32 #3
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.
Hi David,
I did adapt to the Arduino IDE which may be more easy/appealing to some (at least for me).
One change I would like to point out which I feel is an improvement is the line 192 of frequency_count.c:
frequency_hz = (count >> 1) / task_inputs->sampling_window_seconds;
where the division by 2 happens in integer mode, having the effect of rounding down the division instead of injecting a 0.5 value as when the division happens in double mode.
The problem is caused by counting the second edge of the signal and using it for the subsequent computation, rounding down eliminates the second edge. You can feel the difference if you measure a 10000Hz frequency in 0.001 window duration, in this cas, the display alternates between 10500 and 10000, if you measure in 0.01 window duration, the display alternates between 10050 and 10000. This change fixes this problem.
Best
Jose