diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-03-18 09:31:02 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-03-18 09:31:02 -0600 |
commit | f71e1bc02062c01ee235bdc3b1707d0ce91eff2c (patch) | |
tree | bdcc464d8bfef979180487253dd4e972fe770cf0 /apps/system/usbmsc | |
parent | fae0c9b227974cb86463c257825583abb85a63a6 (diff) | |
download | px4-nuttx-f71e1bc02062c01ee235bdc3b1707d0ce91eff2c.tar.gz px4-nuttx-f71e1bc02062c01ee235bdc3b1707d0ce91eff2c.tar.bz2 px4-nuttx-f71e1bc02062c01ee235bdc3b1707d0ce91eff2c.zip |
SAM4E: Revise board-specific USB MSC support
Diffstat (limited to 'apps/system/usbmsc')
-rw-r--r-- | apps/system/usbmsc/usbmsc_main.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/apps/system/usbmsc/usbmsc_main.c b/apps/system/usbmsc/usbmsc_main.c index 3b3dc96cc..b1717a047 100644 --- a/apps/system/usbmsc/usbmsc_main.c +++ b/apps/system/usbmsc/usbmsc_main.c @@ -51,7 +51,7 @@ #include "usbmsc.h" /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ #ifdef CONFIG_SYSTEM_USBMSC_TRACEINIT @@ -432,6 +432,7 @@ static int msconn_daemon(int argc, char *argv[]) message("msconn_main: usbmsc_archinitialize failed: %d\n", -ret); return EXIT_FAILURE; } + check_test_memory_usage("After usbmsc_archinitialize()"); /* Then exports the LUN(s) */ @@ -444,6 +445,7 @@ static int msconn_daemon(int argc, char *argv[]) usbmsc_uninitialize(handle); return EXIT_FAILURE; } + message("msconn_main: handle=%p\n", handle); check_test_memory_usage("After usbmsc_configure()"); @@ -456,6 +458,7 @@ static int msconn_daemon(int argc, char *argv[]) usbmsc_uninitialize(handle); return EXIT_FAILURE; } + check_test_memory_usage("After usbmsc_bindlun()"); #if CONFIG_SYSTEM_USBMSC_NLUNS > 1 @@ -469,6 +472,7 @@ static int msconn_daemon(int argc, char *argv[]) usbmsc_uninitialize(handle); return EXIT_FAILURE; } + check_test_memory_usage("After usbmsc_bindlun() #2"); #if CONFIG_SYSTEM_USBMSC_NLUNS > 2 @@ -482,6 +486,7 @@ static int msconn_daemon(int argc, char *argv[]) usbmsc_uninitialize(handle); return EXIT_FAILURE; } + check_test_memory_usage("After usbmsc_bindlun() #3"); #endif @@ -494,6 +499,7 @@ static int msconn_daemon(int argc, char *argv[]) usbmsc_uninitialize(handle); return EXIT_FAILURE; } + check_test_memory_usage("After usbmsc_exportluns()"); /* It this program was configued as an NSH command, then just exit now. @@ -519,6 +525,7 @@ static int msconn_daemon(int argc, char *argv[]) usbmsc_uninitialize(handle); return EXIT_FAILURE; } + check_test_memory_usage("After usbtrace_enumerate()"); # else message("msconn_main: Still alive\n"); @@ -643,18 +650,19 @@ int msdis_main(int argc, char *argv[]) message("msdis: ERROR: Not connected\n"); return EXIT_FAILURE; } - check_test_memory_usage("Since MS connection"); + + check_test_memory_usage("Since MS connection"); /* Then disconnect the device and uninitialize the USB mass storage driver */ - usbmsc_uninitialize(g_usbmsc.mshandle); - g_usbmsc.mshandle = NULL; - message("msdis: Disconnected\n"); - check_test_memory_usage("After usbmsc_uninitialize()"); + usbmsc_uninitialize(g_usbmsc.mshandle); + g_usbmsc.mshandle = NULL; + message("msdis: Disconnected\n"); + check_test_memory_usage("After usbmsc_uninitialize()"); - /* Dump debug memory usage */ + /* Dump debug memory usage */ - final_memory_usage("Final memory usage"); - return EXIT_SUCCESS; + final_memory_usage("Final memory usage"); + return EXIT_SUCCESS; } #endif |