summaryrefslogtreecommitdiff
path: root/apps/plugins/test_usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/test_usb.c')
-rw-r--r--apps/plugins/test_usb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/plugins/test_usb.c b/apps/plugins/test_usb.c
index 6bb77c40be..28ef8f7e5f 100644
--- a/apps/plugins/test_usb.c
+++ b/apps/plugins/test_usb.c
@@ -85,7 +85,7 @@ static void kill_tsr(void)
85 rb->queue_delete(&queue); 85 rb->queue_delete(&queue);
86} 86}
87 87
88static bool exit_tsr(bool reenter) 88static int exit_tsr(bool reenter)
89{ 89{
90 MENUITEM_STRINGLIST(menu, "USB test menu", NULL, 90 MENUITEM_STRINGLIST(menu, "USB test menu", NULL,
91 "Status", "Stop plugin", "Back"); 91 "Status", "Stop plugin", "Back");
@@ -100,9 +100,9 @@ static bool exit_tsr(bool reenter)
100 case 1: 100 case 1:
101 rb->splashf(HZ, "Stopping USB test thread"); 101 rb->splashf(HZ, "Stopping USB test thread");
102 kill_tsr(); 102 kill_tsr();
103 return true; 103 return (reenter ? PLUGIN_TSR_TERMINATE : PLUGIN_TSR_SUSPEND);
104 case 2: 104 case 2:
105 return false; 105 return PLUGIN_TSR_CONTINUE;
106 } 106 }
107 } 107 }
108} 108}
@@ -119,14 +119,15 @@ static void run_tsr(void)
119 119
120enum plugin_status plugin_start(const void* parameter) 120enum plugin_status plugin_start(const void* parameter)
121{ 121{
122 (void)parameter; 122 bool resume = (parameter == rb->plugin_tsr);
123
123 MENUITEM_STRINGLIST(menu, "USB test menu", NULL, 124 MENUITEM_STRINGLIST(menu, "USB test menu", NULL,
124 "Start", "Quit"); 125 "Start", "Quit");
125 126
126 switch(rb->do_menu(&menu, NULL, NULL, false)) { 127 switch(!resume ? rb->do_menu(&menu, NULL, NULL, false) : 0) {
127 case 0: 128 case 0:
128 run_tsr(); 129 run_tsr();
129 rb->splashf(HZ, "Thread started"); 130 rb->splashf(HZ, "USB test thread started");
130 return PLUGIN_OK; 131 return PLUGIN_OK;
131 case 1: 132 case 1:
132 return PLUGIN_OK; 133 return PLUGIN_OK;