This was missing. The function that sets the callback
(peripheral_gpio_set_interrupted_cb())
exits with error if the direction is not "in". Therefore,
the callback makes sense only when the direction is "in".
Therefore, we don't want to allow changing the direction if there
is a callback set.
Change-Id: Ib21746ee4c32706a4114a76fbd0f6bd80bc9b787
RETV_IF(gpio->direction == direction, PERIPHERAL_ERROR_NONE);
RETV_IF(gpio->edge != PERIPHERAL_GPIO_EDGE_NONE, PERIPHERAL_ERROR_IO_ERROR);
+ RETVM_IF(gpio->cb_info.status != GPIO_INTERRUPTED_CALLBACK_UNSET, PERIPHERAL_ERROR_IO_ERROR,
+ "Can't change direction to OUT while 'interrupted_cb' is set");
+
static const predefined_type_s types[3] = {
{"in", 2},
{"high", 4},