?? diskio.lst
字號:
C51 COMPILER V8.08 DISKIO 10/31/2008 14:44:16 PAGE 1
C51 COMPILER V8.08, COMPILATION OF MODULE DISKIO
OBJECT MODULE PLACED IN .\diskio.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\src\diskio.c BROWSE DEBUG OBJECTEXTEND PRINT(.\diskio.lst) OBJECT(.\disk
-io.obj)
line level source
1 /*-----------------------------------------------------------------------*/
2 /* Low level disk I/O module skeleton for FatFs (C)ChaN, 2007 */
3 /*-----------------------------------------------------------------------*/
4 /* This is a stub disk I/O module that acts as front end of the existing */
5 /* disk I/O modules and attach it to FatFs module with common interface. */
6 /*-----------------------------------------------------------------------*/
7
8 #include "diskio.h"
9
10 /*-----------------------------------------------------------------------*/
11 /* Correspondence between physical drive number and physical drive. */
12 /* Note that Tiny-FatFs supports only single drive and always */
13 /* accesses drive number 0. */
14
15 #define ATA 0
16 #define MMC 1
17 #define USB 2
18
19
20
21 /*-----------------------------------------------------------------------*/
22 /* Inidialize a Drive */
23
24 DSTATUS disk_initialize (
25 BYTE drv /* Physical drive nmuber (0..) */
26 )
27 {
28 1 DSTATUS stat;
29 1 int result;
30 1
31 1 switch (drv) {
32 2 case ATA :
33 2 result = ATA_disk_initialize();
*** WARNING C206 IN LINE 33 OF ..\SRC\DISKIO.C: 'ATA_disk_initialize': missing function-prototype
34 2 // translate the reslut code here
35 2
36 2 return stat;
37 2
38 2 case MMC :
39 2 result = MMC_disk_initialize();
*** WARNING C206 IN LINE 39 OF ..\SRC\DISKIO.C: 'MMC_disk_initialize': missing function-prototype
40 2 // translate the reslut code here
41 2
42 2 return stat;
43 2
44 2 case USB :
45 2 result = USB_disk_initialize();
*** WARNING C206 IN LINE 45 OF ..\SRC\DISKIO.C: 'USB_disk_initialize': missing function-prototype
46 2 // translate the reslut code here
47 2
48 2 return stat;
49 2 }
50 1 return STA_NOINIT;
51 1 }
C51 COMPILER V8.08 DISKIO 10/31/2008 14:44:16 PAGE 2
52
53
54
55 /*-----------------------------------------------------------------------*/
56 /* Return Disk Status */
57
58 DSTATUS disk_status (
59 BYTE drv /* Physical drive nmuber (0..) */
60 )
61 {
62 1 DSTATUS stat;
63 1 int result;
64 1
65 1 switch (drv) {
66 2 case ATA :
67 2 result = ATA_disk_status();
*** WARNING C206 IN LINE 67 OF ..\SRC\DISKIO.C: 'ATA_disk_status': missing function-prototype
68 2 // translate the reslut code here
69 2
70 2 return stat;
71 2
72 2 case MMC :
73 2 result = MMC_disk_status();
*** WARNING C206 IN LINE 73 OF ..\SRC\DISKIO.C: 'MMC_disk_status': missing function-prototype
74 2 // translate the reslut code here
75 2
76 2 return stat;
77 2
78 2 case USB :
79 2 result = USB_disk_status();
*** WARNING C206 IN LINE 79 OF ..\SRC\DISKIO.C: 'USB_disk_status': missing function-prototype
80 2 // translate the reslut code here
81 2
82 2 return stat;
83 2 }
84 1 return STA_NOINIT;
85 1 }
86
87
88
89 /*-----------------------------------------------------------------------*/
90 /* Read Sector(s) */
91
92 DRESULT disk_read (
93 BYTE drv, /* Physical drive nmuber (0..) */
94 BYTE *buff, /* Data buffer to store read data */
95 DWORD sector, /* Sector address (LBA) */
96 BYTE count /* Number of sectors to read (1..255) */
97 )
98 {
99 1 DRESULT res;
100 1 int result;
101 1
102 1 switch (drv) {
103 2 case ATA :
104 2 result = ATA_disk_read(buff, sector, count);
*** WARNING C206 IN LINE 104 OF ..\SRC\DISKIO.C: 'ATA_disk_read': missing function-prototype
*** ERROR C267 IN LINE 104 OF ..\SRC\DISKIO.C: 'ATA_disk_read': requires ANSI-style prototype
105 2 // translate the reslut code here
106 2
107 2 return res;
108 2
C51 COMPILER V8.08 DISKIO 10/31/2008 14:44:16 PAGE 3
109 2 case MMC :
110 2 result = MMC_disk_read(buff, sector, count);
111 2 // translate the reslut code here
112 2
113 2 return res;
114 2
115 2 case USB :
116 2 result = USB_disk_read(buff, sector, count);
117 2 // translate the reslut code here
118 2
119 2 return res;
120 2 }
121 1 return RES_PARERR;
122 1 }
123
124
125
126 /*-----------------------------------------------------------------------*/
127 /* Write Sector(s) */
128
129 #if _READONLY == 0
130 DRESULT disk_write (
131 BYTE drv, /* Physical drive nmuber (0..) */
132 const BYTE *buff, /* Data to be written */
133 DWORD sector, /* Sector address (LBA) */
134 BYTE count /* Number of sectors to write (1..255) */
135 )
136 {
137 1 DRESULT res;
138 1 int result;
139 1
140 1 switch (drv) {
141 2 case ATA :
142 2 result = ATA_disk_write(buff, sector, count);
143 2 // translate the reslut code here
144 2
145 2 return res;
146 2
147 2 case MMC :
148 2 result = MMC_disk_write(buff, sector, count);
149 2 // translate the reslut code here
150 2
151 2 return res;
152 2
153 2 case USB :
154 2 result = USB_disk_write(buff, sector, count);
155 2 // translate the reslut code here
156 2
157 2 return res;
158 2 }
159 1 return RES_PARERR;
160 1 }
161 #endif /* _READONLY */
162
163
164
165 /*-----------------------------------------------------------------------*/
166 /* Miscellaneous Functions */
167
168 DRESULT disk_ioctl (
169 BYTE drv, /* Physical drive nmuber (0..) */
170 BYTE ctrl, /* Control code */
C51 COMPILER V8.08 DISKIO 10/31/2008 14:44:16 PAGE 4
171 void *buff /* Buffer to send/receive control data */
172 )
173 {
174 1 DRESULT res;
175 1 int result;
176 1
177 1 switch (drv) {
178 2 case ATA :
179 2 // pre-process here
180 2
181 2 result = ATA_disk_ioctl(ctrl, buff);
182 2 // post-process here
183 2
184 2 return res;
185 2
186 2 case MMC :
187 2 // pre-process here
188 2
189 2 result = MMC_disk_ioctl(ctrl, buff);
190 2 // post-process here
191 2
192 2 return res;
193 2
194 2 case USB :
195 2 // pre-process here
196 2
197 2 result = USB_disk_ioctl(ctrl, buff);
198 2 // post-process here
199 2
200 2 return res;
201 2 }
202 1 return RES_PARERR;
203 1 }
204
C51 COMPILATION COMPLETE. 7 WARNING(S), 1 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -