1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/native: return 0 for all gpio_init*() calls

If the gpio is initialized as an input or interruptable pin, the
gpio_mock driver returns -1 leading to failed initialization.
However that is not because nothing can change the GPIO state that it
has to be an error.
Return 0 in all cases.

Signed-off-by: Gilles DOFFE <g.doffe@gmail.com>
This commit is contained in:
Gilles DOFFE 2024-01-24 13:13:31 +01:00
parent 3bfabb4a6c
commit 5b4c8fe92d

View File

@ -20,13 +20,10 @@
#include "periph/gpio.h"
int gpio_init(gpio_t pin, gpio_mode_t mode) {
(void) pin;
(void) mode;
(void) pin;
(void) mode;
if (mode >= GPIO_OUT)
return 0;
else
return -1;
}
int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
@ -38,7 +35,7 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
(void) cb;
(void) arg;
return -1;
return 0;
}
void gpio_irq_enable(gpio_t pin)