viewtool-stm32f107: Add support to auto-mount the procfs file system

This commit is contained in:
Gregory Nutt 2017-09-19 11:35:33 -06:00
parent 0eee0f22cd
commit a5c8e6e5f8
2 changed files with 23 additions and 1 deletions

View File

@ -1,7 +1,7 @@
/****************************************************************************
* config/viewtool-stm32f107/src/stm32_appinit.c
*
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <syslog.h>
#include <errno.h>
#include <debug.h>
@ -156,6 +157,17 @@ int board_app_initialize(uintptr_t arg)
}
#endif
#ifdef CONFIG_FS_PROCFS
/* Mount the procfs file system */
ret = mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
if (ret < 0)
{
serr("ERROR: Failed to mount procfs at %s: %d\n",
STM32_PROCFS_MOUNTPOINT, ret);
}
#endif
#ifdef HAVE_MMCSD
ret = stm32_sdinitialize(CONFIG_NSH_MMCSDSLOTNO);
if (ret < 0)

View File

@ -98,6 +98,16 @@
# undef HAVE_RTC_DRIVER
#endif
/* procfs File System */
#ifdef CONFIG_FS_PROCFS
# ifdef CONFIG_NSH_PROC_MOUNTPOINT
# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
# else
# define STM32_PROCFS_MOUNTPOINT "/proc"
# endif
#endif
/* GPIO Configuration *******************************************************/
/* LEDs
*