Add oneshot board initialization to stm32f103-minimum

This commit is contained in:
Alan Carvalho de Assis 2016-08-15 09:33:51 -06:00 committed by Gregory Nutt
parent e53118ffc2
commit d941f6d380
1 changed files with 12 additions and 0 deletions

View File

@ -45,6 +45,7 @@
#include <errno.h> #include <errno.h>
#include <nuttx/board.h> #include <nuttx/board.h>
#include <nuttx/timers/oneshot.h>
#include "stm32.h" #include "stm32.h"
#include "stm32f103_minimum.h" #include "stm32f103_minimum.h"
@ -80,11 +81,22 @@
int board_app_initialize(uintptr_t arg) int board_app_initialize(uintptr_t arg)
{ {
#ifdef CONFIG_ONESHOT
struct oneshot_lowerhalf_s *os = NULL;
#endif
int ret = OK; int ret = OK;
#ifdef CONFIG_WL_MFRC522 #ifdef CONFIG_WL_MFRC522
ret = stm32_mfrc522initialize("/dev/rfid0"); ret = stm32_mfrc522initialize("/dev/rfid0");
#endif #endif
#ifdef CONFIG_ONESHOT
os = oneshot_initialize(1, 10);
if (os)
{
ret = oneshot_register("/dev/oneshot", os);
}
#endif
return ret; return ret;
} }