esp-iot-solution icon indicating copy to clipboard operation
esp-iot-solution copied to clipboard

Zero detect: valid_count overflow (AEGHB-775)

Open Roydudu opened this issue 1 year ago • 2 comments

Answers checklist.

  • [X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • [X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • [X] I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

If we have a square wave signal at 50 Hz, the “valid_count” variable would increment on each positive and negative edge, increasing 100 times per second, causing the variable to overflow in almost 11 minutes. This would result in valid edges not generating the SIGNAL_VALID event when “valid_count” is less than “valid_times” because it resets to 0.

Roydudu avatar Aug 11 '24 23:08 Roydudu

@Roydudu This will seem to increase the latency of SIGNAL_VALID event firing. Is your application sensitive to this latency in events?

InfiniteYuan avatar Sep 19 '24 01:09 InfiniteYuan

My application is not affected by the latency of the SIGNAL_VALID event. However, I noticed that it can miss SIGNAL_VALID events every 11 minutes when the counter overflows and starts from zero.

Roydudu avatar Sep 23 '24 18:09 Roydudu