📄 file.lst
字号:
C51 COMPILER V7.50 FILE 06/03/2006 10:32:56 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE FILE
OBJECT MODULE PLACED IN file.obj
COMPILER INVOKED BY: C:\Program Files\keil\C51\BIN\C51.EXE modules\file\file.c LARGE BROWSE DEBUG OBJECTEXTEND PRINT(.\f
-ile.lst) OBJECT(file.obj)
line level source
1 /*C**************************************************************************
2 * NAME: file.c
3 *----------------------------------------------------------------------------
4 * Copyright (c) 2003 Atmel.
5 *----------------------------------------------------------------------------
6 * RELEASE: snd1c-refd-nf-4_0_3
7 * REVISION: 1.10
8 *----------------------------------------------------------------------------
9 * PURPOSE:
10 * This file contains extention routines to the file system
11 *****************************************************************************/
12
13 /*_____ I N C L U D E S ____________________________________________________*/
14
15 #include "config.h" /* system configuration */
16 //#include "modules\display\disp_task.h" /* display definition */
17 #include "file.h" /* file system definition */
18 /*_____ M A C R O S ________________________________________________________*/
19
20 #define F_SEEK_TIME ((Byte)4)
21
22 extern bit fs_memory; /* selected file system */
23
24 /*_____ D E F I N I T I O N ________________________________________________*/
25
26
27 /*_____ D E C L A R A T I O N ______________________________________________*/
28
29
30 /*F**************************************************************************
31 * NAME: file_seek_prev
32 *----------------------------------------------------------------------------
33 * PARAMS:
34 * id: file type identifier
35 * loop: loop to the last file
36 *
37 * return:
38 *----------------------------------------------------------------------------
39 * PURPOSE:
40 * Select previous file with specified extension
41 *----------------------------------------------------------------------------
42 * EXAMPLE:
43 *----------------------------------------------------------------------------
44 * NOTE:
45 * Depending on the time played, this function selects the previous file
46 * or restarts the file under playing.
47 *----------------------------------------------------------------------------
48 * REQUIREMENTS:
49 *****************************************************************************/
50 bit file_seek_prev (Byte id, bit loop)
51 {
52 1 if (1)/*(disp_get_sec() < F_SEEK_TIME) && (disp_get_min() == 0)*/
53 1 {
54 2 while (File_goto_prev() == OK)
C51 COMPILER V7.50 FILE 06/03/2006 10:32:56 PAGE 2
55 2 {
56 3 /* a file or a directory exists */
57 3 if ((File_type() & id) != 0) /* specified file type found */
58 3 {
59 4 return TRUE; /* exit when found */
60 4 }
61 3 }
62 2 /* beginning of dir */
63 2 if (File_goto_last() == OK) /* goto to the end of dir */
64 2 {
65 3 if (loop) /* loop = false when ask previous and play */
66 3 {
67 4 do
68 4 {
69 5 if ((File_type() & id) != 0) /* look for a specified file */
70 5 { /* specified file type found */
71 6 return TRUE; /* exit when found */
72 6 }
73 5 }
74 4 while (File_goto_prev() == OK);
75 4 return FALSE;
76 4 }
77 3 else /* no loop */
78 3 {
79 4 return FALSE; /* Stop at the last */
80 4 }
81 3 }
82 2 else
83 2 return FALSE;
84 2 }
85 1 return TRUE;
86 1 }
87
88
89 /*F**************************************************************************
90 * NAME: file_seek_next
91 *----------------------------------------------------------------------------
92 * PARAMS:
93 * id: file type identifier
94 * loop: loop to the first file
95 *
96 * return:
97 *----------------------------------------------------------------------------
98 * PURPOSE:
99 * Select next file with specified extension
100 *----------------------------------------------------------------------------
101 * EXAMPLE:
102 *----------------------------------------------------------------------------
103 * NOTE:
104 *----------------------------------------------------------------------------
105 * REQUIREMENTS:
106 *****************************************************************************/
107 bit file_seek_next (Byte id, bit loop)
108 {
109 1
110 1 while (File_goto_next() == OK)
111 1 {
112 2 /* file or dir found */
113 2 // if ((File_type() & id) != 0)
114 2 { /* specified file type found */
115 3 return TRUE; /* exit when found */
116 3 }
C51 COMPILER V7.50 FILE 06/03/2006 10:32:56 PAGE 3
117 2 }
118 1 /* end of dir */
119 1 if (File_goto_first() == OK) /* goto beginning of the dir */
120 1 {
121 2 if (loop) /* loop ? */
122 2 { /* re-start at the beginning */
123 3 do
124 3 {
125 4 if ((File_type() & id) != 0) /* look for a specified file */
126 4 { /* specified file type found */
127 5 return TRUE; /* exit when found */
128 5 }
129 4 }
130 3 while (File_goto_next() == OK);
131 3 return FALSE; /* no specified file in the dir */
132 3 }
133 2 else /* no loop */
134 2 {
135 3 return FALSE; /* Stop at the beginning */
136 3 }
137 2 }
138 1 else
139 1 return FALSE;
140 1 }
141
142
143 /*F**************************************************************************
144 * NAME: file_entry_dir
145 *----------------------------------------------------------------------------
146 * PARAMS:
147 * id: file type identifier
148 *
149 * return:
150 * OK: file type found in dir
151 * KO: file type not found in dir
152 *----------------------------------------------------------------------------
153 * PURPOSE:
154 * Enter a directory
155 *----------------------------------------------------------------------------
156 * EXAMPLE:
157 *----------------------------------------------------------------------------
158 * NOTE:
159 *----------------------------------------------------------------------------
160 * REQUIREMENTS:
161 *****************************************************************************/
162 bit file_entry_dir (Byte id)
163 {
164 1 if (File_type() == FILE_DIR) /* only for directory! */
165 1 { /* stopped on a directory */
166 2 if (File_goto_child(id) == KO)
167 2 {
168 3 /* no file in dir */
169 3 File_goto_parent(id);
170 3 return KO;
171 3 }
172 2 else
173 2 return OK;
174 2 }
175 1 else
176 1 {
177 2 return KO;
178 2 }
C51 COMPILER V7.50 FILE 06/03/2006 10:32:56 PAGE 4
179 1 }
180
181
182
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 130 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- 3
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- 2
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -