diff --git a/drivers/.Makefile.dep.swo b/drivers/.Makefile.dep.swo new file mode 100644 index 0000000000000000000000000000000000000000..db7d17170f1a1549c2bbae151e6b5b0624249bf5 Binary files /dev/null and b/drivers/.Makefile.dep.swo differ diff --git a/drivers/include/saul/periph.h b/drivers/include/saul/periph.h index ec6575cfa78a8380a22f66a42cdf6581a9bdbd7c..460a0454775da35f9e388d97fc5da562f0c438ce 100644 --- a/drivers/include/saul/periph.h +++ b/drivers/include/saul/periph.h @@ -34,8 +34,8 @@ extern "C" { #ifdef MODULE_SAUL_GPIO typedef enum { SAUL_GPIO_INVERTED = (1 << 0), /**< pin is used as inverted */ - SAUL_GPIO_INIT_CLEAR = 1 << 1, /**< set pin inactive after initialization */ - SAUL_GPIO_INIT_SET = 1 << 2, /**< set pin active after initialization */ + SAUL_GPIO_INIT_CLEAR = (1 << 1), /**< set pin inactive after init */ + SAUL_GPIO_INIT_SET = (1 << 2), /**< set pin active after init */ } saul_gpio_flags_t; /** diff --git a/sys/auto_init/saul/auto_init_gpio.c b/sys/auto_init/saul/auto_init_gpio.c index 4de96eeced6a818ad47fe335fb5bda9c7bebe051..c2a400a4bb80d0edcf2061348c87ef5a7e7bc49d 100644 --- a/sys/auto_init/saul/auto_init_gpio.c +++ b/sys/auto_init/saul/auto_init_gpio.c @@ -66,6 +66,12 @@ void auto_init_gpio(void) } /* initialize the GPIO pin */ gpio_init(p->pin, p->mode); + /* set initial pin state if configured */ + if (p->flags & (SAUL_GPIO_INIT_CLEAR | SAUL_GPIO_INIT_SET)) { + phydat_t s; + s.val[0] = (p->flags & SAUL_GPIO_INIT_SET); + saul_reg_entries[i].driver->write(p, &s); + } /* add to registry */ saul_reg_add(&(saul_reg_entries[i])); }