diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-09 14:54:29 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-09 14:54:29 +0000 |
commit | d04ce723f0872cda3ebcc496efd45965a6ec3a70 (patch) | |
tree | 5dec10051ddb12ddf1d6d7f02c69d09ad2a27895 | |
parent | bf340e0ab5a30b324ce56d09f6be0fa630990327 (diff) | |
download | px4-firmware-d04ce723f0872cda3ebcc496efd45965a6ec3a70.tar.gz px4-firmware-d04ce723f0872cda3ebcc496efd45965a6ec3a70.tar.bz2 px4-firmware-d04ce723f0872cda3ebcc496efd45965a6ec3a70.zip |
Several patches from Petteri Aimonen (mostly NxWidgets)
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5324 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | NxWidgets/ChangeLog.txt | 19 | ||||
-rw-r--r-- | NxWidgets/Kconfig | 16 | ||||
-rw-r--r-- | NxWidgets/nxwm/src/capplicationwindow.cxx | 30 | ||||
-rw-r--r-- | NxWidgets/nxwm/src/chexcalculator.cxx | 2 | ||||
-rw-r--r-- | NxWidgets/nxwm/src/cstartwindow.cxx | 2 | ||||
-rw-r--r-- | NxWidgets/nxwm/src/ctaskbar.cxx | 19 | ||||
-rwxr-xr-x | NxWidgets/tools/README.txt | 51 | ||||
-rwxr-xr-x | NxWidgets/tools/bitmap_converter.py | 148 | ||||
-rwxr-xr-x | NxWidgets/tools/install.sh | 2 | ||||
-rw-r--r-- | apps/ChangeLog.txt | 3 | ||||
-rw-r--r-- | apps/NxWidgets/Kconfig | 16 | ||||
-rw-r--r-- | apps/nshlib/Kconfig | 4 | ||||
-rw-r--r-- | apps/nshlib/README.txt | 29 | ||||
-rw-r--r-- | apps/nshlib/nsh.h | 6 | ||||
-rw-r--r-- | apps/nshlib/nsh_dbgcmds.c | 60 | ||||
-rw-r--r-- | apps/nshlib/nsh_parse.c | 6 | ||||
-rw-r--r-- | nuttx/ChangeLog | 1 | ||||
-rw-r--r-- | nuttx/Documentation/NuttShell.html | 164 | ||||
-rw-r--r-- | nuttx/Documentation/README.html | 72 | ||||
-rw-r--r-- | nuttx/README.txt | 9 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/Kconfig | 1 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/chip/stm32_eth.h | 8 | ||||
-rw-r--r-- | nuttx/libxx/Makefile | 7 | ||||
-rw-r--r-- | nuttx/libxx/libxx_stdthrow.cxx | 74 |
24 files changed, 616 insertions, 133 deletions
diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt index f4aedd828..113945f2f 100644 --- a/NxWidgets/ChangeLog.txt +++ b/NxWidgets/ChangeLog.txt @@ -182,4 +182,21 @@ * libnxwidgets/src/cnxserver.cxx: Reduce delay to allow NX server to start. One second was un-necessarily long. Reduced to 50 MS. Reduction suggested by Petteri Aimonen. - +* tools/bitmap_converter.py: This script converts from any image type + supported by Python imaging library to the RLE-encoded format used by + NxWidgets. +* NxWidgets/nxwm/src/capplicationwindow.cxx: If the "desktop" is empty, + users have no need to minimize any windows. If the buttons are small, + it's easy to hit minimize button accidentally when trying to close an + application. Contributed by Petteri Aimonen. +* NxWidgets/nxwm/src/ctaskbar.cxx: Add an option to eliminate the + background image. Contributed by Petteri Aimonen. +* NxWidgets/nxwm/src/chexcalculator.cxx and NxWidgets/nxwm/src/cstartwindow.cxx: + The config settings CONFIG_NXWM_STARTWINDOW_ICON and CONFIG_NXWM_HEXCALCULATOR_ICON + allow changing the icons used for these applications. However, to declare symbols + for these icons user would need to modify NxWidgets header files. + This commit adds a simple forward declaration to the relevant files, based on the + configured icon. If the icon does not exist, linker will give an error about it. + Contributed by Petteri Aimonen. +* NxWidgets/nxwm/src/ctaskbar.cxx: Highlight the current window in the task bar. + Contributed by Petteri Aimonen. diff --git a/NxWidgets/Kconfig b/NxWidgets/Kconfig index 6befd1ace..59d8856bc 100644 --- a/NxWidgets/Kconfig +++ b/NxWidgets/Kconfig @@ -308,6 +308,14 @@ config NXWM_TASKBAR_WIDTH ---help--- Task bar thickness (either vertical or horizontal). Default: 25 + 2*spacing +config NXWM_DISABLE_MINIMIZE + bool "Disable Minimize Button" + default n + ---help--- + If the "desktop" is empty, users have no need to minimize any windows. If the buttons + are small, it's easy to hit minimize button accidentally when trying to close an + application. + comment "Tool Bar Configuration" config NXWM_TOOLBAR_HEIGHT @@ -319,8 +327,16 @@ config NXWM_TOOLBAR_HEIGHT comment "Background Image" +config NXWM_DISABLE_BACKGROUND_IMAGE + bool "Disable Background Image" + default n if !NXWM_DISABLE_MINIMIZE + default y if NXWM_DISABLE_MINIMIZE + ---help--- + Disable support for the "Desktop" background image. + config NXWM_BACKGROUND_IMAGE string "Background Image" + depends on !NXWM_DISABLE_BACKGROUND_IMAGE ---help--- The name of the image to use in the background window. Default: NXWidgets::g_nuttxBitmap diff --git a/NxWidgets/nxwm/src/capplicationwindow.cxx b/NxWidgets/nxwm/src/capplicationwindow.cxx index 65de1b1a4..d2e044298 100644 --- a/NxWidgets/nxwm/src/capplicationwindow.cxx +++ b/NxWidgets/nxwm/src/capplicationwindow.cxx @@ -241,6 +241,7 @@ bool CApplicationWindow::open(void) m_stopImage->addWidgetEventHandler(this); } +#ifndef CONFIG_NXWM_DISABLE_MINIMIZE // Create MINIMIZE application bitmap container m_minimizeBitmap = new NXWidgets::CRlePaletteBitmap(&g_minimizeBitmap); @@ -289,6 +290,7 @@ bool CApplicationWindow::open(void) m_minimizeImage->setBorderless(true); m_minimizeImage->addWidgetEventHandler(this); +#endif // The rest of the toolbar will hold the left-justified application label // Create the default font instance @@ -364,12 +366,16 @@ void CApplicationWindow::redraw(void) m_stopImage->setRaisesEvents(true); } - // Draw the minimize image - - m_minimizeImage->enableDrawing(); - m_minimizeImage->redraw(); - m_minimizeImage->setRaisesEvents(true); + // Draw the minimize image (which may not be present if this is a + // mimimization is disabled) + if (m_minimizeImage) + { + m_minimizeImage->enableDrawing(); + m_minimizeImage->redraw(); + m_minimizeImage->setRaisesEvents(true); + } + // And finally draw the window label m_windowLabel->enableDrawing(); @@ -392,11 +398,15 @@ void CApplicationWindow::hide(void) m_stopImage->setRaisesEvents(false); } - // Disable the minimize image - - m_minimizeImage->disableDrawing(); - m_minimizeImage->setRaisesEvents(false); + // Disable the minimize image(which may not be present if this is a + // mimimization is disabled) + if (m_minimizeImage) + { + m_minimizeImage->disableDrawing(); + m_minimizeImage->setRaisesEvents(false); + } + // Disable the window label m_windowLabel->disableDrawing(); @@ -570,7 +580,7 @@ void CApplicationWindow::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) // Check the minimize image (only if the stop application image is not pressed) - else if (m_minimizeImage->isClicked()) + else if (m_minimizeImage && m_minimizeImage->isClicked()) { // Notify the controlling logic that the application should be miminsed diff --git a/NxWidgets/nxwm/src/chexcalculator.cxx b/NxWidgets/nxwm/src/chexcalculator.cxx index f8f1bb246..eeb0b1d1d 100644 --- a/NxWidgets/nxwm/src/chexcalculator.cxx +++ b/NxWidgets/nxwm/src/chexcalculator.cxx @@ -191,6 +191,8 @@ namespace NxWM * CHexCalculator Method Implementations ********************************************************************************************/ +extern const struct NXWidgets::SRlePaletteBitmap CONFIG_NXWM_HEXCALCULATOR_ICON; + using namespace NxWM; /** diff --git a/NxWidgets/nxwm/src/cstartwindow.cxx b/NxWidgets/nxwm/src/cstartwindow.cxx index 5c54cba3a..a99e81d88 100644 --- a/NxWidgets/nxwm/src/cstartwindow.cxx +++ b/NxWidgets/nxwm/src/cstartwindow.cxx @@ -71,6 +71,8 @@ FAR const char *NxWM::g_startWindowMqName = CONFIG_NXWM_STARTWINDOW_MQNAME; * CStartWindow Method Implementations ********************************************************************************************/ +extern const struct NXWidgets::SRlePaletteBitmap CONFIG_NXWM_STARTWINDOW_ICON; + using namespace NxWM; /** diff --git a/NxWidgets/nxwm/src/ctaskbar.cxx b/NxWidgets/nxwm/src/ctaskbar.cxx index c494fcba3..23d2d23b5 100644 --- a/NxWidgets/nxwm/src/ctaskbar.cxx +++ b/NxWidgets/nxwm/src/ctaskbar.cxx @@ -991,6 +991,7 @@ bool CTaskbar::createBackgroundWindow(void) bool CTaskbar::createBackgroundImage(void) { +#ifndef CONFIG_NXWM_DISABLE_BACKGROUND_IMAGE // Get the size of the display struct nxgl_size_s windowSize; @@ -1054,6 +1055,8 @@ bool CTaskbar::createBackgroundImage(void) m_backImage->setBorderless(true); m_backImage->setRaisesEvents(false); +#endif + return true; } @@ -1128,6 +1131,10 @@ bool CTaskbar::redrawTaskbarWindow(void) image->disableDrawing(); image->setRaisesEvents(false); + // Highlight the icon for the top-most window + + image->highlight(m_slots.at(i).app == m_topApp); + // Get the size of the icon image NXWidgets::CRect rect; @@ -1302,8 +1309,12 @@ bool CTaskbar::redrawBackgroundWindow(void) // Then re-draw the background image on the window - m_backImage->enableDrawing(); - m_backImage->redraw(); + if (m_backImage) + { + m_backImage->enableDrawing(); + m_backImage->redraw(); + } + return true; } @@ -1330,6 +1341,10 @@ bool CTaskbar::redrawApplicationWindow(IApplication *app) raiseTopApplication(); + // Redraw taskbar + + redrawTaskbarWindow(); + // Every application provides a method to obtain its application window IApplicationWindow *appWindow = app->getWindow(); diff --git a/NxWidgets/tools/README.txt b/NxWidgets/tools/README.txt new file mode 100755 index 000000000..22b2bf2a9 --- /dev/null +++ b/NxWidgets/tools/README.txt @@ -0,0 +1,51 @@ +NxWidgets/tools README File
+===========================
+
+addobjs.sh
+----------
+
+ $0 will add all object (.o) files in directory to an archive.
+
+ Usage: tools/addobjs.sh [OPTIONS] <lib-path> <obj-dir>
+
+ Where:
+ <lib-path> is the full, absolute path to the library to use
+ <obj-dir> is full path to the directory containing the object files to be added
+ OPTIONS include:
+ -p Prefix to use. For example, to use arm-elf-ar, add '-p arm-elf-'
+ -w Use Windows style paths insted of POSIX paths
+ -d Enable script debug
+ -h Show this usage information
+
+bitmap_converter.py
+-------------------
+
+ This script converts from any image type supported by Python imaging library to
+ the RLE-encoded format used by NxWidgets.
+
+indent.sh
+---------
+
+ This script uses the Linux 'indent' utility to re-format C source files
+ to match the coding style that I use. It differs from my coding style in that
+
+ - I normally put the traiing */ of a multi-line comment on a separate line,
+ - I usually align things vertically (like '='in assignments.
+
+install.sh
+----------
+
+ Install a unit test in the NuttX source tree"
+
+ USAGE: tools/install.sh <apps-directory-path> <test-sub-directory>
+
+ Where:
+ <apps-directory-path> is the full, absolute path to the NuttX apps/ directory
+ <test-sub-directory> is the name of a sub-directory in the UnitTests directory
+
+zipme.sh
+--------
+
+ Pack up the NxWidgets tarball for release.
+
+ USAGE: tools/zipme.sh <version>
diff --git a/NxWidgets/tools/bitmap_converter.py b/NxWidgets/tools/bitmap_converter.py new file mode 100755 index 000000000..2cb7e8869 --- /dev/null +++ b/NxWidgets/tools/bitmap_converter.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python + +'''This script converts from any image type supported by +Python imaging library to the RLE-encoded format used by +NxWidgets. +''' + +from PIL import Image + +def get_palette(img, maxcolors = 255): + '''Returns a list of colors. If there are too many colors in the image, + the least used are removed. + ''' + img = img.convert("RGB") + colors = img.getcolors(65536) + colors.sort(key = lambda c: -c[0]) + return [c[1] for c in colors[:maxcolors]] + +def write_palette(outfile, palette): + '''Write the palette (normal and hilight) to the output file.''' + + outfile.write('static const NXWidgets::nxwidget_pixel_t palette[BITMAP_PALETTESIZE] =\n'); + outfile.write('{\n') + + for i in range(0, len(palette), 4): + outfile.write(' '); + for r, g, b in palette[i:i+4]: + outfile.write('MKRGB(%3d,%3d,%3d), ' % (r, g, b)) + outfile.write('\n'); + + outfile.write('};\n\n') + + outfile.write('static const NXWidgets::nxwidget_pixel_t hilight_palette[BITMAP_PALETTESIZE] =\n'); + outfile.write('{\n') + + for i in range(0, len(palette), 4): + outfile.write(' '); + for r, g, b in palette[i:i+4]: + r = min(255, r + 50) + g = min(255, g + 50) + b = min(255, b + 50) + outfile.write('MKRGB(%3d,%3d,%3d), ' % (r, g, b)) + outfile.write('\n'); + + outfile.write('};\n\n') + + +def quantize(color, palette): + '''Return the color index to closest match in the palette.''' + try: + return palette.index(color) + except ValueError: + # No exact match, search for the closest + def distance(color2): + return sum([(a - b)**2 for a, b in zip(color, color2)]) + + return palette.index(min(palette, key = distance)); + +def encode_row(img, palette, y): + '''RLE-encode one row of image data.''' + entries = [] + color = None + repeats = 0 + + for x in range(0, img.size[0]): + c = quantize(img.getpixel((x, y)), palette) + if c == color: + repeats += 1 + else: + if color is not None: + entries.append((repeats, color)) + + repeats = 1 + color = c + + if color is not None: + entries.append((repeats, color)) + + return entries + +def write_image(outfile, img, palette): + '''Write the image contents to the output file.''' + + outfile.write('static const NXWidgets::SRlePaletteBitmapEntry bitmap[] =\n'); + outfile.write('{\n'); + + for y in range(0, img.size[1]): + entries = encode_row(img, palette, y) + row = "" + for r, c in entries: + if len(row) > 60: + outfile.write(' ' + row + '\n') + row = "" + + row += '{%3d, %3d}, ' % (r, c) + + row += ' ' * (73 - len(row)) + outfile.write(' ' + row + '/* Row %d */\n' % y) + + outfile.write('};\n\n'); + +def write_descriptor(outfile, name): + '''Write the public descriptor structure for the image.''' + + outfile.write('extern const struct NXWidgets::SRlePaletteBitmap g_%s =\n' % name) + outfile.write('{\n') + outfile.write(' CONFIG_NXWIDGETS_BPP,\n') + outfile.write(' CONFIG_NXWIDGETS_FMT,\n') + outfile.write(' BITMAP_PALETTESIZE,\n') + outfile.write(' BITMAP_WIDTH,\n') + outfile.write(' BITMAP_HEIGHT,\n') + outfile.write(' {palette, hilight_palette},\n') + outfile.write(' bitmap\n') + outfile.write('};\n') + +if __name__ == '__main__': + import sys + import os.path + + if len(sys.argv) != 3: + print "Usage: bitmap_converter.py source.png output.cxx" + sys.exit(1) + + img = Image.open(sys.argv[1]) + outfile = open(sys.argv[2], 'w') + palette = get_palette(img) + + outfile.write( +''' +/* Automatically NuttX bitmap file. */ +/* Generated from %(src)s by bitmap_converter.py. */ + +#include <nxconfig.hxx> +#include <crlepalettebitmap.hxx> + +#define BITMAP_WIDTH %(width)s +#define BITMAP_HEIGHT %(height)s +#define BITMAP_PALETTESIZE %(palettesize)s + +''' % {'src': sys.argv[1], 'width': img.size[0], 'height': img.size[1], + 'palettesize': len(palette)} + ) + + name = os.path.splitext(os.path.basename(sys.argv[1]))[0] + + write_palette(outfile, palette) + write_image(outfile, img, palette) + write_descriptor(outfile, name) diff --git a/NxWidgets/tools/install.sh b/NxWidgets/tools/install.sh index 6917b4b03..dd212b5a6 100755 --- a/NxWidgets/tools/install.sh +++ b/NxWidgets/tools/install.sh @@ -40,6 +40,8 @@ function ShowUsage() { echo "" + echo "Install a unit test in the NuttX source tree" + echo "" echo "USAGE: $0 <apps-directory-path> <test-sub-directory>" echo "" echo "Where:" diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index d755fcca0..99f0ebc53 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -411,4 +411,7 @@ * apps/examples/ostest/roundrobin.c: Replace large tables with algorithmic prime number generation. This allows the roundrobin test to run on platforms with minimal SRAM (Freddie Chopin). + * apps/nshlib/nsh_dbgcmds.c: Add hexdump command to dump the contents + of a file (or character device) to the console Contributed by Petteri + Aimonen. diff --git a/apps/NxWidgets/Kconfig b/apps/NxWidgets/Kconfig index 6befd1ace..59d8856bc 100644 --- a/apps/NxWidgets/Kconfig +++ b/apps/NxWidgets/Kconfig @@ -308,6 +308,14 @@ config NXWM_TASKBAR_WIDTH ---help--- Task bar thickness (either vertical or horizontal). Default: 25 + 2*spacing +config NXWM_DISABLE_MINIMIZE + bool "Disable Minimize Button" + default n + ---help--- + If the "desktop" is empty, users have no need to minimize any windows. If the buttons + are small, it's easy to hit minimize button accidentally when trying to close an + application. + comment "Tool Bar Configuration" config NXWM_TOOLBAR_HEIGHT @@ -319,8 +327,16 @@ config NXWM_TOOLBAR_HEIGHT comment "Background Image" +config NXWM_DISABLE_BACKGROUND_IMAGE + bool "Disable Background Image" + default n if !NXWM_DISABLE_MINIMIZE + default y if NXWM_DISABLE_MINIMIZE + ---help--- + Disable support for the "Desktop" background image. + config NXWM_BACKGROUND_IMAGE string "Background Image" + depends on !NXWM_DISABLE_BACKGROUND_IMAGE ---help--- The name of the image to use in the background window. Default: NXWidgets::g_nuttxBitmap diff --git a/apps/nshlib/Kconfig b/apps/nshlib/Kconfig index 7009e6a3d..17b107b8f 100644 --- a/apps/nshlib/Kconfig +++ b/apps/nshlib/Kconfig @@ -74,6 +74,10 @@ config NSH_DISABLE_HELP bool "Disable help" default n +config NSH_DISABLE_HEXDUMP + bool "Disable hexdump" + default n + config NSH_DISABLE_IFCONFIG bool "Disable ifconfig" default n diff --git a/apps/nshlib/README.txt b/apps/nshlib/README.txt index 227f01c0a..59f0538f0 100644 --- a/apps/nshlib/README.txt +++ b/apps/nshlib/README.txt @@ -385,6 +385,10 @@ o help [-v] [<cmd>] <cmd> Show full command usage only for this command +o hexdump <file or device> + + Dump data in hexadecimal format from a file or character device. + o ifconfig [nic_name [ip]] [dr|gw|gateway <dr-address>] [netmask <net-mask>] [dns <dns-address>] [hw <hw-mac>] Show the current configuration of the network, for example: @@ -865,6 +869,7 @@ Command Dependencies on Configuration Settings free -- get CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NET_BUFSIZE >= 558 (see note 1) help -- + hexdump CONFIG_NFILE_DESCRIPTORS > 0 ifconfig CONFIG_NET ifdown CONFIG_NET ifup CONFIG_NET @@ -917,18 +922,18 @@ also allow it to squeeze into very small memory footprints. CONFIG_NSH_DISABLE_CD, CONFIG_NSH_DISABLE_CP, CONFIG_NSH_DISABLE_DD, CONFIG_NSH_DISABLE_DF, CONFIG_NSH_DISABLE_ECHO, CONFIG_NSH_DISABLE_EXEC, CONFIG_NSH_DISABLE_EXIT, CONFIG_NSH_DISABLE_FREE, CONFIG_NSH_DISABLE_GET, - CONFIG_NSH_DISABLE_HELP, CONFIG_NSH_DISABLE_IFCONFIG, CONFIG_NSH_DISABLE_IFUPDOWN, - CONFIG_NSH_DISABLE_KILL, CONFIG_NSH_DISABLE_LOSETUP, CONFIG_NSH_DISABLE_LS, - CONFIG_NSH_DISABLE_MD5 CONFIG_NSH_DISABLE_MB, CONFIG_NSH_DISABLE_MKDIR, - CONFIG_NSH_DISABLE_MKFATFS, CONFIG_NSH_DISABLE_MKFIFO, CONFIG_NSH_DISABLE_MKRD, - CONFIG_NSH_DISABLE_MH, CONFIG_NSH_DISABLE_MOUNT, CONFIG_NSH_DISABLE_MW, - CONFIG_NSH_DISABLE_MV, CONFIG_NSH_DISABLE_NFSMOUNT, CONFIG_NSH_DISABLE_PS, - CONFIG_NSH_DISABLE_PING, CONFIG_NSH_DISABLE_PUT, CONFIG_NSH_DISABLE_PWD, - CONFIG_NSH_DISABLE_RM, CONFIG_NSH_DISABLE_RMDIR, CONFIG_NSH_DISABLE_SET, - CONFIG_NSH_DISABLE_SH, CONFIG_NSH_DISABLE_SLEEP, CONFIG_NSH_DISABLE_TEST, - CONFIG_NSH_DISABLE_UMOUNT, CONFIG_NSH_DISABLE_UNSET, CONFIG_NSH_DISABLE_URLDECODE, - CONFIG_NSH_DISABLE_URLENCODE, CONFIG_NSH_DISABLE_USLEEP, CONFIG_NSH_DISABLE_WGET, - CONFIG_NSH_DISABLE_XD + CONFIG_NSH_DISABLE_HELP, CONFIG_NSH_DISABLE_HEXDUMP, CONFIG_NSH_DISABLE_IFCONFIG, + CONFIG_NSH_DISABLE_IFUPDOWN, CONFIG_NSH_DISABLE_KILL, CONFIG_NSH_DISABLE_LOSETUP, + CONFIG_NSH_DISABLE_LS, CONFIG_NSH_DISABLE_MD5 CONFIG_NSH_DISABLE_MB, + CONFIG_NSH_DISABLE_MKDIR, CONFIG_NSH_DISABLE_MKFATFS, CONFIG_NSH_DISABLE_MKFIFO, + CONFIG_NSH_DISABLE_MKRD, CONFIG_NSH_DISABLE_MH, CONFIG_NSH_DISABLE_MOUNT, + CONFIG_NSH_DISABLE_MW, CONFIG_NSH_DISABLE_MV, CONFIG_NSH_DISABLE_NFSMOUNT, + CONFIG_NSH_DISABLE_PS, CONFIG_NSH_DISABLE_PING, CONFIG_NSH_DISABLE_PUT, + CONFIG_NSH_DISABLE_PWD, CONFIG_NSH_DISABLE_RM, CONFIG_NSH_DISABLE_RMDIR, + CONFIG_NSH_DISABLE_SET, CONFIG_NSH_DISABLE_SH, CONFIG_NSH_DISABLE_SLEEP, + CONFIG_NSH_DISABLE_TEST, CONFIG_NSH_DISABLE_UMOUNT, CONFIG_NSH_DISABLE_UNSET, + CONFIG_NSH_DISABLE_URLDECODE, CONFIG_NSH_DISABLE_URLENCODE, CONFIG_NSH_DISABLE_USLEEP, + CONFIG_NSH_DISABLE_WGET, CONFIG_NSH_DISABLE_XD Verbose help output can be suppressed by defining CONFIG_NSH_HELP_TERSE. In that case, the help command is still available but will be slightly smaller. diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h index ac75cf2e1..a046a384f 100644 --- a/apps/nshlib/nsh.h +++ b/apps/nshlib/nsh.h @@ -47,6 +47,7 @@ #include <stdio.h> #include <stdint.h> #include <stdbool.h> +#include <unistd.h> #include <errno.h> #include <nuttx/usb/usbdev_trace.h> @@ -540,7 +541,7 @@ void nsh_usbtrace(void); #ifndef CONFIG_NSH_DISABLE_XD int cmd_xd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); #endif - + #if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_TEST) int cmd_test(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); int cmd_lbracket(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); @@ -562,6 +563,9 @@ void nsh_usbtrace(void); # ifndef CONFIG_NSH_DISABLE_DD int cmd_dd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif +# ifndef CONFIG_NSH_DISABLE_HEXDUMP + int cmd_hexdump(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); +# endif # ifndef CONFIG_NSH_DISABLE_LS int cmd_ls(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif diff --git a/apps/nshlib/nsh_dbgcmds.c b/apps/nshlib/nsh_dbgcmds.c index 384b377f3..627c56bcd 100644 --- a/apps/nshlib/nsh_dbgcmds.c +++ b/apps/nshlib/nsh_dbgcmds.c @@ -46,6 +46,10 @@ #include <string.h> #include <errno.h> +#if CONFIG_NFILE_DESCRIPTORS > 0 +# include <fcntl.h> +#endif + #include "nsh.h" #include "nsh_console.h" @@ -327,7 +331,7 @@ void nsh_dumpbuffer(FAR struct nsh_vtbl_s *vtbl, const char *msg, } /**************************************************************************** - * Name: cmd_xd + * Name: cmd_xd, hex dump of memory ****************************************************************************/ #ifndef CONFIG_NSH_DISABLE_XD @@ -353,3 +357,57 @@ int cmd_xd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) return OK; } #endif + +/**************************************************************************** + * Name: cmd_hexdump, hex dump of files + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +#ifndef CONFIG_NSH_DISABLE_HEXDUMP +int cmd_hexdump(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) +{ + uint8_t buffer[IOBUFFERSIZE]; + int fd; + int ret = OK; + char msg[32]; + + /* Open the file for reading */ + + fd = open(argv[1], O_RDONLY); + if (fd < 0) + { + nsh_output(vtbl, g_fmtcmdfailed, "hexdump", "open", NSH_ERRNO); + return ERROR; + } + + int position = 0; + for (;;) + { + int nbytesread = read(fd, buffer, IOBUFFERSIZE); + + /* Check for read errors */ + + if (nbytesread < 0) + { + int errval = errno; + nsh_output(vtbl, g_fmtcmdfailed, "hexdump", "read", NSH_ERRNO_OF(errval)); + ret = ERROR; + break; + } + else if (nbytesread > 0) + { + snprintf(msg, sizeof(msg), "%s at %08x", argv[1], position); + nsh_dumpbuffer(vtbl, msg, buffer, nbytesread); + position += nbytesread; + } + else + { + break; // EOF + } + } + + (void)close(fd); + return ret; +} +#endif +#endif diff --git a/apps/nshlib/nsh_parse.c b/apps/nshlib/nsh_parse.c index bf2b8a4a4..abdf5c321 100644 --- a/apps/nshlib/nsh_parse.c +++ b/apps/nshlib/nsh_parse.c @@ -226,6 +226,12 @@ static const struct cmdmap_s g_cmdmap[] = { "help", cmd_help, 1, 3, "[-v] [<cmd>]" }, # endif #endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 +#ifndef CONFIG_NSH_DISABLE_HEXDUMP + { "hexdump", cmd_hexdump, 2, 2, "<file or device>" }, +#endif +#endif #ifdef CONFIG_NET # ifndef CONFIG_NSH_DISABLE_IFCONFIG diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 9b2710233..39a4dff56 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3584,3 +3584,4 @@ tool. * configs/stm32f4discovery/src/up_ug2864ambag01.c: Board-specific initialization for UG-2864AMBAG01 OLED connecte to STM32F4Disovery. + * libxx/libxx_stdthrow.cxx: Exception stubs from Petteri Aimonen. diff --git a/nuttx/Documentation/NuttShell.html b/nuttx/Documentation/NuttShell.html index 31546a100..1b14f96f6 100644 --- a/nuttx/Documentation/NuttShell.html +++ b/nuttx/Documentation/NuttShell.html @@ -8,7 +8,7 @@ <tr align="center" bgcolor="#e4e4e4"> <td> <h1><big><font color="#3c34ec"><i>NuttShell (NSH)</i></font></big></h1> - <p>Last Updated: November 4, 2012</p> + <p>Last Updated: November 9, 2012</p> </td> </tr> </table> @@ -173,187 +173,193 @@ <tr> <td><br></td> <td> - <a href="#cmdifconfig">2.16 Manage Network Configuration (ifconfig)</a> + <a href="#cmdhexdump">2.16 Hexadecimal Dump of File or Device (hexdump)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdifdown">2.17 Take a network down (ifdown)</a> + <a href="#cmdifconfig">2.17 Manage Network Configuration (ifconfig)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdifup">2.18 Bring a network up (ifup)</a> + <a href="#cmdifdown">2.18 Take a network down (ifdown)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdkill">2.19 Send a signal to a task (kill)</a> + <a href="#cmdifup">2.19 Bring a network up (ifup)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdlosetup">2.20 Setup/teardown the Loop Device (losetup)</a> + <a href="#cmdkill">2.20 Send a signal to a task (kill)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdls">2.21 List Directory Contents (ls)</a> + <a href="#cmdlosetup">2.21 Setup/teardown the Loop Device (losetup)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmd5">2.22 Calculate MD5 (md5)</a> + <a href="#cmdls">2.22 List Directory Contents (ls)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmbhw">2.23 Access Memory (mb, mh, and mw)</a> + <a href="#cmdmd5">2.23 Calculate MD5 (md5)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdps">2.24 Show Current Tasks and Threads (ps)</a> + <a href="#cmdmbhw">2.24 Access Memory (mb, mh, and mw)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmkdir">2.25 Create a Directory (mkdir)</a> + <a href="#cmdps">2.25 Show Current Tasks and Threads (ps)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmkfatfs">2.26 Create a FAT Filesystem (mkfatfs)</a> + <a href="#cmdmkdir">2.26 Create a Directory (mkdir)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmkfifo">2.27 Create a FIFO (mkfifo)</a> + <a href="#cmdmkfatfs">2.27 Create a FAT Filesystem (mkfatfs)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmkrd">2.28 Create a RAMDISK (mkrd)</a> + <a href="#cmdmkfifo">2.28 Create a FIFO (mkfifo)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmount">2.29 Mount a File System (mount)</a> + <a href="#cmdmkrd">2.29 Create a RAMDISK (mkrd)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdmv">2.30 Rename a File (mv)</a> + <a href="#cmdmount">2.30 Mount a File System (mount)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdnfsmount">2.31 Mount an NFS file system (nfsmount)</a> + <a href="#cmdmv">2.31 Rename a File (mv)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdping">2.32 Check Network Peer (ping)</a> + <a href="#cmdnfsmount">2.32 Mount an NFS file system (nfsmount)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdput">2.33 Send File Via TFTP (put)</a> + <a href="#cmdping">2.33 Check Network Peer (ping)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdpwd">2.34 Show Current Working Directory (pwd)</a> + <a href="#cmdput">2.34 Send File Via TFTP (put)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdrm">2.35 Remove a File (rm)</a> + <a href="#cmdpwd">2.35 Show Current Working Directory (pwd)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdrmdir">2.36 Remove a Directory (rmdir)</a> + <a href="#cmdrm">2.36 Remove a File (rm)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdset">2.37 Set an Environment Variable (set)</a> + <a href="#cmdrmdir">2.37 Remove a Directory (rmdir)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdsh">2.38 Execute an NSH Script (sh)</a> + <a href="#cmdset">2.38 Set an Environment Variable (set)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdsleep">2.39 Wait for Seconds (sleep)</a> + <a href="#cmdsh">2.39 Execute an NSH Script (sh)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdunmount">2.40 Unmount a File System (umount)</a> + <a href="#cmdsleep">2.40 Wait for Seconds (sleep)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdunset">2.41 Unset an Environment Variable (unset)</a> + <a href="#cmdunmount">2.41 Unmount a File System (umount)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdurldec">2.42 URL Decode (urldecode)</a> + <a href="#cmdunset">2.42 Unset an Environment Variable (unset)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdurlencode">2.43 URL Encode (urlencode)</a> + <a href="#cmdurldec">2.43 URL Decode (urldecode)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdusleep">2.44 Wait for Microseconds (usleep)</a> + <a href="#cmdurlencode">2.44 URL Encode (urlencode)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdwget">2.45 Get File Via HTTP (wget)</a> + <a href="#cmdusleep">2.45 Wait for Microseconds (usleep)</a> </td> </tr> <tr> <td><br></td> <td> - <a href="#cmdxd">2.46 Hexadecimal Dump (xd)</a> + <a href="#cmdwget">2.46 Get File Via HTTP (wget)</a> + </td> +</tr> +<tr> + <td><br></td> + <td> + <a href="#cmdxd">2.47 Hexadecimal Dump of Memory (xd)</a> </td> </tr> <tr> @@ -1182,7 +1188,31 @@ help [-v] [<cmd>] <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdifconfig"><h2>2.16 Manage Network Configuration (ifconfig)</h2></a> + <a name="cmdhexdump"><h2>2.16 Hexadecimal Dump of File or Device (hexdump)</h2></a> + </td> + </tr> +</table> + +<p><b>Command Syntax:</b></p> +<ul><pre> +hexdump <file or device> +</pre></ul> +<p> + <b>Synopsis</b>. + Dump data in hexadecimal format from a file or character device. +</p> + +<tr> + <td><br></td> + <td> + <a href="#"></a> + </td> +</tr> + +<table width ="100%"> + <tr bgcolor="#e4e4e4"> + <td> + <a name="cmdifconfig"><h2>2.17 Manage Network Configuration (ifconfig)</h2></a> </td> </tr> </table> @@ -1236,7 +1266,7 @@ ifconfig nic_name ip_address <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdifdown"><h2>2.17 Take a network down (ifdown)</h2></a> + <a name="cmdifdown"><h2>2.18 Take a network down (ifdown)</h2></a> </td> </tr> </table> @@ -1259,7 +1289,7 @@ ifdown eth0 <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdifup"><h2>2.18 Bring a network up (ifup)</h2></a> + <a name="cmdifup"><h2>2.19 Bring a network up (ifup)</h2></a> </td> </tr> </table> @@ -1282,7 +1312,7 @@ ifup eth0 <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdkill"><h2>2.19 Send a signal to a task (kill)</h2></a> + <a name="cmdkill"><h2>2.20 Send a signal to a task (kill)</h2></a> </td> </tr> </table> @@ -1323,7 +1353,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdlosetup"><h2>2.20 Setup/teardown the Loop Device (losetup)</h2></a> + <a name="cmdlosetup"><h2>2.21 Setup/teardown the Loop Device (losetup)</h2></a> </td> </tr> </table> @@ -1376,7 +1406,7 @@ losetup d <dev-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdls"><h2>2.21 List Directory Contents (ls)</h2></a> + <a name="cmdls"><h2>2.22 List Directory Contents (ls)</h2></a> </td> </tr> </table> @@ -1413,7 +1443,7 @@ ls [-lRs] <dir-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmd5"><h2>2.22 Calculate MD5 (md5)</h2></a> + <a name="cmdmd5"><h2>2.23 Calculate MD5 (md5)</h2></a> </td> </tr> </table> @@ -1430,7 +1460,7 @@ md5 [-f] <string or filepath> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmbhw"><h2>2.23 Access Memory (mb, mh, and mw)</h2></a> + <a name="cmdmbhw"><h2>2.24 Access Memory (mb, mh, and mw)</h2></a> </td> </tr> </table> @@ -1484,7 +1514,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdps"><h2>2.24 Show Current Tasks and Threads (ps)</h2></a> + <a name="cmdps"><h2>2.25 Show Current Tasks and Threads (ps)</h2></a> </td> </tr> </table> @@ -1510,7 +1540,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmkdir"><h2>2.25 Create a Directory (mkdir)</h2></a> + <a name="cmdmkdir"><h2>2.26 Create a Directory (mkdir)</h2></a> </td> </tr> </table> @@ -1545,7 +1575,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmkfatfs"><h2>2.26 Create a FAT Filesystem (mkfatfs)</h2></a> + <a name="cmdmkfatfs"><h2>2.27 Create a FAT Filesystem (mkfatfs)</h2></a> </td> </tr> </table> @@ -1565,7 +1595,7 @@ mkfatfs <path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmkfifo"><h2>2.27 Create a FIFO (mkfifo)</h2></a> + <a name="cmdmkfifo"><h2>2.28 Create a FIFO (mkfifo)</h2></a> </td> </tr> </table> @@ -1603,7 +1633,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmkrd"><h2>2.28 Create a RAMDISK (mkrd)</h2></a> + <a name="cmdmkrd"><h2>2.29 Create a RAMDISK (mkrd)</h2></a> </td> </tr> </table> @@ -1654,7 +1684,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmount"><h2>2.29 Mount a File System (mount)</h2></a> + <a name="cmdmount"><h2>2.30 Mount a File System (mount)</h2></a> </td> </tr> </table> @@ -1733,7 +1763,7 @@ nsh> mount <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdmv"><h2>2.30 Rename a File (mv)</h2></a> + <a name="cmdmv"><h2>2.31 Rename a File (mv)</h2></a> </td> </tr> </table> @@ -1751,7 +1781,7 @@ mv <old-path> <new-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdnfsmount"><h2>2.31 Mount an NFS file system (nfsmount)</h2></a> + <a name="cmdnfsmount"><h2>2.32 Mount an NFS file system (nfsmount)</h2></a> </td> </tr> </table> @@ -1770,7 +1800,7 @@ nfsmount <server-address> <mount-point> <remote-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdping"><h2>2.32 Check Network Peer (ping)</h2></a> + <a name="cmdping"><h2>2.33 Check Network Peer (ping)</h2></a> </td> </tr> </table> @@ -1803,7 +1833,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdput"><h2>2.33 Send File Via TFTP (put)</h2></a> + <a name="cmdput"><h2>2.34 Send File Via TFTP (put)</h2></a> </td> </tr> </table> @@ -1838,7 +1868,7 @@ put [-b|-n] [-f <remote-path>] -h <ip-address> <local-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdpwd"><h2>2.34 Show Current Working Directory (pwd)</h2></a> + <a name="cmdpwd"><h2>2.35 Show Current Working Directory (pwd)</h2></a> </td> </tr> </table> @@ -1868,7 +1898,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdrm"><h2>2.35 Remove a File (rm)</h2></a> + <a name="cmdrm"><h2>2.36 Remove a File (rm)</h2></a> </td> </tr> </table> @@ -1902,7 +1932,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdrmdir"><h2>2.36 Remove a Directory (rmdir)</h2></a> + <a name="cmdrmdir"><h2>2.37 Remove a Directory (rmdir)</h2></a> </td> </tr> </table> @@ -1937,7 +1967,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdset"><h2>2.37 Set an Environment Variable (set)</h2></a> + <a name="cmdset"><h2>2.38 Set an Environment Variable (set)</h2></a> </td> </tr> </table> @@ -1963,7 +1993,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdsh"><h2>2.38 Execute an NSH Script (sh)</h2></a> + <a name="cmdsh"><h2>2.39 Execute an NSH Script (sh)</h2></a> </td> </tr> </table> @@ -1981,7 +2011,7 @@ sh <script-path> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdsleep"><h2>2.39 Wait for Seconds (sleep)</h2></a> + <a name="cmdsleep"><h2>2.40 Wait for Seconds (sleep)</h2></a> </td> </tr> </table> @@ -1998,7 +2028,7 @@ sleep <sec> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdunmount"><h2>2.40 Unmount a File System (umount)</h2></a> + <a name="cmdunmount"><h2>2.41 Unmount a File System (umount)</h2></a> </td> </tr> </table> @@ -2028,7 +2058,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdunset"><h2>2.41 Unset an Environment Variable (unset)</h2></a> + <a name="cmdunset"><h2>2.42 Unset an Environment Variable (unset)</h2></a> </td> </tr> </table> @@ -2054,7 +2084,7 @@ nsh> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdurldec"><h2>2.42 URL Decode (urldecode)</h2></a> + <a name="cmdurldec"><h2>2.43 URL Decode (urldecode)</h2></a> </td> </tr> </table> @@ -2071,7 +2101,7 @@ urldecode [-f] <string or filepath> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdurlencode"><h2>2.43 URL Encode (urlencode)</h2></a> + <a name="cmdurlencode"><h2>2.44 URL Encode (urlencode)</h2></a> </td> </tr> </table> @@ -2088,7 +2118,7 @@ urlencode [-f] <string or filepath> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdusleep"><h2>2.44 Wait for Microseconds (usleep)</h2></a> + <a name="cmdusleep"><h2>2.45 Wait for Microseconds (usleep)</h2></a> </td> </tr> </table> @@ -2105,7 +2135,7 @@ usleep <usec> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdwget">2.45 Get File Via HTTP (wget)</a> + <a name="cmdwget">2.46 Get File Via HTTP (wget)</a> </td> </tr> </table> @@ -2132,7 +2162,7 @@ wget [-o <local-path>] <url> <table width ="100%"> <tr bgcolor="#e4e4e4"> <td> - <a name="cmdxd"><h2>2.46 Hexadecimal dump (xd)</h2></a> + <a name="cmdxd"><h2>2.47 Hexadecimal Dump of Memory (xd)</h2></a> </td> </tr> </table> @@ -2272,6 +2302,11 @@ nsh> <td><code>CONFIG_NSH_DISABLE_HELP</code></td> </tr> <tr> + <td><b><code>hexdump</code></b></td> + <td><code>CONFIG_NFILE_DESCRIPTORS</code> > 0</td> + <td><code>CONFIG_NSH_DISABLE_HEXDUMP</code></td> + </tr> + <tr> <td><b><code>ifconfig</code></b></td> <td><code>CONFIG_NET</code></td> <td><code>CONFIG_NSH_DISABLE_IFCONFIG</code></td> @@ -3795,14 +3830,15 @@ mount -t vfat /dev/ram1 /tmp <li><a href="#cmdexec"><code>exec</code></a></li> <li><a href="#custapps"><code>exec_namedapp()</code></a></li> <li><a href="#cmdexit"><code>exit</code></a></li> + <li><a href="#cmdfree"><code>free</code></a></li> </ul></td> <td></ul> - <li><a href="#cmdfree"><code>free</code></a></li> <li><a href="#custoncmds"><code>g_cmdmap</code></a></li> <li><a href="#custinit"><code>genromfs</code></a></li> <li><a href="#cmdget"><code>get</code></a></li> <li><a href="#frontend">Greeting</a></li> <li><a href="#cmdhelp"><code>help</code></a></li> + <li><a href="#cmdhexdump"><code>hexdump</code></a></li> <li><a href="#conditional"><code>if-then[-else]-fi</code></a></li> <li><a href="#cmdifconfig"><code>ifconfig</code></a></li> <li><a href="#cmdifdown"><code>ifdown</code></a></li> diff --git a/nuttx/Documentation/README.html b/nuttx/Documentation/README.html index 7c82c3f15..61d5c43af 100644 --- a/nuttx/Documentation/README.html +++ b/nuttx/Documentation/README.html @@ -246,38 +246,46 @@ | | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/syscall/README.txt"><b><i>README.txt</i></b></a> | `- tools/ | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/nuttx/tools/README.txt"><b><i>README.txt</i></b></a> - `- apps/ - |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/README.txt"><b>README.txt</b></a> - |- examples/ - | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/examples/json/README.txt">json/README.txt</a> - | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/examples/pashello/README.txt">pashello/README.txt</a> - | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/examples/README.txt"><b><i>README.txt</i></b></a> - |- graphics/ - | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/graphics/tiff/README.txt">"<b><i>tiff/README.txt</i></b></a> - |- interpreters/ - | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/interpreters/ficl/README.txt"><b><i>ficl/README.txt</i></b></a> - | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/interpreters/README.txt"><b><i>README.txt</i></b></a> - |- modbus/ - | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/modbus/README.txt"><b><i>README.txt</i></b></a> - |- netutils/ - | | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/netutils/discover/README.txt">discover/README.txt</a> - | | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/netutils/ftpc/README.txt">ftpc/README.txt</a> - | | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/netutils/json/README.txt">json/README.txt</a> - | | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/netutils/telnetd/README.txt">telnetd/README.txt</a> - | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/netutils/README.txt"><b><i>README.txt</i></b></a> - |- nshlib/ - | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/nshlib/README.txt"><b><i>README.txt</i></b></a> - |- NxWidgets/ - | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/NxWidgets/README.txt"><b><i>README.txt</i></b></a> - `- system/ - |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/i2c/README.txt"><b><i>i2c/README.txt</i></b></a> - |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/free/README.txt">free/README.txt</a> - |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/install/README.txt">install/README.txt</a> - |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/poweroff/README.txt">poweroff/README.txt</a> - |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/ramtron/README.txt">ramtron/README.txt</a> - |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/sdcard/README.txt">sdcard/README.txt</a> - |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/sysinfo/README.txt">sysinfo/README.txt</a> - `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/sdcard/README.txt"><b><i>README.txt</i></b></a> + |- apps/ + | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/README.txt"><b>README.txt</b></a> + | |- examples/ + | | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/examples/json/README.txt">json/README.txt</a> + | | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/examples/pashello/README.txt">pashello/README.txt</a> + | | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/examples/README.txt"><b><i>README.txt</i></b></a> + | |- graphics/ + | | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/graphics/tiff/README.txt">"<b><i>tiff/README.txt</i></b></a> + | |- interpreters/ + | | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/interpreters/ficl/README.txt"><b><i>ficl/README.txt</i></b></a> + | | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/interpreters/README.txt"><b><i>README.txt</i></b></a> + | |- modbus/ + | | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/modbus/README.txt"><b><i>README.txt</i></b></a> + | |- netutils/ + | | | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/netutils/discover/README.txt">discover/README.txt</a> + | | | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/netutils/ftpc/README.txt">ftpc/README.txt</a> + | | | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/netutils/json/README.txt">json/README.txt</a> + | | | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/netutils/telnetd/README.txt">telnetd/README.txt</a> + | | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/netutils/README.txt"><b><i>README.txt</i></b></a> + | |- nshlib/ + | | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/nshlib/README.txt"><b><i>README.txt</i></b></a> + | |- NxWidgets/ + | | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/NxWidgets/README.txt"><b><i>README.txt</i></b></a> + | `- system/ + | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/i2c/README.txt"><b><i>i2c/README.txt</i></b></a> + | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/free/README.txt">free/README.txt</a> + | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/install/README.txt">install/README.txt</a> + | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/poweroff/README.txt">poweroff/README.txt</a> + | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/ramtron/README.txt">ramtron/README.txt</a> + | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/sdcard/README.txt">sdcard/README.txt</a> + | |- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/sysinfo/README.txt">sysinfo/README.txt</a> + | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/apps/system/sdcard/README.txt"><b><i>README.txt</i></b></a> + `- NxWidgets + |- Doxygen + | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/NxWidgets/Doxygen/README.txt"><b><i>README.txt</i></b></a> + |- tools + | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/NxWidgets/tools/README.txt"><b><i>README.txt</i></b></a> + |- UnitTests + | `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/NxWidgets/UnitTests/README.txt"><b><i>README.txt</i></b></a> + `- <a href="http://svn.code.sf.net/p/nuttx/code/trunk/NxWidgets/README.txt"><b><i>README.txt</i></b></a> </pre></ul> </body> </html> diff --git a/nuttx/README.txt b/nuttx/README.txt index ee7f62588..85bb7f381 100644 --- a/nuttx/README.txt +++ b/nuttx/README.txt @@ -894,3 +894,12 @@ apps | `- sysinfo | `- README.txt `- README.txt + + NxWidgets + |- Doxygen + | `- README.txt + |- tools + | `- README.txt + |- UnitTests + | `- README.txt + `- README.txt diff --git a/nuttx/arch/arm/src/stm32/Kconfig b/nuttx/arch/arm/src/stm32/Kconfig index 047359ea0..a0e3fab0c 100644 --- a/nuttx/arch/arm/src/stm32/Kconfig +++ b/nuttx/arch/arm/src/stm32/Kconfig @@ -180,7 +180,6 @@ config STM32_STM32F10XX config STM32_VALUELINE bool - select ARMV7M_CMNVECTOR config STM32_HIGHDENSITY bool diff --git a/nuttx/arch/arm/src/stm32/chip/stm32_eth.h b/nuttx/arch/arm/src/stm32/chip/stm32_eth.h index a4a109d01..92a229ccc 100644 --- a/nuttx/arch/arm/src/stm32/chip/stm32_eth.h +++ b/nuttx/arch/arm/src/stm32/chip/stm32_eth.h @@ -835,14 +835,6 @@ struct eth_rxdesc_s * Public Functions ****************************************************************************************************/ -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" { -#else -#define EXTERN extern -#endif - #endif /* __ASSEMBLY__ */ #endif /* STM32_NETHERNET > 0 */ #endif /* __ARCH_ARM_SRC_STM32_CHIP_STM32_ETH_H */ diff --git a/nuttx/libxx/Makefile b/nuttx/libxx/Makefile index a749269b0..584af4e96 100644 --- a/nuttx/libxx/Makefile +++ b/nuttx/libxx/Makefile @@ -46,7 +46,12 @@ CXXSRCS = libxx_cxapurevirtual.cxx libxx_eabi_atexit.cxx libxx_cxa_atexit.cxx # uClibx++ replaces them ifneq ($(CONFIG_UCLIBCXX),y) -CXXSRCS += libxx_delete.cxx libxx_deletea.cxx libxx_new.cxx libxx_newa.cxx +CXXSRCS += libxx_delete.cxx libxx_deletea.cxx libxx_new.cxx libxx_newa.cxx +CXXSRCS += libxx_stdthrow.cxx +else +ifneq ($(UCLIBCXX_EXCEPTION),y) +CXXSRCS += libxx_stdthrow.cxx +endif endif # Paths diff --git a/nuttx/libxx/libxx_stdthrow.cxx b/nuttx/libxx/libxx_stdthrow.cxx new file mode 100644 index 000000000..588fae264 --- /dev/null +++ b/nuttx/libxx/libxx_stdthrow.cxx @@ -0,0 +1,74 @@ +//*************************************************************************** +// libxx/libxx_newa.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Petteri Aimonen <petteri.aimonen@gmail.com>; +// +// 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 <cstdlib> +#include <debug.h> + +//*************************************************************************** +// Definitions +//*************************************************************************** + +//*************************************************************************** +// Private Data +//*************************************************************************** + +//*************************************************************************** +// Public Functions +//*************************************************************************** + +namespace std +{ + void __throw_out_of_range(const char*) + { + dbg("C++: Vector .at() with argument out of range\n"); + abort(); + } + + void __throw_length_error(const char*) + { + dbg("C++: Vector resize to excessive length\n"); + abort(); + } + + void __throw_bad_alloc() + { + dbg("C++: Bad allocation\n"); + abort(); + } +} |