Select one of the symbols to view example projects that use it.
 
Outline
Includes
#include "main.h"
Explore_Disk(char *, uint8_t)
Files
loading...
CodeScopeSTM32 Libraries and SamplesDynamicSwitch_StandaloneSrc/msc_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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * @file USB_Host/DynamicSwitch_Standalone/Src/msc_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 --------------------------------------------------------- */ /* 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 *fn; char tmp[14]; uint8_t line_idx = 0; 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] == '.') { ... } fn = fno.fname; strcpy(tmp, fn); line_idx++; if (line_idx > 9) { line_idx = 0; LCD_UsrLog("> Press [Key] To Continue.\n"); /* KEY Button in polling */ while (BSP_PB_GetState(BUTTON_KEY) != RESET) { /* Wait for User Input */ }while (BSP_PB_GetState(BUTTON_KEY) != RESET) { ... } }if (line_idx > 9) { ... } 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) == AM_DIR) { strcat(tmp, "\n"); LCD_UsrLog((void *)tmp); Explore_Disk(fn, 2); }if ((fno.fattrib & AM_DIR) == AM_DIR) { ... } else { strcat(tmp, "\n"); LCD_DbgLog((void *)tmp); }else { ... } if (((fno.fattrib & AM_DIR) == AM_DIR) && (recu_level == 2)) { Explore_Disk(fn, 2); }if (((fno.fattrib & AM_DIR) == AM_DIR) && (recu_level == 2)) { ... } }while (USBH_MSC_IsReady(&hUSBHost)) { ... } f_closedir(&dir); LCD_UsrLog("> Select an operation to Continue.\n"); }if (res == FR_OK) { ... } return res; }{ ... }