1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
21
22
23
24
34
37
38
39
44
/* ... */
#include "main.h"
Includes
uint8_t *MSC_main_menu[] =
{
(uint8_t *)" 1 - File Operations ",
(uint8_t *)" 2 - Explorer Disk ",
(uint8_t *)" 3 - Return ",
(uint8_t *)" ",
...};
Private variables
extern DEMO_StateMachine demo;
Private function prototypes
/* ... */
void MSC_MenuProcess(void)
{
switch(demo.msc_state)
{
case APPLI_MSC_IDLE:
Demo_SelectItem(MSC_main_menu, 0);
demo.msc_state = APPLI_MSC_WAIT;
demo.select = 0;
break;
case APPLI_MSC_IDLE:
case APPLI_MSC_WAIT:
if(demo.select != prev_select)
{
prev_select = demo.select;
Demo_SelectItem(MSC_main_menu, demo.select & 0x7F);
if(demo.select & 0x80)
{
demo.select &= 0x7F;
switch(demo.select)
{
case 0:
demo.msc_state = APPLI_MSC_FILE_OPERATIONS;
break;
case 0:
case 1:
demo.msc_state = APPLI_MSC_EXPLORER;
break;
case 1:
case 2:
demo.state = DEMO_IDLE;
demo.select = 0;
LCD_UsrLogY("> MSC application closed.\n");
f_mount(0,0,0);
break;
case 2:
default:
break;default
}switch (demo.select) { ... }
}if (demo.select & 0x80) { ... }
}if (demo.select != prev_select) { ... }
break;
case APPLI_MSC_WAIT:
case APPLI_MSC_FILE_OPERATIONS:
if(Appli_HS_state == APPLICATION_HS_READY)
{
MSC_File_Operations();
}if (Appli_HS_state == APPLICATION_HS_READY) { ... }
demo.msc_state = APPLI_MSC_WAIT;
break;
case APPLI_MSC_FILE_OPERATIONS:
case APPLI_MSC_EXPLORER:
if(Appli_HS_state == APPLICATION_HS_READY)
{
Explore_Disk("0:/", 1);
}if (Appli_HS_state == APPLICATION_HS_READY) { ... }
demo.msc_state = APPLI_MSC_WAIT;
break;
case APPLI_MSC_EXPLORER:
default:
break;default
}switch (demo.msc_state) { ... }
}{ ... }