diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-03-06 20:21:57 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-03-06 20:21:57 +0000 |
commit | 2cb26d0787b41ae1dc7607ef11ac11047491d7dc (patch) | |
tree | 0bfa100d6337879837dd6abf9612a0a7f889129b /nuttx/configs/sure-pic32mx/src/up_nsh.c | |
parent | 829c1351e2be18265cd8ea8c481eec674192a6d5 (diff) | |
download | px4-nuttx-2cb26d0787b41ae1dc7607ef11ac11047491d7dc.tar.gz px4-nuttx-2cb26d0787b41ae1dc7607ef11ac11047491d7dc.tar.bz2 px4-nuttx-2cb26d0787b41ae1dc7607ef11ac11047491d7dc.zip |
Add support for use of a USB serial device to provide NSH console I/O. Verified on the Sure PIPIC32MX board
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4458 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/sure-pic32mx/src/up_nsh.c')
-rw-r--r-- | nuttx/configs/sure-pic32mx/src/up_nsh.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/nuttx/configs/sure-pic32mx/src/up_nsh.c b/nuttx/configs/sure-pic32mx/src/up_nsh.c index 9f2498ace..057b1467e 100644 --- a/nuttx/configs/sure-pic32mx/src/up_nsh.c +++ b/nuttx/configs/sure-pic32mx/src/up_nsh.c @@ -2,8 +2,8 @@ * config/sure-pic32mx/src/up_nsh.c * arch/arm/src/board/up_nsh.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -246,7 +246,7 @@ errout: * Name: nsh_usbhostinitialize * * Description: - * Initialize SPI-based microSD. + * Initialize USB Host * ****************************************************************************/ @@ -294,6 +294,28 @@ static int nsh_usbhostinitialize(void) #endif /**************************************************************************** + * Name: nsh_usbdevinitialize + * + * Description: + * Initialize SPI-based microSD. + * + ****************************************************************************/ + +#ifdef CONFIG_USBDEV +static int nsh_usbdevinitialize(void) +{ + /* The Sure board has no way to know when the USB is connected. So we + * will fake it and tell the USB driver that the USB is connected now. + */ + + pic32mx_usbattach(); + return OK; +} +#else +# define nsh_usbdevinitialize() (OK) +#endif + +/**************************************************************************** * Public Functions ****************************************************************************/ @@ -318,5 +340,12 @@ int nsh_archinitialize(void) ret = nsh_usbhostinitialize(); } + + if (ret == OK) + { + /* Initialize USB device */ + + ret = nsh_usbdevinitialize(); + } return ret; } |