esp-idf/components/driver/test_apps/analog_comparator
Darian Leung 3948949019 driver: Fix ana_cmpr negative enum comparison
The C17 standard (sec 6.7.2.2) indicates that the underlying type of an enum is
implementation defined (i.e., can be signed or unsigned). Thus, comparing
"-1 >= some_enum" where "some_enum" is always 0 or largert can return true if
the compiler uses unsigned for enums.

This commit fixes the following issues with ana_cmpr:

- Fixed incorrect comparison in ana_cmpr_del_unit() that relied on enums being
signed, thus would always return true.
- Fixed incorrect expected argument in the "ana_cmpr_unit_install_uninstall"
test. This was not picked up due to the incorrect enum comparison above.
2023-05-08 17:11:52 +08:00
..
main driver: Fix ana_cmpr negative enum comparison 2023-05-08 17:11:52 +08:00
CMakeLists.txt ana_cmpr: add an example and test cases 2023-03-17 11:38:32 +08:00
pytest_ana_cmpr.py ana_cmpr: add an example and test cases 2023-03-17 11:38:32 +08:00
README.md ana_cmpr: add an example and test cases 2023-03-17 11:38:32 +08:00
sdkconfig.ci.iram_safe ana_cmpr: add an example and test cases 2023-03-17 11:38:32 +08:00
sdkconfig.ci.release ana_cmpr: add an example and test cases 2023-03-17 11:38:32 +08:00
sdkconfig.defaults ana_cmpr: add an example and test cases 2023-03-17 11:38:32 +08:00

Supported Targets ESP32-H2