if(ass1==0x14) //優(yōu)盤連接狀態(tài)判斷, { SCS_L; usb_write_8_COM(0x2F); //建立文件名 ass1=1; while((name[ass1]!=0x5C)&(name[ass1]!=0x2F)&(ass1<20)) { usb_write_8_DATA(name[ass1]); ass1++; } if(name[ass1]==0x2F) {usb_write_8_DATA(0);} SCS_H; SCS_L; usb_write_8_COM(0x34); //建立文件命令 usb_delay(200); SCS_H; ass1=usb_zhongduan_duqu(); //讀取中斷標(biāo)志 if(ass1==0x14) //判斷文件是否建立 {
ass1=usb_zhongduan_duqu(); //讀取中斷標(biāo)志 if(ass1==0x14) { SCS_L; usb_write_8_COM(0x3C); //以字節(jié)為單位寫入命令 usb_write_8_DATA(usb_xieru_zijieshu); //請(qǐng)求寫入字節(jié)數(shù)低8位 usb_write_8_DATA(usb_xieru_zijieshu>>8); //請(qǐng)求寫入字節(jié)數(shù)高8位 SCS_H; usb_delay(20); ass1=usb_zhongduan_duqu(); //中斷類型讀取 if(ass1==0x1E) //請(qǐng)求輸入標(biāo)志 { SCS_L;
usb_write_8_COM(0x2D); //寫入的數(shù)據(jù)可以是一個(gè)數(shù)組或字符串
ass1=usb_read_8(); //讀取8位數(shù)據(jù)長(zhǎng)度 SCS_H; } SCS_L; usb_write_8_COM(0x36); //關(guān)閉文件 usb_write_8_DATA(1); SCS_H; ass1=usb_zhongduan_duqu(); //讀取中斷標(biāo)志 } ass1=ass1+1; }