Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
6ac7bac4
Commit
6ac7bac4
authored
11 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
SAM4S Xplained: Add logic to autostart the USB monitor
parent
c033ec39
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h
+22
-1
22 additions, 1 deletion
configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h
configs/sam4s-xplained-pro/src/sam_nsh.c
+25
-6
25 additions, 6 deletions
configs/sam4s-xplained-pro/src/sam_nsh.c
with
47 additions
and
7 deletions
configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h
+
22
−
1
View file @
6ac7bac4
...
...
@@ -57,6 +57,8 @@
#define HAVE_HSMCI 1
#define HAVE_PROC 1
#define HAVE_USBDEV 1
#undef HAVE_USBMONITOR
/* HSMCI */
/* Can't support MMC/SD if the card interface is not enabled */
...
...
@@ -71,7 +73,7 @@
/* Can't support MMC/SD features if mountpoints are disabled */
if
defined
(
HAVE_HSMCI
)
&&
defined
(
CONFIG_DISABLE_MOUNTPOINT
)
#
if defined(HAVE_HSMCI) && defined(CONFIG_DISABLE_MOUNTPOINT)
# warning Mountpoints disabled. No MMC/SD support
# undef HAVE_HSMCI
#endif
...
...
@@ -88,6 +90,25 @@ if defined(HAVE_HSMCI) && defined(CONFIG_DISABLE_MOUNTPOINT)
# undef HAVE_HSMCI
#endif
/* USB Device */
/* CONFIG_SAM34_UDP and CONFIG_USBDEV must be defined, or there is no USB
* device.
*/
#if !defined(CONFIG_SAM34_UDP) || !defined(CONFIG_USBDEV)
# undef HAVE_USBDEV
#endif
/* Check if we should enable the USB monitor before starting NSH */
#ifndef HAVE_USBDEV
# undef CONFIG_USBDEV_TRACE
#endif
#if !defined(CONFIG_SYSTEM_USBMONITOR) && !defined(CONFIG_USBDEV_TRACE)
# undef HAVE_USBMONITOR
#endif
/* There are four LEDs on board the SAM4S Xplained board, two of these can be
* controlled by software in the SAM4S:
*
...
...
This diff is collapsed.
Click to expand it.
configs/sam4s-xplained-pro/src/sam_nsh.c
+
25
−
6
View file @
6ac7bac4
/****************************************************************************
* config/sam4s-xplained-pro/src/sam_nsh.c
*
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
...
...
@@ -50,6 +50,14 @@
# include <apps/usbmonitor.h>
#endif
#ifdef CONFIG_CDCACM
# include <nuttx/usb/cdcacm.h>
#endif
#ifdef CONFIG_PL2303
# include <nuttx/usb/pl2303.h>
#endif
#include
"sam4s-xplained-pro.h"
/****************************************************************************
...
...
@@ -86,7 +94,7 @@
int
nsh_archinitialize
(
void
)
{
#if
(
defined(HAVE_HSMCI) || defined (HAVE_PROC))
#if defined(HAVE_HSMCI) || defined (HAVE_PROC)
|| defined(HAVE_USBMONITOR
)
int
ret
;
#endif
...
...
@@ -94,7 +102,7 @@ int nsh_archinitialize(void)
#ifdef HAVE_HSMCI
/* Initialize the HSMCI driver */
ret
=
sam_hsmci_initialize
();
if
(
ret
<
0
)
{
...
...
@@ -105,20 +113,31 @@ int nsh_archinitialize(void)
#ifdef HAVE_PROC
/* mount the proc filesystem */
ret
=
mount
(
NULL
,
"/proc"
,
"procfs"
,
0
,
NULL
);
if
(
ret
<
0
)
{
fdbg
(
"ERROR: Failed to mount the PROC filesystem: %d
\n
"
,
errno
);
message
(
"ERROR: Failed to mount the PROC filesystem: %d
\n
"
,
errno
);
return
ret
;
}
#endif
#ifdef HAVE_USBMONITOR
/* Start the USB Monitor */
ret
=
usbmonitor_start
(
0
,
NULL
);
if
(
ret
!=
OK
)
{
message
(
"nsh_archinitialize: Start USB monitor: %d
\n
"
,
ret
);
return
ret
;
}
#endif
#warning "add automount config...."
ret
=
mount
(
"/dev/mmcsd0"
,
"/fat"
,
"vfat"
,
0
,
NULL
);
if
(
ret
<
0
)
{
fdbg
(
"ERROR: Failed to mount the FAT filesystem: %d
\n
"
,
errno
);
message
(
"ERROR: Failed to mount the FAT filesystem: %d
\n
"
,
errno
);
return
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment