diff options
Diffstat (limited to 'apps/examples/usbstorage/usbstrg.h')
-rw-r--r-- | apps/examples/usbstorage/usbstrg.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/apps/examples/usbstorage/usbstrg.h b/apps/examples/usbstorage/usbstrg.h index 4b50dfe77..a179bc054 100644 --- a/apps/examples/usbstorage/usbstrg.h +++ b/apps/examples/usbstorage/usbstrg.h @@ -41,6 +41,7 @@ ****************************************************************************/ #include <nuttx/config.h> +#include <stdlib.h> /**************************************************************************** * Pre-Processor Definitions @@ -101,6 +102,52 @@ #endif /**************************************************************************** + * Public Types + ****************************************************************************/ + +/* All global variables used by this example are packed into a structure in + * order to avoid name collisions. + */ + +#if defined(CONFIG_EXAMPLES_USBSTRG_BUILTIN) || defined(CONFIG_EXAMPLES_USBSTRG_DEBUGMM) +struct usbstrg_state_s +{ + /* This is the handle that references to this particular USB storage driver + * instance. It is only needed if the USB mass storage device example is + * built using CONFIG_EXAMPLES_USBSTRG_BUILTIN. In this case, the value + * of the driver handle must be remembered between the 'msconn' and 'msdis' + * commands. + */ + +#ifdef CONFIG_EXAMPLES_USBSTRG_BUILTIN + FAR void *mshandle; +#endif + + /* Heap usage samples. These are useful for checking USB storage memory + * usage and for tracking down memoryh leaks. + */ + +#ifdef CONFIG_EXAMPLES_USBSTRG_DEBUGMM + struct mallinfo mmstart; /* Memory usage before the connection */ + struct mallinfo mmprevious; /* The last memory usage sample */ + struct mallinfo mmcurrent; /* The current memory usage sample */ +#endif +}; +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* All global variables used by this example are packed into a structure in + * order to avoid name collisions. + */ + +#if defined(CONFIG_EXAMPLES_USBSTRG_BUILTIN) || defined(CONFIG_EXAMPLES_USBSTRG_DEBUGMM) +extern struct usbstrg_state_s g_usbstrg; +#endif + +/**************************************************************************** * Public Functions ****************************************************************************/ |