Merged nuttx/apps into master

This commit is contained in:
ziggurat29 2016-07-07 11:13:38 -05:00
commit 54e99111cb
108 changed files with 354 additions and 2473 deletions

View File

@ -1655,3 +1655,24 @@
(2016-06-24).
* apps/nshlib/Kconfig: Move NSH stuff out of nuttx/configs/Kconfig to
here. Why was it in the NuttX tree in the first place? (2016-06-24).
* apps/nshlib/Kconfig: Move some NSH settings out of nuttx/configs/Kconfig
to here. Why was it in the NuttX tree (2016-06-24).
* apps/platform/olimex-stm32-e407: Add platform files for Olimex STM32
E407. From Mateusz Szafoni (2016-06-27).
* apps/system/hex2bin: Move the portable library portion of hex2bin to
nuttx/libc/hex2bin where it can be shared with the OS internals
(2016-06-27).
* apps/nshlib: 'ps' command now prints out the stack usage if stack
coloration is enabled. From Frank Benkert (2016-06-30).
* All inclusion of apps/ header files were removed from the nuttx/
repository. This caused a lot of reshuffling of logic: binfmt pcode
support, usbmonitor is now a kernel thread, TZ/Olson database moved to
libc/zoneinfo (2016-06-29).
* apps/include directory structure reorganized. There are no longer any
header files in the apps/include/. directory. Rather, sub-directories
were added to match the partitioning of apps/ sub-directories and the
header files were moved into the appropriate sub-directory. This
change is intended to help with some changes be considered by
Sébastien Lorquet (2016-07-01).
* apps/nshlib: Allow stack usage to be disabled on constrained systems.
From David Sidrane (2016-07-01).

View File

@ -61,7 +61,7 @@ collected during the make context build phase.
To execute an application function:
exec_builtin() is defined in the nuttx/include/apps/builtin.h
exec_builtin() is defined in the nuttx/include/apps/builtin/builtin.h
NuttShell (NSH) Built-In Commands
---------------------------------

View File

@ -51,36 +51,7 @@
#include <errno.h>
#include <debug.h>
#if 0
#include <sys/wait.h>
#include <sched.h>
#include <string.h>
#include <semaphore.h>
#include <nuttx/binfmt/builtin.h>
#endif
#include <apps/builtin.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
#include <apps/builtin/builtin.h>
/****************************************************************************
* Public Functions

View File

@ -20,7 +20,7 @@ config LIBCANARD_URL
config LIBCANARD_VERSION
string "libcanard Version"
default "a7a6d4c6b105976cccac36e05c42abee566b70c4"
default "b28bf6ac337e55d49037fd9904d4b951760c4690"
---help---
libcanard version.

View File

@ -49,9 +49,9 @@ LIBCANARD_DRVDIR = $(LIBCANARD_SRCDIR)$(DELIM)drivers$(DELIM)nuttx
APPS_INCDIR = $(APPDIR)$(DELIM)include$(DELIM)canutils
CFLAGS += -I$(APPS_INCDIR)
CFLAGS += -std=c99 -I$(APPS_INCDIR) -DCANARD_ASSERT=DEBUGASSERT
CSRCS = $(LIBCANARD_SRCDIR)$(DELIM)canard.c $(LIBCANARD_DRVDIR)$(DELIM)nuttx.c
CSRCS = $(LIBCANARD_SRCDIR)$(DELIM)canard.c $(LIBCANARD_DRVDIR)$(DELIM)canard_nuttx.c
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(CSRCS)

View File

@ -51,7 +51,7 @@
#include <apps/netutils/netlib.h>
#include "shell.h"
#include <apps/nsh.h>
#include <apps/nshlib/nshlib.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -49,7 +49,7 @@
#include <stdbool.h>
#include <errno.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -41,7 +41,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc.h"

View File

@ -44,9 +44,9 @@
#include <errno.h>
#include <arpa/inet.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include <apps/readline.h>
#include <apps/system/readline.h>
#include "ftpc.h"

View File

@ -57,7 +57,7 @@
#include <nuttx/wireless/nrf24l01.h>
#include <apps/readline.h>
#include <apps/system/readline.h>
#ifdef CONFIG_DISABLE_POLL
# error The poll interface is required for the nRF24L01 terminal example. You must disable config option DISABLE_POLL.

View File

@ -55,7 +55,7 @@
# include <nuttx/binfmt/symtab.h>
#endif
#include <apps/nsh.h>
#include <apps/nshlib/nshlib.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -66,7 +66,7 @@
#include <nuttx/nx/nxfonts.h>
#include <nuttx/nx/nxterm.h>
#include <apps/nsh.h>
#include <apps/nshlib/nshlib.h>
#include "nxterm_internal.h"

View File

@ -43,7 +43,7 @@
#include <string.h>
#include <errno.h>
#include <apps/tiff.h>
#include <apps/graphics/tiff.h>
/****************************************************************************
* Pre-Processor Definitions

View File

@ -51,7 +51,7 @@
#include <errno.h>
#include <debug.h>
#include <apps/readline.h>
#include <apps/system/readline.h>
#include <nuttx/usb/usbdev.h>
#include <nuttx/usb/usbdev_trace.h>

View File

@ -48,7 +48,7 @@
#include <semaphore.h>
#include <errno.h>
#include <apps/tiff.h>
#include <apps/graphics/tiff.h>
#include <nuttx/nx/nx.h>

View File

@ -43,7 +43,7 @@
#include <errno.h>
#include <debug.h>
#include <apps/tiff.h>
#include <apps/graphics/tiff.h>
#include "tiff_internal.h"

View File

@ -44,7 +44,7 @@
#include <errno.h>
#include <debug.h>
#include <apps/tiff.h>
#include <apps/graphics/tiff.h>
#include "tiff_internal.h"

View File

@ -47,7 +47,7 @@
#include <errno.h>
#include <debug.h>
#include <apps/tiff.h>
#include <apps/graphics/tiff.h>
#include "tiff_internal.h"

View File

@ -46,7 +46,7 @@
#include <stdint.h>
#include <nuttx/nx/nxglib.h>
#include <apps/tiff.h>
#include <apps/graphics/tiff.h>
/****************************************************************************
* Pre-Processor Definitions

View File

@ -45,7 +45,7 @@
#include <errno.h>
#include <debug.h>
#include <apps/tiff.h>
#include <apps/graphics/tiff.h>
#include "tiff_internal.h"

View File

@ -1,5 +1,5 @@
/****************************************************************************
* apps/include/builtin.h
* apps/include/builtin/builtin.h
*
* Originally by:
*
@ -8,7 +8,7 @@
*
* With subsequent updates, modifications, and general maintenance by:
*
* Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2012-2013, 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -40,8 +40,8 @@
*
****************************************************************************/
#ifndef __APPS_INCLUDE_BUILTIN_H
#define __APPS_INCLUDE_BUILTIN_H
#ifndef __APPS_INCLUDE_BUILTIN_BUILTIN_H
#define __APPS_INCLUDE_BUILTIN_BUILTIN_H
/****************************************************************************
* Included Files
@ -109,4 +109,4 @@ int exec_builtin(FAR const char *appname, FAR char * const *argv,
}
#endif
#endif /* __APPS_INCLUDE_BUILTIN_H */
#endif /* __APPS_INCLUDE_BUILTIN_BUILTIN_H */

View File

@ -1,7 +1,7 @@
/************************************************************************************
* apps/include/tiff.h
* apps/include/graphics/tiff.h
*
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Reference:
@ -36,8 +36,8 @@
*
************************************************************************************/
#ifndef __APPS_INCLUDE_TIFF_H
#define __APPS_INCLUDE_TIFF_H
#ifndef __APPS_INCLUDE_GRAPHICS_TIFF_H
#define __APPS_INCLUDE_GRAPHICS_TIFF_H
/************************************************************************************
* Included Files
@ -463,4 +463,4 @@ uint32_t tiff_get32(FAR uint8_t *dest);
}
#endif
#endif /* __APPS_INCLUDE_TIFF_H */
#endif /* __APPS_INCLUDE_GRAPHICS_TIFF_H */

View File

