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
30
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
55
59
60
61
62
63
75
76
80
84
90
95
96
100
101
102
103
104
108
109
110
/* ... */
#include "main.h"
Includes
static int32_t recurseLevel = -1;
/* ... */
FRESULT Explore_Disk(char *path, uint8_t recu_level)
{
FRESULT res = FR_OK;
FILINFO fno;
DIR dir;
char tmp[14];
uint8_t line_idx = 0;
recurseLevel++;
res = f_opendir(&dir, path);
if (res == FR_OK)
{
while (USBH_MSC_IsReady(&hUSBHost))
{
res = f_readdir(&dir, &fno);
if (res != FR_OK || fno.fname[0] == 0)
{
break;
}if (res != FR_OK || fno.fname[0] == 0) { ... }
if (fno.fname[0] == '.')
{
continue;
}if (fno.fname[0] == '.') { ... }
strcpy(tmp, fno.fname);
line_idx++;
if (line_idx > YWINDOW_SIZE)
{
line_idx = 0;
LCD_UsrLog("> Press User button To Continue.\n");
while((BSP_PB_GetState(BUTTON_WAKEUP) != SET) &&
(Appli_state != APPLICATION_DISCONNECT))
{
}while ((BSP_PB_GetState(BUTTON_WAKEUP) != SET) && (Appli_state != APPLICATION_DISCONNECT)) { ... }
}if (line_idx > YWINDOW_SIZE) { ... }
if (recu_level == 1)
{
LCD_DbgLog(" |__");
}if (recu_level == 1) { ... }
else if (recu_level == 2)
{
LCD_DbgLog(" | |__");
}else if (recu_level == 2) { ... }
if (fno.fattrib & AM_DIR)
{
strcat(tmp, "\n");
LCD_UsrLog((void *)tmp);
Explore_Disk(fno.fname, 2);
}if (fno.fattrib & AM_DIR) { ... }
else
{
strcat(tmp, "\n");
LCD_DbgLog((void *)tmp);
}else { ... }
if ((fno.fattrib & AM_DIR) && (recu_level == 2))
{
Explore_Disk(fno.fname, 2);
}if ((fno.fattrib & AM_DIR) && (recu_level == 2)) { ... }
}while (USBH_MSC_IsReady(&hUSBHost)) { ... }
f_closedir(&dir);
}if (res == FR_OK) { ... }
if (--recurseLevel == -1)
{
LCD_UsrLog("> Select an operation to Continue.\n");
}if (--recurseLevel == -1) { ... }
return res;
}{ ... }