diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-06-16 15:43:23 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-06-16 15:43:23 -0600 |
commit | 2d4eb806259e4c25892ee0a9f882654d49a5cec6 (patch) | |
tree | 0cb4eead31837bb0dc42a4428f817e52d0ac8bb9 /apps/system/hex2bin/hex2mem_main.c | |
parent | 656b350aa0222f1555978837532e537f6dd4f14c (diff) | |
download | px4-nuttx-2d4eb806259e4c25892ee0a9f882654d49a5cec6.tar.gz px4-nuttx-2d4eb806259e4c25892ee0a9f882654d49a5cec6.tar.bz2 px4-nuttx-2d4eb806259e4c25892ee0a9f882654d49a5cec6.zip |
hex2bin: Add alternative interface layers to illustrate how to load programs
Diffstat (limited to 'apps/system/hex2bin/hex2mem_main.c')
-rw-r--r-- | apps/system/hex2bin/hex2mem_main.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/system/hex2bin/hex2mem_main.c b/apps/system/hex2bin/hex2mem_main.c index 86c061c23..b8b814d60 100644 --- a/apps/system/hex2bin/hex2mem_main.c +++ b/apps/system/hex2bin/hex2mem_main.c @@ -95,11 +95,7 @@ static void show_usage(FAR const char *progname, int exitcode) } /**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: + * Public Functions ****************************************************************************/ /**************************************************************************** @@ -113,7 +109,7 @@ static void show_usage(FAR const char *progname, int exitcode) * * Returned Value * EXIT_SUCESS on success; EXIT_FAILURE on failure - * + * ****************************************************************************/ int hex2mem_main(int argc, char **argv) @@ -139,9 +135,11 @@ int hex2mem_main(int argc, char **argv) { switch (option) { +#ifdef CONFIG_SYSTEM_HEX2MEM_USAGE case 'h': show_usage(argv[0], EXIT_SUCCESS); break; +#endif case 's': baseaddr = strtoul(optarg, &endptr, 16); @@ -221,12 +219,13 @@ int hex2mem_main(int argc, char **argv) return -errcode; } - /* Wrap the FILE stream as standard streams; wrap the memory as a memory + /* Wrap the FILE stream as a standard stream; wrap the memory as a memory * stream. */ lib_stdinstream(&stdinstream, instream); - lib_memsostream(&memoutstream, (FAR char *)baseaddr, (int)(endpaddr - baseaddr)); + lib_memsostream(&memoutstream, (FAR char *)baseaddr, + (int)(endpaddr - baseaddr)); /* And do the deed */ |