@ -1,272 +0,0 @@
/****************************************************************************
* apps/include/hex2bin.h
*
* Copyright (C) 2014 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
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __APPS_INCLUDE_INIFILE_H
#define __APPS_INCLUDE_INIFILE_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#ifdef CONFIG_SYSTEM_HEX2BIN
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
#ifndef CONFIG_SYSTEM_HEX2BIN_BASEADDR
# define CONFIG_SYSTEM_HEX2BIN_BASEADDR 0x00000000
#endif
#ifndef CONFIG_SYSTEM_HEX2BIN_ENDPADDR
# define CONFIG_SYSTEM_HEX2BIN_ENDPADDR 0x00000000
#endif
#ifndef CONFIG_SYSTEM_HEX2BIN_SWAP
# define CONFIG_SYSTEM_HEX2BIN_SWAP 0
#endif
/* Some environments may return CR as end-of-line, others LF, and others
* both. If not specified, the logic here assumes either (but not both) as
* the default.
*/
#if defined(CONFIG_EOL_IS_CR)
# undef CONFIG_EOL_IS_LF
# undef CONFIG_EOL_IS_BOTH_CRLF
# undef CONFIG_EOL_IS_EITHER_CRLF
#elif defined(CONFIG_EOL_IS_LF)
# undef CONFIG_EOL_IS_CR
# undef CONFIG_EOL_IS_BOTH_CRLF
# undef CONFIG_EOL_IS_EITHER_CRLF
#elif defined(CONFIG_EOL_IS_BOTH_CRLF)
# undef CONFIG_EOL_IS_CR
# undef CONFIG_EOL_IS_LF
# undef CONFIG_EOL_IS_EITHER_CRLF
#elif defined(CONFIG_EOL_IS_EITHER_CRLF)
# undef CONFIG_EOL_IS_CR
# undef CONFIG_EOL_IS_LF
# undef CONFIG_EOL_IS_BOTH_CRLF
#else
# undef CONFIG_EOL_IS_CR
# undef CONFIG_EOL_IS_LF
# undef CONFIG_EOL_IS_BOTH_CRLF
# define CONFIG_EOL_IS_EITHER_CRLF 1
#endif
/* Debug from hex2bin code */
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_SYSTEM_HEX2BIN_DEBUG
# define hex2bin_debug(format, ...) fprintf(stderr, format, ##__VA_ARGS__)
# else
# define hex2bin_debug(x...)
# endif
#else
# ifdef CONFIG_SYSTEM_HEX2BIN_DEBUG
# define hex2bin_debug printf
# else
# define hex2bin_debug (void)
# endif
#endif
/****************************************************************************
* Public Types
****************************************************************************/
/* Intel HEX data steams are normally in big endian order. The following
* enumeration selects other ordering.
*/
enum hex2bin_swap_e
{
HEX2BIN_NOSWAP = 0, /* No swap, stream is in the correct byte order */
HEX2BIN_SWAP16 = 1, /* Swap bytes in 16-bit values */
HEX2BIN_SWAP32 = 2 /* Swap bytes in 32-bit values */
};
/****************************************************************************
* Public Data
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: hex2bin
*
* Description:
* Read the Intel HEX ASCII data provided on the serial IN stream and write
* the binary to the seek-able serial OUT stream.
*
* These streams may be files or, in another usage example, the IN stream
* could be a serial port and the OUT stream could be a memory stream. This
* would decode and write the serial input to memory.
*
* Input Parameters:
* instream - The incoming stream from which Intel HEX data will be
* received.
* outstream - The outgoing stream in which binary data will be written.
* baseaddr - The base address of the outgoing stream. Seeking in the
* output stream will be relative to this address.
* endpaddr - The end address (plus 1) of the outgoing stream. This
* value is used only for range checking. endpaddr must
* be larger than baseaddr. A zero value for endpaddr
* disables range checking.
* swap - Controls byte ordering. See enum hex2bin_swap_e for
* description of the values.
*
* Returned Value
* Zero (OK) is returned on success; a negated errno value is returned on
* failure.
*
****************************************************************************/
struct lib_instream_s;
struct lib_sostream_s;
int hex2bin(FAR struct lib_instream_s *instream,
FAR struct lib_sostream_s *outstream, uint32_t baseaddr,
uint32_t endpaddr, enum hex2bin_swap_e swap);
/****************************************************************************
* Name hex2mem
*
* Description:
* Read the Intel HEX ASCII data provided on the file descriptor 'fd' and
* write the binary to memory.
*
* If, for example, fd is zero (corresponding to stdin), then the HEX
* ASCII data would be taken from the console and written to memory.
*
* Input Parameters:
* fd - The file descriptor from which Intel HEX data will be
* received.
* baseaddr - The base address of the memory region stream.
* endpaddr - The end address (plus 1) of the memory region.
* swap - Controls byte ordering. See enum hex2bin_swap_e for
* description of the values.
*
* Returned Value
* Zero (OK) is returned on success; a negated errno value is returned on
* failure.
*
****************************************************************************/
int hex2mem(int fd, uint32_t baseaddr, uint32_t endpaddr,
enum hex2bin_swap_e swap);
/****************************************************************************
* Name fhex2mem
*
* Description:
* Read the Intel HEX ASCII data provided on the standard stream
* 'instream' and write the binary to memory.
*
* If, for example, instream is stdin, then the HEX ASCII data would be
* taken from the console and written to memory.
*
* Input Parameters:
* instream - The incoming standard stream from which Intel HEX data
* will be received.
* baseaddr - The base address of the memory region stream.
* endpaddr - The end address (plus 1) of the memory region.
* swap - Controls byte ordering. See enum hex2bin_swap_e for
* description of the values.
*
* Returned Value
* Zero (OK) is returned on success; a negated errno value is returned on
* failure.
*
****************************************************************************/
int fhex2mem(FAR FILE *instream, uint32_t baseaddr, uint32_t endpaddr,
enum hex2bin_swap_e swap);
/****************************************************************************
* Name: hex2bin_main
*
* Description:
* Main entry point when hex2bin is built as an NSH built-in task.
*
* Input Parameters:
* Standard task inputs
*
* Returned Value
* EXIT_SUCESS on success; EXIT_FAILURE on failure
*
****************************************************************************/
#ifdef CONFIG_SYSTEM_HEX2BIN_BUILTIN
int hex2bin_main(int argc, char **argv);
#endif /* CONFIG_SYSTEM_HEX2BIN_BUILTIN */
/****************************************************************************
* Name: hex2mem_main
*
* Description:
* Main entry point when hex2mem is built as an NSH built-in task.
*
* Input Parameters:
* Standard task inputs
*
* Returned Value
* EXIT_SUCESS on success; EXIT_FAILURE on failure
*
****************************************************************************/
#ifdef CONFIG_SYSTEM_HEX2MEM_BUILTIN
int hex2mem_main(int argc, char **argv);
#endif /* CONFIG_SYSTEM_HEX2MEM_BUILTIN */
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* CONFIG_SYSTEM_HEX2BIN */
#endif /* __APPS_INCLUDE_INIFILE_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/ftpc.h
* apps/include/system/ftpc.h
*
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __APPS_INCLUDE_FTPC_H
#define __APPS_INCLUDE_FTPC_H
#ifndef __APPS_INCLUDE_NETUTILS_FTPC_H
#define __APPS_INCLUDE_NETUTILS_FTPC_H
/****************************************************************************
* Included Files
@ -223,4 +223,4 @@ FAR char *ftpc_response(SESSION handle);
}
#endif
#endif /* __APPS_INCLUDE_FTPC_H */
#endif /* __APPS_INCLUDE_NETUTILS_FTPC_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/nsh.h
* apps/include/nshlib/nshlib.h
*
* Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __APPS_INCLUDE_NSH_H
#define __APPS_INCLUDE_NSH_H
#ifndef __APPS_INCLUDE_NSHLIB_NSHLIB_H
#define __APPS_INCLUDE_NSHLIB_NSHLIB_H
/****************************************************************************
* Included Files
@ -206,4 +206,4 @@ int platform_user_verify(FAR const char *username, FAR const char *password);
}
#endif
#endif /* __APPS_INCLUDE_NSH_H */
#endif /* __APPS_INCLUDE_NSHLIB_NSHLIB_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/cle.h
* apps/include/system/cle.h
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __APPS_INCLUDE_CLE_H
#define __APPS_INCLUDE_CLE_H
#ifndef __APPS_INCLUDE_SYSTEM_CLE_H
#define __APPS_INCLUDE_SYSTEM_CLE_H
/****************************************************************************
* Included Files
@ -84,4 +84,4 @@ int cle(FAR char *line, uint16_t linelen, FILE *instream, FILE *outstream);
#endif
#endif /* CONFIG_SYSTEM_CLE */
#endif /* __APPS_INCLUDE_CLE_H */
#endif /* __APPS_INCLUDE_SYSTEM_CLE_H */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* apps/system/nxplayer/nxplayer.h
* apps/include/system/nxplayer.h
*
* Copyright (C) 2013 Ken Pettit. All rights reserved.
* Author: Ken Pettit <pettitkd@gmail.com>
@ -37,8 +37,8 @@
*
****************************************************************************/
#ifndef __APPS_SYSTEM_NXPLAYER_NXPLAYER_H
#define __APPS_SYSTEM_NXPLAYER_NXPLAYER_H 1
#ifndef __APPS_INCLUDE_SYSTEM_NXPLAYER_H
#define __APPS_INCLUDE_SYSTEM_NXPLAYER_H 1
/****************************************************************************
* Included Files
@ -474,4 +474,4 @@ int nxplayer_systemreset(FAR struct nxplayer_s *pPlayer);
}
#endif
#endif /* __APPS_SYSTEM_NXPLAYER_NXPLAYER_H */
#endif /* __APPS_INCLUDE_SYSTEM_NXPLAYER_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/prun.h
* apps/include/system/prun.h
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __APPS_INCLUDE_PRUN_H
#define __APPS_INCLUDE_PRUN_H
#ifndef __APPS_INCLUDE_SYSTEM_PRUN_H
#define __APPS_INCLUDE_SYSTEM_PRUN_H
/****************************************************************************
* Included Files
@ -89,4 +89,4 @@ int prun(FAR char *exepath, size_t varsize, size_t strsize);
}
#endif
#endif /* __APPS_INCLUDE_PRUN_H */
#endif /* __APPS_INCLUDE_SYSTEM_PRUN_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/readline.h
* apps/include/system/readline.h
*
* Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013, 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __APPS_INCLUDE_READLINE_H
#define __APPS_INCLUDE_READLINE_H
#ifndef __APPS_INCLUDE_SYSTEM_READLINE_H
#define __APPS_INCLUDE_SYSTEM_READLINE_H
/****************************************************************************
* Included Files
@ -228,4 +228,4 @@ ssize_t std_readline(FAR char *buf, int buflen);
#endif
#endif /* CONFIG_SYSTEM_READLINE */
#endif /* __APPS_INCLUDE_READLINE_H */
#endif /* __APPS_INCLUDE_SYSTEM_READLINE_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/symtab.h
* apps/include/system/symtab.h
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __APPS_INCLUDE_SYMTAB_H
#define __APPS_INCLUDE_SYMTAB_H
#ifndef __APPS_INCLUDE_SYSTEM_SYMTAB_H
#define __APPS_INCLUDE_SYSTEM_SYMTAB_H
/****************************************************************************
* Included Files
@ -98,5 +98,5 @@ void symtab_initialize(void);
}
#endif
#endif /* __APPS_INCLUDE_SYMTAB_H */
#endif /* __APPS_INCLUDE_SYSTEM_SYMTAB_H */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/zmodem.h
* apps/include/system/zmodem.h
*
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* References:
@ -37,8 +37,8 @@
*
****************************************************************************/
#ifndef __APPS_INCLUDE_ZMODEM_H
#define __APPS_INCLUDE_ZMODEM_H
#ifndef __APPS_INCLUDE_SYSTEM_ZMODEM_H
#define __APPS_INCLUDE_SYSTEM_ZMODEM_H
/****************************************************************************
* Included Files
@ -345,4 +345,4 @@ int zms_release(ZMSHANDLE handle);
}
#endif
#endif /* __APPS_INCLUDE_ZMODEM_H */
#endif /* __APPS_INCLUDE_SYSTEM_ZMODEM_H */

