[table][tr][td]
本帖最后由 asdf 于 2014-8-1 14:54 编辑
ISO-MINI:
“20、FATFS-文件系统”中的程序main.c中,fnew必须定义为全局变量才可以,
要是把这个声明放进main()中就不行。请问各位这是怎么回事<div class="blockcode"><div id="code_YDD">
- #include &quot;stm32f10x.h&quot;
- #include &quot;bsp_sdio_sdcard.h&quot;
- #include &quot;bsp_usart1.h&quot;
- #include &quot;ff.h&quot;
- FIL fnew; // 这个放进main()中用f_open 就失败 /* file objects */
- FATFS fs; /* Work area (file system object) for logical drives */
- FRESULT res;
- UINT br, bw; /* File R/W count */
- BYTE buffer[4096]={0}; /* file copy buffer */
- BYTE textFileBuffer[] = &quot;Welcome to use Wildfire iso stm32 Development Board today is a good day&quot;;
- int main(void)
- {
- /* USART1 config */
- USART1_Config();
- printf(&quot;\r\n this is a fatfs test demo \r\n&quot;);
-
- /* Sdio Interrupt Config */
- NVIC_Configuration();
-
- /* Register work area for each volume (Always succeeds regardless of disk status) */
- f_mount(0,&fs);
- ···略}
|