1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
22
23
24
25
26
27
28
29
34
39
40
45
/* ... */
#include "main.h"
Includes
/* ... */
void Menu_Init(void)
{
msc_demo.state = MSC_DEMO_START;
hid_demo.state = HID_DEMO_START;
}{ ... }
/* ... */
void DS_MenuProcess(void)
{
switch(Appli_state)
{
case APPLICATION_IDLE:
break;
case APPLICATION_IDLE:
case APPLICATION_MSC:
MSC_MenuProcess();
break;
case APPLICATION_MSC:
case APPLICATION_HID:
HID_MenuProcess();
break;
case APPLICATION_HID:
default:
break;default
}switch (Appli_state) { ... }
if(Appli_state == APPLICATION_DISCONNECT)
{
Appli_state = APPLICATION_IDLE;
LCD_ErrLog("USB device disconnected!\n");
Menu_Init();
LCD_UsrLog("Plug your device To Continue...\n");
}if (Appli_state == APPLICATION_DISCONNECT) { ... }
}{ ... }