View File

@ -1,96 +0,0 @@
/****************************************************************************
* apps/include/usbmonitor.h
*
* Copyright (C) 2013 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
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __APPS_INCLUDE_USBMONITOR_H
#define __APPS_INCLUDE_USBMONITOR_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#ifdef CONFIG_SYSTEM_USBMONITOR
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: usbmon_start and usbmon_stop
*
* Start and top the USB monitor daemon. These are normally controlled
* from the USB command line, but the ability to control these
* programmatically is also helpful (for example, so that the daemon is
* running before NSH starts).
*
* Input Parameters:
* Standard task parameters. These can be called or spawned. Since the
* return almost immediately, it is fine to just call the functions. The
* parameters are not used so you can pass 0 and NULL, respectivley; this
* is done this way so that these functions can be NSH builtin
* applications.
*
* Returned values:
* Standard task return values (zero meaning success).
*
****************************************************************************/
int usbmonitor_start(int argc, char **argv);
int usbmonitor_stop(int argc, char **argv);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* CONFIG_SYSTEM_USBMONITOR */
#endif /* __APPS_INCLUDE_USBMONITOR_H */

View File

@ -1,83 +0,0 @@
/****************************************************************************
* apps/include/zoneinfo.h
*
* Copyright (C) 2015 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
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __APPS_INCLUDE_ZONEINFO_H
#define __APPS_INCLUDE_ZONEINFO_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#ifdef CONFIG_SYSTEM_ZONEINFO_ROMFS
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/* If the TZ database is built as a ROMFS file system, then these variables
* provide (1) the address of the array in FLASH/ROM that contains the
* ROMFS file system image, and (2) the size of the ROMFS file system image
* in bytes. This is sufficient information to permit external logic to
* mount the ROMF file system.
*/
EXTERN unsigned char romfs_zoneinfo_img[];
EXTERN unsigned int romfs_zoneinfo_img_len;
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* CONFIG_SYSTEM_ZONEINFO_ROMFS */
#endif /* __APPS_INCLUDE_ZONEINFO_H */

6
interpreters/pcode/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
/Makefile
/include
/insn
/libpas
/libpoff

View File

@ -61,7 +61,7 @@ highly influenced by uIP) include:
"wrapped" as character devices and mapped to stdin,
stdout, and stderr. Now the telnet session can be
inherited by spawned tasks.
ftpc - FTP client. See apps/include/ftpc.h for interface
ftpc - FTP client. See apps/include/netutils/ftpc.h for interface
information.
ftpd - FTP server. See apps/include/netutils/ftpd.h for interface
information.

View File

@ -39,7 +39,7 @@
#include "ftpc_config.h"
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -39,7 +39,7 @@
#include "ftpc_config.h"
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -40,7 +40,7 @@
#include "ftpc_config.h"
#include <debug.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -47,7 +47,7 @@
#include <arpa/inet.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -41,7 +41,7 @@
#include <stdlib.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -42,7 +42,7 @@
#include <stdint.h>
#include <stdio.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -42,7 +42,7 @@
#include <string.h>
#include <time.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -46,7 +46,7 @@
#include <debug.h>
#include <errno.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -39,7 +39,7 @@
#include "ftpc_config.h"
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -40,7 +40,7 @@
#include "ftpc_config.h"
#include <debug.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -54,7 +54,7 @@
#include <netinet/in.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -47,7 +47,7 @@
#include <errno.h>
#include <debug.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -43,7 +43,7 @@
#include <errno.h>
#include <debug.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -42,7 +42,7 @@
#include <stdlib.h>
#include <string.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -39,7 +39,7 @@
#include "ftpc_config.h"
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -47,7 +47,7 @@
#include <errno.h>
#include <debug.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -40,7 +40,7 @@
#include "ftpc_config.h"
#include <time.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -42,7 +42,7 @@
#include <stdlib.h>
#include <string.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -40,7 +40,7 @@
#include "ftpc_config.h"
#include <string.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -41,7 +41,7 @@
#include <stdlib.h>
#include <string.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -43,7 +43,7 @@
#include <string.h>
#include <debug.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -50,7 +50,7 @@
#include <assert.h>
#include <debug.h>
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -39,7 +39,7 @@
#include "ftpc_config.h"
#include <apps/ftpc.h>
#include <apps/netutils/ftpc.h>
#include "ftpc_internal.h"

View File

