mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
Add a Unity test case that arms only ANA_CMPR_CROSS_POS (resp. only ANA_CMPR_CROSS_NEG) on a unit and asserts that a real transition of the matching direction fires the callback exactly once, while a transition of the opposite (never-armed) direction does not fire at all. This closes a gap in the existing test_apps: none of the current cases isolate cross direction, so a swapped POS/NEG interrupt mask in the LL layer (fixed in the previous commit) previously went undetected. On the scan-based comparator IP (ESP32-H4/S31), a crossing is only sampled/latched when a scan is explicitly triggered, so the new test case also triggers a scan after each level change on that IP, plus one extra priming scan right after enabling the unit so the internal compare state starts in sync with the already-set initial GPIO level. Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>