1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
21
22
23
24
27
28
29
30
35
36
37
38
39
40
41
42
43
44
45
46
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
71
72
73
74
75
76
77
78
79
80
92
94
95
/* ... */
#include "main.h"
Includes
MSC_DEMO_StateMachine msc_demo;
Private variables
/* ... */
void MSC_MenuProcess(void)
{
switch(msc_demo.state)
{
case MSC_DEMO_START:
if(Appli_state == APPLICATION_MSC)
{
BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
BSP_LCD_DisplayStringAtLine(27, (uint8_t *)"Press User button to start read and write operations");
while((BSP_PB_GetState(BUTTON_WAKEUP) != SET) && (Appli_state != APPLICATION_DISCONNECT))
{
}while ((BSP_PB_GetState(BUTTON_WAKEUP) != SET) && (Appli_state != APPLICATION_DISCONNECT)) { ... }
msc_demo.state = MSC_DEMO_FILE_OPERATIONS;
HAL_Delay(400);
BSP_LCD_ClearStringLine(27);
}if (Appli_state == APPLICATION_MSC) { ... }
break;
case MSC_DEMO_START:
case MSC_DEMO_FILE_OPERATIONS:
if(Appli_state == APPLICATION_MSC)
{
MSC_File_Operations();
BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
BSP_LCD_DisplayStringAtLine(27, (uint8_t *)"Press User button to display disk content");
while((BSP_PB_GetState(BUTTON_WAKEUP) != SET) && (Appli_state != APPLICATION_DISCONNECT))
{
}while ((BSP_PB_GetState(BUTTON_WAKEUP) != SET) && (Appli_state != APPLICATION_DISCONNECT)) { ... }
msc_demo.state = MSC_DEMO_EXPLORER;
HAL_Delay(400);
BSP_LCD_ClearStringLine(27);
}if (Appli_state == APPLICATION_MSC) { ... }
break;
case MSC_DEMO_FILE_OPERATIONS:
case MSC_DEMO_EXPLORER:
if(Appli_state == APPLICATION_MSC)
{
Explore_Disk("0:/", 1);
msc_demo.state = MSC_DEMO_START;
HAL_Delay(400);
}if (Appli_state == APPLICATION_MSC) { ... }
break;
case MSC_DEMO_EXPLORER:
default:
break;default
}switch (msc_demo.state) { ... }
}{ ... }