@ -1,5 +1,5 @@
/****************************************************************************
* apps/include/ftpd.h
* apps/netutils/ftpd/ftpd.h
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>

View File

@ -43,10 +43,10 @@ config NSH_PLATFORM_MOTD
One newline will be inserted after the platform-supplied message.
platform_motd() is prototyped and described in apps/include/nsh.h
platform_motd() is prototyped and described in apps/include/nshlib/nshlib.h
which may be included like:
#include <apps/nsh.h>
#include <apps/nshlib/nshlib.h>
config NSH_MOTD_STRING
string "MOTD String"
@ -403,6 +403,13 @@ config NSH_DISABLE_PS
default y if !FS_PROCFS || FS_PROCFS_EXCLUDE_PROCESS
default n if FS_PROCFS && !FS_PROCFS_EXCLUDE_PROCESS
config NSH_DISABLE_PSSTACKUSAGE
bool "Disable ps stack usage"
depends on STACK_COLORATION && !NSH_DISABLE_PS
default n
---help---
Disable to save space and not pull in floating point routines
config NSH_DISABLE_PING
bool "Disable ping"
default n
@ -920,7 +927,7 @@ config NSH_USBDEV_TRACE
data will go to the SYSLOG device.
If not enabled, the USB trace support can be provided by external
logic such as apps/system/usbmonitor.
logic such as nuttx/drivers/usbmonitor.
if NSH_USBDEV_TRACE
@ -1538,10 +1545,10 @@ config NSH_LOGIN_PLATFORM
int platform_user_verify(FAR const char *username, FAR const char *password);
which is prototyped an described in apps/include/nsh.h and which may
be included like:
which is prototyped an described in apps/include/nshlib/nshlib.h and
which may be included like:
#include <apps/nsh.h>
#include <apps/nshlib/nshlib.h>
An appropriate place to implement this function might be in the
directory apps/platform/<board>.

View File

@ -1008,7 +1008,7 @@ int cmd_lsmod(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# ifndef CONFIG_NSH_DISABLE_LS
int cmd_ls(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif
# if defined(CONFIG_SYSLOG) && defined(CONFIG_RAMLOG_SYSLOG) && !defined(CONFIG_NSH_DISABLE_DMESG)
# if defined(CONFIG_RAMLOG_SYSLOG) && !defined(CONFIG_NSH_DISABLE_DMESG)
int cmd_dmesg(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
# endif
# if CONFIG_NFILE_STREAMS > 0 && !defined(CONFIG_NSH_DISABLESCRIPT)

View File

@ -55,7 +55,7 @@
#include <string.h>
#include <nuttx/binfmt/builtin.h>
#include <apps/builtin.h>
#include <apps/builtin/builtin.h>
#include "nsh.h"
#include "nsh_console.h"

View File

@ -46,7 +46,7 @@
#endif
#if defined(CONFIG_SYSTEM_READLINE) && defined(CONFIG_READLINE_HAVE_EXTMATCH)
# include <apps/readline.h>
# include <apps/system/readline.h>
#endif
#include "nsh.h"
@ -177,8 +177,8 @@ static const struct cmdmap_s g_cmdmap[] =
#endif
#endif
#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SYSLOG) && \
defined(CONFIG_RAMLOG_SYSLOG) && !defined(CONFIG_NSH_DISABLE_DMESG)
#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_RAMLOG_SYSLOG) && \
!defined(CONFIG_NSH_DISABLE_DMESG)
{ "dmesg", cmd_dmesg, 1, 1, NULL },
#endif

View File

@ -425,8 +425,8 @@ int cmd_cat(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* Name: cmd_dmesg
****************************************************************************/
#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_SYSLOG) && \
defined(CONFIG_RAMLOG_SYSLOG) && !defined(CONFIG_NSH_DISABLE_DMESG)
#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_RAMLOG_SYSLOG) && \
!defined(CONFIG_NSH_DISABLE_DMESG)
int cmd_dmesg(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
return nsh_catfile(vtbl, argv[0], CONFIG_SYSLOG_DEVPATH);

View File

@ -41,8 +41,8 @@
#include <sys/boardctl.h>
#include <apps/readline.h>
#include <apps/nsh.h>
#include <apps/system/readline.h>
#include <apps/nshlib/nshlib.h>
#include "nsh.h"

View File

@ -45,9 +45,9 @@
#include <apps/fsutils/passwd.h>
#ifdef CONFIG_NSH_CLE
# include <apps/cle.h>
# include <apps/system/cle.h>
#else
# include <apps/readline.h>
# include <apps/system/readline.h>
#endif
#include "nsh.h"

View File

@ -50,7 +50,7 @@
#endif
#include <nuttx/version.h>
#include <apps/nsh.h>
#include <apps/nshlib/nshlib.h>
#include "nsh.h"
#include "nsh_console.h"

View File

@ -130,12 +130,17 @@ static const char g_scheduler[] = "Scheduler:";
static const char g_sigmask[] = "SigMask:";
#endif
#if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE)
static const char g_stacksize[] = "StackSize:";
static const char g_stackused[] = "StackUsed:";
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: ps_callback
* Name: nsh_parse_statusline
****************************************************************************/
#ifndef CONFIG_NSH_DISABLE_PS
@ -261,9 +266,14 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
FAR char *nextline;
int ret;
int i;
#if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE)
int stack_size;
int stack_used;
float stack_filled;
#endif
/* Task/thread entries in the /proc directory will all be (1) directories with
* (2) all numeric names.
/* Task/thread entries in the /proc directory will all be (1) directories
* with (2) all numeric names.
*/
if (!DIRENT_ISDIRECTORY(entryp->d_type))
@ -377,6 +387,85 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
nsh_output(vtbl, "%-8s ", status.td_sigmask);
#endif
#if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE)
/* Get the StackSize and StackUsed */
stack_size = 0;
stack_used = 0;
filepath = NULL;
ret = asprintf(&filepath, "%s/%s/stack", dirpath, entryp->d_name);
if (ret < 0 || filepath == NULL)
{
nsh_output(vtbl, g_fmtcmdfailed, "ps", "asprintf", NSH_ERRNO);
vtbl->iobuffer[0] = '\0';
}
else
{
ret = nsh_readfile(vtbl, "ps", filepath, vtbl->iobuffer, IOBUFFERSIZE);
free(filepath);
if (ret >= 0)
{
nextline = vtbl->iobuffer;
do
{
/* Find the beginning of the next line and NUL-terminate the
* current line.
*/
line = nextline;
for (nextline++;
*nextline != '\n' && *nextline != '\0';
nextline++);
if (*nextline == '\n')
{
*nextline++ = '\0';
}
else
{
nextline = NULL;
}
/* Parse the current line
*
* Format:
*
* 111111111122222222223
* 123456789012345678901234567890
* StackBase: xxxxxxxxxx
* StackSize: xxxx
* StackUsed: xxxx
*/
if (strncmp(line, g_stacksize, strlen(g_stacksize)) == 0)
{
stack_size = atoi(&line[12]);
}
else if (strncmp(line, g_stackused, strlen(g_stackused)) == 0)
{
stack_used = atoi(&line[12]);
}
}
while (nextline != NULL);
}
}
nsh_output(vtbl, "%6.6d ", stack_size);
nsh_output(vtbl, "%6.6d ", stack_used);
stack_filled = 0.0;
if (stack_size && stack_used)
{
stack_filled = (100.0 / stack_size * stack_used);
}
/* Additionally print a "!" if the stack is filled more than 80% */
nsh_output(vtbl, "%5.1f%%%s ", (double)stack_filled, (stack_filled >= 80 ? "!" : " "));
#endif
#ifdef NSH_HAVE_CPULOAD
/* Get the CPU load */
@ -478,6 +567,11 @@ int cmd_ps(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
#ifndef CONFIG_DISABLE_SIGNALS
nsh_output(vtbl, "%-8s ", "SIGMASK");
#endif
#if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE)
nsh_output(vtbl, "%6s ", "STACK");
nsh_output(vtbl, "%6s ", "USED");
nsh_output(vtbl, "%7s ", "FILLED");
#endif
#ifdef NSH_HAVE_CPULOAD
nsh_output(vtbl, "%6s ", "CPU");
#endif
@ -603,6 +697,7 @@ int cmd_usleep(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
nsh_output(vtbl, g_fmtarginvalid, argv[0]);
return ERROR;
}
usleep(usecs);
return OK;
}

View File

@ -43,9 +43,9 @@
#include <stdlib.h>
#ifdef CONFIG_NSH_CLE
# include <apps/cle.h>
# include <apps/system/cle.h>
#else
# include <apps/readline.h>
# include <apps/system/readline.h>
#endif
#include "nsh.h"

View File

@ -45,9 +45,9 @@
#include <apps/fsutils/passwd.h>
#ifdef CONFIG_NSH_CLE
# include <apps/cle.h>
# include <apps/system/cle.h>
#else
# include <apps/readline.h>
# include <apps/system/readline.h>
#endif
#include "nsh.h"

View File

@ -43,9 +43,9 @@
#include <stdlib.h>
#ifdef CONFIG_NSH_CLE
# include <apps/cle.h>
# include <apps/system/cle.h>
#else
# include <apps/readline.h>
# include <apps/system/readline.h>
#endif
#include "nsh.h"

View File

@ -0,0 +1,8 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
if ARCH_BOARD_OLIMEX_STM32E407
endif

View File

@ -1,6 +1,5 @@
############################################################################
# apps/system/usbmonitor/Make.defs
# Adds selected applications to apps/ build
# apps/platform/olimex-stm32-e407/Make.defs
#
# Copyright (C) 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
@ -34,7 +33,8 @@
#
############################################################################
ifeq ($(CONFIG_SYSTEM_USBMONITOR),y)
CONFIGURED_APPS += system/usbmonitor
endif
# Add platform specific sources to ASRCS and CSRCS
ifeq ($(CONFIG_HAVE_CXX),y)
CSRCS += stm32_cxxinitialize.c
endif

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/system/fhex2mem.c
* apps/platform/olimex-stm32-e407/src/stm32_cxxinitialize.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -39,77 +39,96 @@
#include <nuttx/config.h>
#include <stdio.h>
#include <assert.h>
#include <debug.h>
#include <nuttx/streams.h>
#include <apps/hex2bin.h>
#include <nuttx/arch.h>
#ifdef CONFIG_SYSTEM_HEX2BIN
#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Debug ********************************************************************/
/* Non-standard debug that may be enabled just for testing the static
* constructors.
*/
#ifdef CONFIG_DEBUG_CXX
# define cxxinfo _info
#else
# define cxxinfo(x...)
#endif
/****************************************************************************
* Private Types
****************************************************************************/
/* This type defines one entry in initialization array */
typedef void (*initializer_t)(void);
/****************************************************************************
* Private Functions
* External References
****************************************************************************/
/* _sinit and _einit are symbols exported by the linker script that mark the
* beginning and the end of the C++ initialization section.
*/
extern initializer_t _sinit;
extern initializer_t _einit;
/* _stext and _etext are symbols exported by the linker script that mark the
* beginning and the end of text.
*/
extern uint32_t _stext;
extern uint32_t _etext;
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name fhex2mem
* Name: up_cxxinitialize
*
* Description:
* Read the Intel HEX ASCII data provided on the standard stream
* 'instream' and write the binary to memory.
* If C++ and C++ static constructors are supported, then this function
* must be provided by board-specific logic in order to perform
* initialization of the static C++ class instances.
*
* If, for example, instream is stdin, then the HEX ASCII data would be
* taken from the console and written to memory.
*
* Input Parameters:
* instream - The incoming standard stream from which Intel HEX data
* will be received.
* baseaddr - The base address of the memory region stream.
* endpaddr - The end address (plus 1) of the memory region.
* swap - Controls byte ordering. See enum hex2bin_swap_e for
* description of the values.
*
* Returned Value
* Zero (OK) is returned on success; a negated errno value is returned on
* failure.
* This function should then be called in the application-specific
* user_start logic in order to perform the C++ initialization. NOTE
* that no component of the core NuttX RTOS logic is involved; this
* function definition only provides the 'contract' between application
* specific C++ code and platform-specific toolchain support.
*
****************************************************************************/
int fhex2mem(FAR FILE *instream, uint32_t baseaddr, uint32_t endpaddr,
enum hex2bin_swap_e swap)
void up_cxxinitialize(void)
{
struct lib_stdinstream_s stdinstream;
struct lib_memsostream_s memoutstream;
initializer_t *initp;
/* Check memory addresses */
cxxinfo("_sinit: %p _einit: %p _stext: %p _etext: %p\n",
&_sinit, &_einit, &_stext, &_etext);
DEBUGASSERT(instream && endpaddr > baseaddr);
/* Visit each entry in the initialization table */
/* Wrap the file descriptor as raw stream; wrap the memory as a memory
* stream.
for (initp = &_sinit; initp != &_einit; initp++)
{
initializer_t initializer = *initp;
cxxinfo("initp: %p initializer: %p\n", initp, initializer);
/* Make sure that the address is non-NULL and lies in the text region
* defined by the linker script. Some toolchains may put NULL values
* or counts in the initialization table.
*/
lib_stdinstream(&stdinstream, instream);
lib_memsostream(&memoutstream, (FAR char *)baseaddr,
(int)(endpaddr - baseaddr));
/* And do the deed */
return hex2bin(&stdinstream.public, &memoutstream.public,
(uint32_t)baseaddr, (uint32_t)endpaddr,
(enum hex2bin_swap_e)swap);
if ((void *)initializer > (void *)&_stext &&
(void *)initializer < (void *)&_etext)
{
cxxinfo("Calling %p\n", initializer);
initializer();
}
}
}
#endif /* CONFIG_SYSTEM_HEX2BIN */
#endif /* CONFIG_HAVE_CXX && CONFIG_HAVE_CXXINITIALIZE */

