Select one of the symbols to view example projects that use it.
 
Outline
Includes
#include "main.h"
recurseLevel
Explore_Disk(char *, uint8_t)
Files
loading...
CodeScopeSTM32 Libraries and SamplesMSC_StandaloneSrc/explorer.c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * @file USB_Host/MSC_Standalone/Src/explorer.c * @author MCD Application Team * @brief Explore the USB flash disk content ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ /* Includes ----------------------------------------------------------------- */ #include "main.h" Includes /* Private typedef ---------------------------------------------------------- */ /* Private define ----------------------------------------------------------- */ /* Private macro ------------------------------------------------------------ */ /* Private variables -------------------------------------------------------- */ static int32_t recurseLevel = -1; /* Private function prototypes ---------------------------------------------- */ /* Private functions -------------------------------------------------------- */ /** * @brief Displays disk content. * @param path: Pointer to root path * @param recu_level: Disk content level * @retval Operation result *//* ... */ 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 [Tamper] To Continue.\n"); /* Tamper Button in polling */ while ((BSP_PB_GetState(BUTTON_TAMPER) != RESET) && (Appli_state != APPLICATION_DISCONNECT)) { /* Wait for User Input */ }while ((BSP_PB_GetState(BUTTON_TAMPER) != RESET) && (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; }{ ... }