From c45f07b541985ea3d00958234849557e03b801a9 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 29 Jan 2012 14:15:20 +0000 Subject: [PATCH] Correct a typo in STM32 I2C3 support git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4345 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- apps/Makefile | 4 +- apps/README.txt | 62 ++++++++++++++++++++++++ apps/examples/composite/composite_main.c | 2 +- nuttx/ChangeLog | 4 +- nuttx/arch/arm/src/stm32/stm32_i2c.c | 2 +- nuttx/drivers/usbdev/composite.c | 8 ++- 6 files changed, 74 insertions(+), 8 deletions(-) diff --git a/apps/Makefile b/apps/Makefile index f73f0eaac..f54a9104d 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -1,9 +1,9 @@ ############################################################################ # apps/Makefile # -# Copyright (C) 2011 Uros Platise. All rights reserved. +# Copyright (C) 2011-2012 Uros Platise. All rights reserved. # Authors: Uros Platise -# Gregory Nutt +# Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/apps/README.txt b/apps/README.txt index f1fb124c4..cbef1602a 100644 --- a/apps/README.txt +++ b/apps/README.txt @@ -12,6 +12,7 @@ Contents Synchronous Built-In Commands Application Configuration File Example Named Application + Building NuttX with Board-Specific Pieces Outside the Source Tree General ------- @@ -141,6 +142,67 @@ to the project. One must define: 4. add application in the apps/.config +Building NuttX with Board-Specific Pieces Outside the Source Tree +----------------------------------------------------------------- +Q: Has anyone come up with a tidy way to build NuttX with board- + specific pieces outside the source tree? +A: Here are four: + 1) There is a make target called 'make export'. It will build + NuttX, then bundle all of the header files, libaries, startup + objects, and other build components into a .zip file. You + can can move that .zip file into any build environment you + want. You even build NuttX under a DOS CMD window. + This make target is documented in the top level nuttx/README.txt. + + 2) You can replace the entire apps/ directory. If there is + nothing in the apps/ directory that you need, you can define + CONFIG_APPS_DIR in your .config file so that it points to a + different, custom application directory. + + You can copy any pieces that you like from the old apps/directory + to your custom apps directory as necessary. + + This is documented in NuttX/configs/README.txt and + nuttx/Documentation/NuttxPortingGuide.html (Online at + http://nuttx.sourceforge.net/NuttxPortingGuide.html#apndxconfigs + under Build options). And in the apps/README.txt file. + + 3) If you like the random collection of stuff in the apps/ directory + but just want to expand the existing components with your own, + external sub-directory then there is an easy way to that too: + You just create the sympolic link at apps/external that + redirects to your application sub-directory. The apps/Makefile + will always automatically check for the existence of an + apps/external directory and if it exists, it will automatically + incorporate it into the build. + + This feature of the apps/Makefile is documented only here. + + You can, for example, create a script called install.sh that + installs a custom application, configuration, and board specific + directory: + + a) Copy 'MyBoard' directory to configs/MyBoard. + b) At a symbolic link to MyApplication at apps/external + c) Configure NuttX (usually by: + + tools/configure.sh MyBoard/MyConfiguration + + or simply by copying defconfig->nutt/.config, + setenv.sh->nuttx/setenv.sh, Make.defs->nuttx/Make.defs, + appconfig->apps/.config + + 4) Add any link to apps/ + + a) Add symbolic links apps/ to as many other directories as you + want. + b) Then just add the (relative) paths to the links in your + appconfig file (that becomes the apps/.config file). + + That is basically the same as my option #3 but doesn't use the + magic 'external' link. The toplevel apps/Makefile will always + to build whatever in finds in the apps/.config file (plus the + external link if present). diff --git a/apps/examples/composite/composite_main.c b/apps/examples/composite/composite_main.c index 961716116..0166b7fa1 100644 --- a/apps/examples/composite/composite_main.c +++ b/apps/examples/composite/composite_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/usbstorage/composite_main.c * - * Copyright (C) 2008-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 715ff15a4..2c06338c7 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -2396,10 +2396,10 @@ * arch/arm/src/stm32/stm32_i2c.c: Add support for I2C3 * drivers/usbdev/: Lots of name changes: cdc_serial->cdcacm, usbstrg->usbmsc, usbser->pl2303 - * drivers/usbdev/composite*: Fleshed out support for a composite USB device. + * drivers/usbdev/composite: Fleshed out support for a composite USB device. * drivers/stm3210e-eval/composite and drivers/stm3210e-eval/src/up_composite.c: Add a configuration test the USB composite device. * include/nuttx/usb/usb.h, drivers/usbdev/composite_descriptors.c, and drivers/usbdev/cdcacm_descriptors.c: Add support for the USB Interface Association Descriptor (IAD) - + * arch/arm/src/stm32/stm32_i2c.c: Correct a typo in STM32 I2C3 support diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c index 38551231d..4439cfec0 100644 --- a/nuttx/arch/arm/src/stm32/stm32_i2c.c +++ b/nuttx/arch/arm/src/stm32/stm32_i2c.c @@ -1209,7 +1209,7 @@ static int stm32_i2c2_isr(int irq, void *context) ************************************************************************************/ #ifdef CONFIG_STM32_I2C3 -static int stm32_i2c2_isr(int irq, void *context) +static int stm32_i2c3_isr(int irq, void *context) { return stm32_i2c_isr(&stm32_i2c3_priv); } diff --git a/nuttx/drivers/usbdev/composite.c b/nuttx/drivers/usbdev/composite.c index bfd5a0201..aae4f4581 100644 --- a/nuttx/drivers/usbdev/composite.c +++ b/nuttx/drivers/usbdev/composite.c @@ -489,14 +489,18 @@ static int composite_setup(FAR struct usbdevclass_driver_s *driver, { ret = composite_mkstrdesc(strid, buf); } - else if (strid < DEV1_STRIDBASE + DEV1_NSTRIDS) +#if DEV1_NSTRIDS > 0 + else if (strid <= DEV1_STRIDBASE + DEV1_NSTRIDS) { ret = DEV1_MKSTRDESC(strid, buf); } - else if (strid < DEV2_STRIDBASE + DEV2_NSTRIDS) +#endif +#if DEV2_NSTRIDS > 0 + else if (strid <= DEV2_STRIDBASE + DEV2_NSTRIDS) { ret = DEV2_MKSTRDESC(strid, buf); } +#endif } break;