View File

@ -53,7 +53,7 @@
#include <nuttx/ascii.h>
#include <nuttx/vt100.h>
#include <apps/cle.h>
#include <apps/system/cle.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -53,7 +53,7 @@
#include <termios.h>
#include <debug.h>
#include <apps/readline.h>
#include <apps/system/readline.h>
#include "cu.h"

View File

@ -6,6 +6,7 @@
menuconfig SYSTEM_HEX2BIN
bool "Intel HEX to binary conversion"
default n
select LIB_HEX2BIN
---help---
Enable support for a logic to convert Intel HEX format to binary.
@ -114,11 +115,4 @@ config SYSTEM_HEX2MEM_USAGE
instructions.
endif # SYSTEM_HEX2MEM_BUILTIN
config SYSTEM_HEX2BIN_DEBUG
bool "Hex2bin detailed error output"
default n
---help---
Enable extended error output.
endif # SYSTEM_HEX2BIN

View File

@ -37,10 +37,10 @@
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
# I2C tool
# Hex2bin utility
ASRCS =
CSRCS = hex2bin.c hex2mem.c fhex2mem.c
CSRCS =
ifeq ($(CONFIG_BUILD_KERNEL),y)
@ -66,9 +66,10 @@ HEX2MEM_MAINOBJ = $(HEX2MEM_MAINSRC:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)
MAINOBJ = $(HEX2BIN_MAINOBJ) $(HEX2MEM_MAINOBJ)
ifneq ($(CONFIG_BUILD_KERNEL),y)
OBJS += $(HEX2BIN_MAINOBJ) $(HEX2MEM_MAINOBJ)
OBJS += $(MAINOBJ)
endif
ifeq ($(CONFIG_WINDOWS_NATIVE),y)

View File

