CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ex_fat.c file modified to create a file

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
curiousaboutcircuits85



Joined: 08 Apr 2010
Posts: 13

View user's profile Send private message

ex_fat.c file modified to create a file
PostPosted: Mon Apr 12, 2010 9:25 pm     Reply with quote

Hello,

I've taken a look at the ex_fat.c file to see if I'd be able to create a file into my SD Card using PIC18f4550. Here is my main code below:
Code:

void main()
{
   char opt_buffer[255];
   
   int i;   // pointer to the buffer

   // initialize the FAT
   //  keep in mind that this will automagically initialize the media
   i = fat_init();
   if (i)
      printf("\r\n\nERROR INITIALIZING FAT\r\n\n");
   
   *opt_buffer = "/test.txt";
   MakeFile(opt_buffer);   
}

I don't see why it's not showing the text.txt file on my SD Card. It's a 2GB microSD using SD Adaptor and it has been formatted to FAT32 with 4096 cluster sizes. I'd very much appreciate some input. Thank you.

p.s. the heading is exactly the same as the ex_fat.c file. I just changed the void main() to see if I could create a file in the SD Card.
curiousaboutcircuits85



Joined: 08 Apr 2010
Posts: 13

View user's profile Send private message

PostPosted: Tue Apr 13, 2010 8:27 pm     Reply with quote

Does anybody have an idea? I've modified to work this way:
Code:

void main()
{
char opt_buffer[255];
strcpy(opt_buffer, "test.txt");
   
fat_init();
/*char string[10], string2[10];
  strcpy (string, "Hi There");
  strcpy(string2,string);
*/
 
//*opt_buffer = "/test.txt";
MakeFile(opt_buffer);   
}

I'm guessing file should be made here....?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group