If we are using a USB serial console, then NSH must wait for the USB device to be connected

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4327 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-01-24 00:00:31 +00:00
parent a3301a7079
commit c2266ac99a
6 changed files with 237 additions and 55 deletions

View File

@@ -1,8 +1,8 @@
/****************************************************************************
* apps/nshlib/nsh_serial.c
*
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2007-2009, 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
@@ -474,6 +474,14 @@ int nsh_consolemain(int argc, char *argv[])
FAR struct serial_s *pstate = nsh_allocstruct();
DEBUGASSERT(pstate);
/* If we are using a USB console, then we will have to wait for the USB to
* be connected/
*/
#ifdef HAVE_USB_CONSOLE
DEBUGASSERT(nsh_usbconsole() == OK);
#endif
/* Present a greeting */
fputs(g_nshgreeting, pstate->ss_outstream);