@ -1,715 +0,0 @@
/****************************************************************************
* apps/system/hex2bin.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* References:
* - http://en.wikipedia.org/wiki/Intel_HEX
* - Hexadecimal Object File Format Specification, Revision A January 6,
* 1988, Intel
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdint.h>
#include <errno.h>
#include <nuttx/streams.h>
#include <apps/hex2bin.h>
#ifdef CONFIG_SYSTEM_HEX2BIN
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* ASCII record sizes */
#define BYTECOUNT_ASCSIZE 2
#define ADDRESS_ASCSIZE 4
#define RECTYPE_ASCSIZE 2
#define BYTECOUNT_LINENDX (0)
#define ADDRESS_LINENDX (BYTECOUNT_LINENDX + BYTECOUNT_ASCSIZE)
#define RECTYPE_LINENDX (ADDRESS_LINENDX + ADDRESS_ASCSIZE)
#define DATA_LINENDX (RECTYPE_LINENDX + RECTYPE_ASCSIZE)
#define HEADER_ASCSIZE DATA_LINENDX
#define CHECKSUM_ASCSIZE 2
#define TRAILER_SIZE (CHECKSUM_ASCSIZE)
#define MAXDATA_BINSIZE 255
#define RECORD_ASCSIZE(n) (HEADER_ASCSIZE + TRAILER_SIZE + 2*(n))
#define MAXRECORD_ASCSIZE RECORD_ASCSIZE(MAXDATA_BINSIZE)
#define MINRECORD_ASCSIZE RECORD_ASCSIZE(0)
#define LINE_ALLOC MAXRECORD_ASCSIZE
/* Binary record sizes */
#define BYTECOUNT_BINSIZE 1
#define ADDRESS_BINSIZE 2
#define RECTYPE_BINSIZE 1
#define BYTECOUNT_BINNDX (0)
#define ADDRESS_BINNDX (BYTECOUNT_BINNDX + BYTECOUNT_BINSIZE)
#define RECTYPE_BINNDX (ADDRESS_BINNDX + ADDRESS_BINSIZE)
#define DATA_BINNDX (RECTYPE_BINNDX + RECTYPE_BINSIZE)
#define HEADER_BINSIZE DATA_BINNDX
#define CHECKSUM_BINSIZE 1
#define TRAILER_BINSIZE CHECKSUM_BINSIZE
#define RECORD_BINSIZE(n) (HEADER_BINSIZE + TRAILER_BINSIZE + (n))
#define MAXRECORD_BINSIZE RECORD_BINSIZE(MAXDATA_BINSIZE)
#define MINRECORD_BKINSIZE RECORD_BINSIZE(0)
#define BIN_ALLOC MAXRECORD_BINSIZE
/* Record start code */
#define RECORD_STARTCODE ':'
/* Record Types */
#define RECORD_DATA 0 /* Data */
#define RECORD_EOF 1 /* End of file */
#define RECORD_EXT_SEGADDR 2 /* Extended segment address record */
#define RECORD_START_SEGADDR 3 /* Start segment address record */
#define RECORD_EXT_LINADDR 4 /* Extended linear address record */
#define RECORD_START_LINADDR 5 /* Start linear address record */
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: nibble2bin
****************************************************************************/
static int nibble2bin(uint8_t ascii)
{
if (ascii >= '0' && ascii <= '9')
{
return (ascii - 0x30);
}
else if (ascii >= 'a' && ascii <= 'f')
{
return (ascii - 'a' + 10);
}
else if (ascii >= 'A' && ascii <= 'F')
{
return (ascii - 'A' + 10);
}
return -EINVAL;
}
/****************************************************************************
* Name: byte2bin
****************************************************************************/
static int byte2bin(FAR const uint8_t *ascii)
{
int nibble;
int byte;
/* Get the MS nibble (big endian order) */
nibble = nibble2bin(*ascii++);
if (nibble < 0)
{
return nibble;
}
byte = (nibble << 4);
/* Get the MS nibble */
nibble = nibble2bin(*ascii);
if (nibble < 0)
{
return nibble;
}
byte |= nibble;
return byte;
}
/****************************************************************************
* Name: word2bin
****************************************************************************/
#if 0 /* Not used */
static int word2bin(FAR const char *ascii)
{
int byte;
int word;
/* Get the MS byte (big endian order) */
byte = word2bin(ascii);
if (byte < 0)
{
return byte;
}
word = (byte << 8);
/* Get the MS byte */
byte = word2bin(ascii + 2);
if (byte < 0)
{
return byte;
}
word |= byte;
return word;
}
#endif
/****************************************************************************
* Name: data2bin
****************************************************************************/
int data2bin(FAR uint8_t* dest, FAR const uint8_t *src, int nsrcbytes)
{
int byte;
/* An even number of source bytes is expected */
if ((nsrcbytes & 1) != 0)
{
return -EINVAL;
}
/* Convert src bytes in groups of 2, writing one byte to the output on each
* pass through the loop. */
while (nsrcbytes > 0)
{
/* Get the MS nibble (big endian order) */
byte = byte2bin(src);
if (byte < 0)
{
return byte;
}
src += 2;
/* And write the byte to the destination */
*dest++ = byte;
nsrcbytes -= 2;
}
return OK;
}
/****************************************************************************
* Name: readstream
****************************************************************************/
static int readstream(FAR struct lib_instream_s *instream,
FAR uint8_t *line, unsigned int lineno)
{
int nbytes = 0;
int ch;
/* Skip until the beginning of line start code is encountered */
ch = instream->get(instream);
while (ch != RECORD_STARTCODE && ch != EOF)
{
ch = instream->get(instream);
}
/* Skip over the startcode */
if (ch != EOF)
{
ch = instream->get(instream);
}
/* Then read, verify, and buffer until the end of line is encountered */
while (ch != EOF && nbytes < (MAXRECORD_ASCSIZE-1))
{
#if defined(CONFIG_EOL_IS_LF)
if (ch == '\n')
{
*line = '\0';
return nbytes;
}
#elif defined(CONFIG_EOL_IS_BOTH_CRLF)
if (ch == '\r')
{
continue;
}
else if (ch == '\n')
{
*line = '\0';
return nbytes;
}
#elif defined(CONFIG_EOL_IS_CR)
if (ch == '\r')
{
*line = '\0';
return nbytes;
}
#elif defined(CONFIG_EOL_IS_EITHER_CRLF)
if (ch == '\n' || ch == '\r')
{
*line = '\0';
return nbytes;
}
#endif
/* Only hex data goes into the line buffer */
else if (isxdigit(ch))
{
*line++ = ch;
nbytes++;
}
else if (!isspace(ch)) /* Not expected */
{
hex2bin_debug("Line %u ERROR: Unexpected character %c[%02x] in stream\n",
lineno, isprint(ch) ? ch : '.', ch);
break;
}
/* Read the next character from the input stream */
ch = instream->get(instream);
}
/* Some error occurred: Unexpected EOF, line too long, or bad character in
* stream
*/
hex2bin_debug("Line %u ERROR: Failed to read line. %d characters read\n",
lineno, nbytes);
return EOF;
}
/****************************************************************************
* Name: hex2bin_swap16 and hex2bin_swap32
****************************************************************************/
static inline void hex2bin_swap16(FAR uint8_t *data, int bytecount)
{
for (; bytecount > 0; bytecount -= 2)
{
uint8_t b0 = data[0];
uint8_t b1 = data[1];
*data++ = b1;
*data++ = b0;
}
}
static inline void hex2bin_swap32(FAR uint8_t *data, int bytecount)
{
for (; bytecount > 0; bytecount -= 4)
{
uint8_t b0 = data[0];
uint8_t b1 = data[1];
uint8_t b2 = data[2];
uint8_t b3 = data[3];
*data++ = b3;
*data++ = b2;
*data++ = b1;
*data++ = b0;
}
}
/****************************************************************************
* Name: writedata
****************************************************************************/
static inline void writedata(FAR struct lib_sostream_s *outstream,
FAR uint8_t *data, int bytecount)
{
for (; bytecount > 0; bytecount--)
{
outstream->put(outstream, *data++);
}
}
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: hex2bin
*
* Description:
* Read the Intel HEX ASCII data provided on the serial IN stream and write
* the binary to the seek-able serial OUT stream.
*
* These streams may be files or, in another usage example, the IN stream
* could be a serial port and the OUT stream could be a memory stream. This
* would decode and write the serial input to memory.
*
* Input Parameters:
* instream - The incoming stream from which Intel HEX data will be
* received.
* outstream - The outgoing stream in which binary data will be written.
* baseaddr - The base address of the outgoing stream. Seeking in the
* output stream will be relative to this address.
* endpaddr - The end address (plus 1) of the outgoing stream. This
* value is used only for range checking. endpaddr must
* be larger than baseaddr. A zero value for endpaddr
* disables range checking.
* swap - Controls byte ordering. See enum hex2bin_swap_e for
* description of the values.
*
* Returned Value
* Zero (OK) is returned on success; a negated errno value is returned on
* failure.
*
****************************************************************************/
int hex2bin(FAR struct lib_instream_s *instream,
FAR struct lib_sostream_s *outstream, uint32_t baseaddr,
uint32_t endpaddr, enum hex2bin_swap_e swap)
{
FAR uint8_t *alloc;
FAR uint8_t *line;
FAR uint8_t *bin;
int nbytes;
int bytecount;
uint32_t address;
uint32_t endaddr;
uint32_t expected;
uint16_t extension;
uint16_t address16;
uint8_t checksum;
unsigned int lineno;
int i;
int ret = OK;
/* Allocate buffer memory */
alloc = (FAR uint8_t *)malloc(LINE_ALLOC + BIN_ALLOC);
if (alloc == NULL)
{
hex2bin_debug("ERROR: Failed to allocate memory\n");
return -ENOMEM;
}
line = alloc;
bin = &alloc[LINE_ALLOC];
extension = 0;
expected = 0;
lineno = 0;
while ((nbytes = readstream(instream, line, lineno)) != EOF)
{
/* Increment the line number */
lineno++;
/* Did we read enough data to do anything? */
if (nbytes < MINRECORD_ASCSIZE)
{
hex2bin_debug("Line %u ERROR: Record too short: %d\n",
lineno, nbytes);
goto errout_with_einval;
}
/* We should always read an even number of bytes */
if ((nbytes & 1) != 0)
{
hex2bin_debug("Line %u ERROR: Record length is odd: %d\n",
lineno, nbytes);
goto errout_with_einval;
}
/* Get the data byte count */
bytecount = byte2bin(&line[BYTECOUNT_LINENDX]);
if (bytecount < 0)
{
hex2bin_debug("Line %u ERROR: Failed to read bytecount: %d\n",
lineno, bytecount);
ret = bytecount;
goto errout_with_buffers;
}
/* Verify that the bytecount matches the length of the record */
if (RECORD_ASCSIZE(bytecount) != nbytes)
{
hex2bin_debug("Line %u ERROR: Expected %d bytes, read %d\n",
lineno, RECORD_ASCSIZE(bytecount), nbytes);
goto errout_with_einval;
}
/* Convert the entire line to binary. We need to do this for
* checksum calculation which includes the entire line (minus
* the start code and the checksum at the end of the line itself)
*/
ret = data2bin(bin, line, nbytes);
if (ret < 0)
{
hex2bin_debug("Line %u ERROR: Failed to convert line to binary: %d\n",
lineno, ret);
goto errout_with_buffers;
}
/* Calculate and verify the checksum over all of the data */
nbytes >>= 1; /* Number of bytes in bin[] */
checksum = 0;
for (i = 0; i < nbytes; i++)
{
checksum += bin[i];
}
if (checksum != 0)
{
hex2bin_debug("Line %u ERROR: Bad checksum %02x\n",
lineno, checksum);
goto errout_with_einval;
}
/* Get the 16-bit (unextended) address from the record */
address16 = (uint16_t)bin[ADDRESS_BINNDX] << 8 |
(uint16_t)bin[ADDRESS_BINNDX+1];
/* Handle the record by its record type */
switch (bin[RECTYPE_BINNDX])
{
case RECORD_DATA: /* Data */
{
/* Swap data in place in the binary buffer as required */
switch (swap)
{
case HEX2BIN_NOSWAP: /* No swap, stream is the correct byte order */
break;
case HEX2BIN_SWAP16: /* Swap bytes in 16-bit values */
{
if ((bytecount & 1) != 0)
{
hex2bin_debug("Line %d ERROR: Byte count %d is not a multiple of 2\n",
lineno, bytecount);
goto errout_with_einval;
}
/* Do the byte swap */
hex2bin_swap16(&bin[DATA_BINNDX], bytecount);
}
break;
case HEX2BIN_SWAP32: /* Swap bytes in 32-bit values */
{
if ((bytecount & 3) != 0)
{
hex2bin_debug("Line %d ERROR: Byte count %d is not a multiple of 4\n",
lineno, bytecount);
goto errout_with_einval;
}
/* Do the byte swap */
hex2bin_swap32(&bin[DATA_BINNDX], bytecount);
}
break;
default:
{
hex2bin_debug("ERROR: Invalid swap argument: %d\n", swap);
goto errout_with_einval;
}
}
/* Get and verify the full 32-bit address */
address = ((uint32_t)extension << 16) | (uint32_t)address16;
endaddr = address + bytecount;
if (address < baseaddr || (endpaddr != 0 && endaddr >= endpaddr))
{
hex2bin_debug("Line %d ERROR: Extended address %08lx is out of range\n",
lineno, (unsigned long)address);
goto errout_with_einval;
}
/* Seek to the correct position in the OUT stream if we have
* made an unexpected jump in the data address.
*/
if (address != expected)
{
off_t pos = outstream->seek(outstream, address - baseaddr, SEEK_SET);
if (pos == (off_t)-1)
{
hex2bin_debug("Line %u ERROR: Seek to address %08lu failed\n",
lineno, (unsigned long)address);
ret = -ESPIPE;
goto errout_with_buffers;
}
}
/* Transfer data to the OUT stream */
writedata(outstream, &bin[DATA_BINNDX], bytecount);
/* This is the next data address that we expect to see */
expected = address + bytecount;
}
break;
case RECORD_EOF: /* End of file */
/* End Of File record. Must occur exactly once per file in the
* last line of the file. The byte count is 00 and the data field
* is empty. Usually the address field is also 0000.
*/
if (bytecount == 0)
{
ret = OK;
goto exit_with_buffers;
}
hex2bin_debug("Line %u ERROR: Nonzero bytecount %d in EOF\n",
lineno, bytecount);
goto errout_with_einval;
case RECORD_EXT_SEGADDR: /* Extended segment address record */
/* The address specified by the data field is multiplied by 16
* (shifted 4 bits left) and added to the subsequent data record
* addresses. This allows addressing of up to a megabyte of
* address space. The address field of this record has to be
* 0000, the byte count is 02 (the segment is 16-bit). The
* least significant hex digit of the segment address is always
* 0.
*/
if (bytecount != 2 || address16 != 0 || bin[DATA_BINNDX+1] != 0)
{
hex2bin_debug("Line %u ERROR: Invalid segment address\n",
lineno);
hex2bin_debug(" bytecount=%d address=%04x segment=%02x%02x\n",
bytecount, address16, bin[DATA_BINNDX],
bin[DATA_BINNDX+1]);
goto errout_with_einval;
}
extension = (uint16_t)bin[DATA_BINNDX];
break;
case RECORD_START_SEGADDR: /* Start segment address record */
/* For 80x86 processors, it specifies the initial content of
* the CS:IP registers. The address field is 0000, the byte
* count is 04, the first two bytes are the CS value, the
* latter two are the IP value.
*/
break;
case RECORD_EXT_LINADDR: /* Extended linear address record */
/* The address field is 0000, the byte count is 02. The two
* data bytes (two hex digit pairs in big endian order)
* represent the upper 16 bits of the 32 bit address for
* all subsequent 00 type records until the next 04 type
* record comes. If there is not a 04 type record, the
* upper 16 bits default to 0000. To get the absolute
* address for subsequent 00 type records, the address
* specified by the data field of the most recent 04 record
* is added to the 00 record addresses.
*/
if (bytecount != 2 || address16 != 0)
{
hex2bin_debug("Line %u ERROR: Invalid linear address\n",
lineno);
hex2bin_debug(" bytecount=%d address=%04x\n",
bytecount, address16);
goto errout_with_einval;
}
extension = (uint16_t)bin[DATA_BINNDX] << 8 |
(uint16_t)bin[DATA_BINNDX+1];
break;
case RECORD_START_LINADDR: /* Start linear address record */
/* The address field is 0000, the byte count is 04. The 4
* data bytes represent the 32-bit value loaded into the EIP
* register of the 80386 and higher CPU.
*/
break;
default:
break;
}
}
hex2bin_debug("ERROR: No EOF record found\n");
errout_with_einval:
ret = -EINVAL;
errout_with_buffers:
exit_with_buffers:
free(alloc);
return ret;
}
#endif /* CONFIG_SYSTEM_HEX2BIN */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/system/hex2bin_main.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -43,9 +43,9 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <hex2bin.h>
#include <nuttx/streams.h>
#include <apps/hex2bin.h>
#ifdef CONFIG_SYSTEM_HEX2BIN_BUILTIN

