Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

GPIO Handlers for same pin

FabioGMFabioGM Manaus, Brazil

Hi...

I am trying to measure time a button is hold pushed. But when I set a handler for MGOS_GPIO_INT_EDGE_NEG and another for MGOS_GPIO_INT_EDGE_POS, it sets the last row of code:

Example:

input_success &= mgos_gpio_set_int_handler(mgos_sys_config_get_x120_hardreset(), MGOS_GPIO_INT_EDGE_NEG, press_handler, NULL);
input_success &= mgos_gpio_set_int_handler(mgos_sys_config_get_x120_hardreset(), MGOS_GPIO_INT_EDGE_POS, release_handler, NULL);

This code will set only release_handler

Any syggestions?

Comments

Sign In or Register to comment.