下面應(yīng)用函數(shù)中調(diào)用的全是原廠庫(kù)函數(shù)
運(yùn)行結(jié)果是U盤(pán)中創(chuàng)建的文件中只有一個(gè)無(wú)關(guān)的亂碼字符
調(diào)試發(fā)現(xiàn)在字節(jié)寫(xiě)的函數(shù)中,第一個(gè)中斷返回就是0x14,而非0x1e,直接跳過(guò)了寫(xiě)數(shù)據(jù)過(guò)程
U盤(pán)的連接檢測(cè),初始化什么的都能成功,創(chuàng)建文件也能成功,寫(xiě)數(shù)據(jù)問(wèn)題究竟是什么原因,望解釋,謝謝。
void CheckUsbConnect(void)
{
??? static u16 u16_file_id = 0;
??? static u32 u32_line_id = 0;
??? static u08?TarFileName[64];
??? if (CH376DiskConnect() != USB_INT_SUCCESS)
??? {
??????? return;
??? }
???
??? if (CH376DiskMount() != USB_INT_SUCCESS)
??? {
??????? return;
??? }
???
??? if (u32_line_id == 0)
??? {
??????? sprintf((char*)TarFileName, "\\AIB%05d.TXT", u16_file_id);?
??????? memcpy(pst_m_manual->mu08_made_core, TarFileName, 20);?
????????
??????? if (CH376FileCreate((u08*)TarFileName) != USB_INT_SUCCESS)
??????? {
??????????? return;
??????? }
??? }
??? else
??? {
??????? CH376WriteVar32(VAR_START_CLUSTER, 0);?
????????
??????? if (CH376FileOpen(TarFileName) != USB_INT_SUCCESS)
??????? {
??????????? return;
??????? }
???????
??????? if (CH376ByteLocate(u32_line_id * 8) != USB_INT_SUCCESS)
??????? {
??????????? return;
??????? }
??????? u32_line_id ++;
??????? if (u32_line_id >= 10000)
??????? {
??????????? u32_line_id = 0;
??????????? u16_file_id ++;
??????? }
??????? pst_m_using->ms16_cycle = u32_line_id;
??? }
???
??? if (CH376ByteWrite(pst_m_manual->mu08_made_date, 8, NULL) != USB_INT_SUCCESS)
??? {
??????? return;
??? }
???
??? if (CH376FileClose(TRUE) != USB_INT_SUCCESS)
??? {
??????? return;
??? }
}
?