View File

@ -1,115 +0,0 @@
/****************************************************************************
* apps/system/hex2mem.c
*
* Copyright (C) 2014 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
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <assert.h>
#include <nuttx/streams.h>
#include <apps/hex2bin.h>
#ifdef CONFIG_SYSTEM_HEX2BIN
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name hex2mem
*
* Description:
* Read the Intel HEX ASCII data provided on the file descriptor 'fd' and
* write the binary to memory.
*
* If, for example, fd is zero (stdin), then the HEX ASCII data would be
* taken from the console and written to memory.
*
* Input Parameters:
* fd - The file descriptor from which Intel HEX data will be
* received.
* baseaddr - The base address of the memory region stream.
* endpaddr - The end address (plus 1) of the memory region.
* swap - Controls byte ordering. See enum hex2bin_swap_e for
* description of the values.
*
* Returned Value
* Zero (OK) is returned on success; a negated errno value is returned on
* failure.
*
****************************************************************************/
int hex2mem(int fd, uint32_t baseaddr, uint32_t endpaddr,
enum hex2bin_swap_e swap)
{
struct lib_rawinstream_s rawinstream;
struct lib_memsostream_s memoutstream;
/* Check memory addresses */
DEBUGASSERT(fd >= 0 && endpaddr > baseaddr);
/* Wrap the file descriptor as raw stream; wrap the memory as a memory
* stream.
*/
lib_rawinstream(&rawinstream, fd);
lib_memsostream(&memoutstream, (FAR char *)baseaddr,
(int)(endpaddr - baseaddr));
/* And do the deed */
return hex2bin(&rawinstream.public, &memoutstream.public,
(uint32_t)baseaddr, (uint32_t)endpaddr,
(enum hex2bin_swap_e)swap);
}
#endif /* CONFIG_SYSTEM_HEX2BIN */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* apps/system/hex2mem_main.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -43,20 +43,12 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <hex2bin.h>
#include <nuttx/streams.h>
#include <apps/hex2bin.h>
#ifdef CONFIG_SYSTEM_HEX2MEM_BUILTIN
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Types
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/

View File

@ -60,7 +60,7 @@
#include <debug.h>
#include <nuttx/audio/audio.h>
#include <apps/nxplayer.h>
#include <apps/system/nxplayer.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -49,8 +49,8 @@
#include <errno.h>
#include <assert.h>
#include <apps/readline.h>
#include <apps/nxplayer.h>
#include <apps/system/readline.h>
#include <apps/system/nxplayer.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -10,7 +10,7 @@ menuconfig SYSTEM_PRUN
---help---
Build the Pascal P-Code interpreter / Virtual machine. This selection
just builds a library of P-Code-related functions as described in
include/apps/prun.h. This selection is also necessary to enable other
include/apps/system/prun.h. This selection is also necessary to enable other
P-Code related features.
if SYSTEM_PRUN

View File

@ -45,7 +45,7 @@
#include <assert.h>
#include <errno.h>
#include <apps/prun.h>
#include <apps/system/prun.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -44,7 +44,7 @@
#include <errno.h>
#include <debug.h>
#include <apps/prun.h>
#include <apps/system/prun.h>
#include "pexec.h"
#include "pedefs.h"

View File

