Skip to content
Snippets Groups Projects
Commit 3ebcdfd4 authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

drivers/periph_common: guard spi_init() by spi module

parent 5c6c4399
No related branches found
No related tags found
No related merge requests found
/* /*
* Copyright (C) 2017 Freie Universität Berlin * Copyright (C) 2017 Freie Universität Berlin
* 2017 Kaspar Schleiser <kaspar@schleiser.de>
* *
* This file is subject to the terms and conditions of the GNU Lesser General * This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more * Public License v2.1. See the file LICENSE in the top level directory for more
...@@ -14,16 +15,19 @@ ...@@ -14,16 +15,19 @@
* @brief Common static peripheral driver initialization implementation * @brief Common static peripheral driver initialization implementation
* *
* @author Hauke Petersen <hauke.petersen@fu-berlin.de> * @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Kaspar Schleiser <kaspar@schleiser.de>
* *
* @} * @}
*/ */
#ifdef MODULE_PERIPH_SPI
#include "periph/spi.h" #include "periph/spi.h"
#endif
void periph_init(void) void periph_init(void)
{ {
/* initialize configured SPI devices */ /* initialize configured SPI devices */
#ifdef SPI_NUMOF #ifdef MODULE_PERIPH_SPI
for (unsigned i = 0; i < SPI_NUMOF; i++) { for (unsigned i = 0; i < SPI_NUMOF; i++) {
spi_init(SPI_DEV(i)); spi_init(SPI_DEV(i));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment