void Main_Write (unsigned char * string_to_write, int bytes_to_write) { USB_INT32S fdw; USB_INT32U tot_bytes_written; USB_INT32U bytes_written; fdw = FILE_Open(FILENAME_W, RDWR); if (fdw > 0) { tot_bytes_written = 0; PRINT_Log("Writing to %s...\n", FILENAME_W); bytes_written = FILE_Write(fdw, string_to_write, bytes_to_write); FILE_Close(fdw); PRINT_Log("Write completed\n"); } else { PRINT_Log("Could not open file %s\n", FILENAME_W); return; } } |