unsigned char temp=0; // unsigned char tmp[] = "Hello USB!\n"; // int i; mInitCH376Host(); printf("CH376芯片讀寫測試!\n"); xWriteCH376Cmd(CMD01_GET_IC_VER); temp=xReadCH376Data()-0x80; printf("固件版本號為:0x %x\n",temp); xWriteCH376Cmd(CMD11_CHECK_EXIST); xWriteCH376Data(0xaa); temp = xReadCH376Data(); if(temp == 0x55) { printf("測試工作狀態(tài):成功!\n"); } else { printf("測試工作狀態(tài):失敗\n"); }
用上段程序測試結(jié)果 CH376芯片讀寫測試! 固件版本號為:0x c4 測試工作狀態(tài):成功!
unsigned s; mInitCH376Host(); s = CH376DiskConnect(); while ( CH376DiskConnect( ) != USB_INT_SUCCESS ) { usleep( 100000 ); } usleep( 200000 ); for(s=0;s<10;s++) { usleep(50000); printf("ready?\n"); if(CH376DiskMount( )==USB_INT_SUCCESS) break; }
s=CH376DirCreate("/LI"); printf("%x",s); s=CH376FileClose(FALSE); printf("%x",s); while(1); return 0;
但是我用這段程序卻不能創(chuàng)建文件夾,程序有什么問題嗎?