@ -45,7 +45,7 @@
#include <errno.h>
#include <assert.h>
#include <apps/readline.h>
#include <apps/system/readline.h>
#include "readline.h"
/****************************************************************************

View File

@ -50,7 +50,7 @@
#include <nuttx/vt100.h>
#include <nuttx/binfmt/builtin.h>
#include <apps/readline.h>
#include <apps/system/readline.h>
#include "readline.h"
/****************************************************************************

View File

@ -41,7 +41,7 @@
#include <sys/types.h>
#include <nuttx/arch.h>
#include <apps/readline.h>
#include <apps/system/readline.h>
#include "readline.h"

View File

@ -41,7 +41,7 @@
#include <stdio.h>
#include <string.h>
#include <apps/readline.h>
#include <apps/system/readline.h>
/****************************************************************************
* Pre-processor Definitions

View File

@ -45,7 +45,7 @@ call traps.
Your board-level start up code code then needs to select the symbol table
by calling the function symtab_initialize():
#include <apps/symtab.h>
#include <apps/system/symtab.h>
...
symtab_initialize();

View File

@ -43,7 +43,7 @@
#include <nuttx/compiler.h>
#include <sys/boardctl.h>
#include <apps/symtab.h>
#include <apps/system/symtab.h>
#include "symtab.inc"

View File

@ -1,11 +0,0 @@
/Make.dep
/.depend
/.built
/*.asm
/*.rel
/*.lst
/*.sym
/*.adb
/*.lib
/*.src
/*.obj

View File

@ -1,70 +0,0 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menuconfig SYSTEM_USBMONITOR
bool "USB Monitor"
default n
depends on (USBDEV && USBDEV_TRACE) || (USBHOST && USBHOST_TRACE)
---help---
If USB device tracing (USBDEV_TRACE) AND/OR USB host tracing
(USBHOST_TRACE) are enabled then this option will select the USB
monitor. The USB monitor is a daemon that will periodically collect
the buffered USB trace data and dump it to the SYSLOG device.
if SYSTEM_USBMONITOR
config SYSTEM_USBMONITOR_STACKSIZE
int "USB Monitor daemon stack size"
default 2048
---help---
The stack size to use the the USB monitor daemon. Default: 2048
config SYSTEM_USBMONITOR_PRIORITY
int "USB Monitor daemon priority"
default 50
---help---
The priority to use the the USB monitor daemon. Default: 50
config SYSTEM_USBMONITOR_INTERVAL
int "USB Monitor dump frequency"
default 2
---help---
The rate in seconds that the USB monitor will wait before dumping
the next set of buffered USB trace data. Default: 2 seconds.
if USBDEV && USBDEV_TRACE
config SYSTEM_USBMONITOR_TRACEINIT
bool "Show USB device initialization events"
default n
---help---
Show initialization events
config SYSTEM_USBMONITOR_TRACECLASS
bool "Show USB device class driver events"
default n
---help---
Show class driver events
config SYSTEM_USBMONITOR_TRACETRANSFERS
bool "Show USB device data transfer events"
default n
---help---
Show data transfer events
config SYSTEM_USBMONITOR_TRACECONTROLLER
bool "Show USB device controller events"
default n
---help---
Show controller events
config SYSTEM_USBMONITOR_TRACEINTERRUPTS
bool "Show USB device interrupt-related events"
default n
---help---
Show interrupt-related events
endif
endif

View File

@ -1,121 +0,0 @@
############################################################################
# apps/system/usbmonitor/Makefile
#
# Copyright (C) 2013 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
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/.config
-include $(TOPDIR)/Make.defs
include $(APPDIR)/Make.defs
ifeq ($(WINTOOL),y)
INCDIROPT = -w
endif
# USB Monitor Application
PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = 768
ASRCS =
CSRCS = usbmonitor.c
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BIN = ..\..\libapps$(LIBEXT)
else
ifeq ($(WINTOOL),y)
BIN = ..\\..\\libapps$(LIBEXT)
else
BIN = ../../libapps$(LIBEXT)
endif
endif
ROOTDEPPATH = --dep-path .
# Common build
VPATH =
all: .built
.PHONY: context depend clean distclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
$(COBJS): %$(OBJEXT): %.c
$(call COMPILE, $<, $@)
.built: $(OBJS)
$(call ARCHIVE, $(BIN), $(OBJS))
$(Q) touch .built
install:
# Register application
ifeq ($(CONFIG_NSH_BUILTIN_APPS),y)
$(BUILTIN_REGISTRY)$(DELIM)usbmonitor_start.bdat: $(DEPCONFIG) Makefile
$(call REGISTER,"usbmon_start",$(PRIORITY),$(STACKSIZE),usbmonitor_start)
$(BUILTIN_REGISTRY)$(DELIM)usbmonitor_stop.bdat: $(DEPCONFIG) Makefile
$(call REGISTER,"usbmon_stop",$(PRIORITY),$(STACKSIZE),usbmonitor_stop)
context: $(BUILTIN_REGISTRY)$(DELIM)usbmonitor_start.bdat $(BUILTIN_REGISTRY)$(DELIM)usbmonitor_stop.bdat
else
context:
endif
# Create dependencies
.depend: Makefile $(SRCS)
$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
$(Q) touch $@
depend: .depend
clean:
$(call DELFILE, .built)
$(call CLEAN)
distclean: clean
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
-include Make.dep
.PHONY: preconfig
preconfig:

View File

@ -1,265 +0,0 @@
/****************************************************************************
* apps/system/usbmonitor/usbmonitor.c
*
* Copyright (C) 2013 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
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/progmem.h>
#include <sys/types.h>
#include <stdarg.h>
#include <stdbool.h>
#include <unistd.h>
#include <sched.h>
#include <syslog.h>
#include <errno.h>
#include <nuttx/usb/usbdev_trace.h>
#include <nuttx/usb/usbhost_trace.h>
#ifdef CONFIG_SYSTEM_USBMONITOR
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define USBMON_PREFIX "USB Monitor: "
/* Configuration ************************************************************/
#ifndef CONFIG_SYSTEM_USBMONITOR_STACKSIZE
# define CONFIG_SYSTEM_USBMONITOR_STACKSIZE 2048
#endif
#ifndef CONFIG_SYSTEM_USBMONITOR_PRIORITY
# define CONFIG_SYSTEM_USBMONITOR_PRIORITY 50
#endif
#ifndef CONFIG_SYSTEM_USBMONITOR_INTERVAL
# define CONFIG_SYSTEM_USBMONITOR_INTERVAL 2
#endif
/* USB device trace selection */
#ifdef CONFIG_USBDEV_TRACE
# ifdef CONFIG_SYSTEM_USBMONITOR_TRACEINIT
# define TRACE_INIT_BITS (TRACE_INIT_BIT)
# else
# define TRACE_INIT_BITS (0)
# endif
# define TRACE_ERROR_BITS (TRACE_DEVERROR_BIT|TRACE_CLSERROR_BIT)
# ifdef CONFIG_SYSTEM_USBMONITOR_TRACECLASS
# define TRACE_CLASS_BITS (TRACE_CLASS_BIT|TRACE_CLASSAPI_BIT|\
TRACE_CLASSSTATE_BIT)
# else
# define TRACE_CLASS_BITS (0)
# endif
# ifdef CONFIG_SYSTEM_USBMONITOR_TRACETRANSFERS
# define TRACE_TRANSFER_BITS (TRACE_OUTREQQUEUED_BIT|TRACE_INREQQUEUED_BIT|\
TRACE_READ_BIT|TRACE_WRITE_BIT|\
TRACE_COMPLETE_BIT)
# else
# define TRACE_TRANSFER_BITS (0)
# endif
# ifdef CONFIG_SYSTEM_USBMONITOR_TRACECONTROLLER
# define TRACE_CONTROLLER_BITS (TRACE_EP_BIT|TRACE_DEV_BIT)
# else
# define TRACE_CONTROLLER_BITS (0)
# endif
# ifdef CONFIG_SYSTEM_USBMONITOR_TRACEINTERRUPTS
# define TRACE_INTERRUPT_BITS (TRACE_INTENTRY_BIT|TRACE_INTDECODE_BIT|\
TRACE_INTEXIT_BIT)
# else
# define TRACE_INTERRUPT_BITS (0)
# endif
# define TRACE_BITSET (TRACE_INIT_BITS|TRACE_ERROR_BITS|\
TRACE_CLASS_BITS|TRACE_TRANSFER_BITS|\
TRACE_CONTROLLER_BITS|TRACE_INTERRUPT_BITS)
#endif
/****************************************************************************
* Private Types
****************************************************************************/
struct usbmon_state_s
{
volatile bool started;
volatile bool stop;
pid_t pid;
};
/****************************************************************************
* Private Data
****************************************************************************/
static struct usbmon_state_s g_usbmonitor;
/****************************************************************************
* Private Functions
****************************************************************************/
#ifdef CONFIG_USBDEV_TRACE
static int usbtrace_syslog(FAR const char *fmt, ...)
{
va_list ap;
int ret;
/* Let vsyslog do the real work */
va_start(ap, fmt);
ret = vsyslog(LOG_INFO, fmt, ap);
va_end(ap);
return ret;
}
static int usbmonitor_tracecallback(struct usbtrace_s *trace, void *arg)
{
usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value);
return 0;
}
#endif
static int usbmonitor_daemon(int argc, char **argv)
{
syslog(LOG_INFO, USBMON_PREFIX "Running: %d\n", g_usbmonitor.pid);
/* Loop until we detect that there is a request to stop. */
while (!g_usbmonitor.stop)
{
sleep(CONFIG_SYSTEM_USBMONITOR_INTERVAL);
#ifdef CONFIG_USBDEV_TRACE
(void)usbtrace_enumerate(usbmonitor_tracecallback, NULL);
#endif
#ifdef CONFIG_USBHOST_TRACE
(void)usbhost_trdump();
#endif
}
/* Stopped */
g_usbmonitor.stop = false;
g_usbmonitor.started = false;
syslog(LOG_INFO, USBMON_PREFIX "Stopped: %d\n", g_usbmonitor.pid);
return 0;
}
/****************************************************************************
* Public Functions
****************************************************************************/
int usbmonitor_start(int argc, char **argv)
{
/* Has the monitor already started? */
sched_lock();
if (!g_usbmonitor.started)
{
int ret;
/* No.. start it now */
#ifdef CONFIG_USBDEV_TRACE
/* First, initialize any USB tracing options that were requested */
usbtrace_enable(TRACE_BITSET);
#endif
/* Then start the USB monitoring daemon */
g_usbmonitor.started = true;
g_usbmonitor.stop = false;
ret = task_create("USB Monitor", CONFIG_SYSTEM_USBMONITOR_PRIORITY,
CONFIG_SYSTEM_USBMONITOR_STACKSIZE,
(main_t)usbmonitor_daemon, (FAR char * const *)NULL);
if (ret < 0)
{
int errcode = errno;
syslog(LOG_INFO, USBMON_PREFIX
"ERROR: Failed to start the USB monitor: %d\n",
errcode);
}
else
{
g_usbmonitor.pid = ret;
syslog(LOG_INFO, USBMON_PREFIX "Started: %d\n",
g_usbmonitor.pid);
}
sched_unlock();
return 0;
}
sched_unlock();
syslog(LOG_INFO, USBMON_PREFIX "%s: %d\n",
g_usbmonitor.stop ? "Stopping" : "Running", g_usbmonitor.pid);
return 0;
}
int usbmonitor_stop(int argc, char **argv)
{
/* Has the monitor already started? */
if (g_usbmonitor.started)
{
/* Stop the USB monitor. The next time the monitor wakes up,
* it will see the the stop indication and will exist.
*/
syslog(LOG_INFO, USBMON_PREFIX "Stopping: %d\n", g_usbmonitor.pid);
g_usbmonitor.stop = true;
#ifdef CONFIG_USBDEV_TRACE
/* We may as well disable tracing since there is no listener */
usbtrace_enable(0);
#endif
}
syslog(LOG_INFO, USBMON_PREFIX "Stopped: %d\n", g_usbmonitor.pid);
return 0;
}
#endif /* CONFIG_SYSTEM_USBMONITOR */

View File

@ -49,7 +49,7 @@
#include <time.h>
#include <errno.h>
#include <apps/zmodem.h>
#include <apps/system/zmodem.h>
/****************************************************************************
* Private Functions

View File

@ -49,7 +49,7 @@
#include <time.h>
#include <errno.h>
#include <apps/zmodem.h>
#include <apps/system/zmodem.h>
/****************************************************************************
* Private Functions

View File

@ -53,7 +53,7 @@
#include <nuttx/compiler.h>
#include <nuttx/ascii.h>
#include <apps/zmodem.h>
#include <apps/system/zmodem.h>
/****************************************************************************
* Pre-processor Definitions

Some files were not shown because too many files have changed in this diff Show More