diff --git a/configs/mikroe-stm32f4/src/up_nsh.c b/configs/mikroe-stm32f4/src/up_nsh.c index 9fcf160f9d6..648f69c6423 100644 --- a/configs/mikroe-stm32f4/src/up_nsh.c +++ b/configs/mikroe-stm32f4/src/up_nsh.c @@ -63,6 +63,10 @@ # include "stm32_usbhost.h" #endif +#ifdef CONFIG_AUDIO +# include "nuttx/audio.h" +#endif + #include "stm32.h" #include "mikroe-stm32f4-internal.h" @@ -177,6 +181,9 @@ int nsh_archinitialize(void) #ifdef CONFIG_STM32_SPI3 FAR struct spi_dev_s *spi; FAR struct mtd_dev_s *mtd; +#endif +#ifdef CONFIG_AUDIO + FAR struct audio_lowerhalf_s *pVs1053; #endif int ret; @@ -344,5 +351,21 @@ int nsh_archinitialize(void) #endif + /* Configure the Audio sub-system if enabled */ + +#ifdef CONFIG_AUDIO + pVs1053 = vs1053_initialize(0); + if (pVs1053 == NULL) + { + message("nsh_archinitialize: Failed to initialize VS1053 Audio module\n"); + } + else + { + /* Bind the vs1053 to the audio upper-half driver */ + + audio_register("mp30", pVs1053); + } + +#endif /* CONFIG_AUDIO */ return OK; }