Jump to content
43oh

bhills

Members
  • Content Count

    4
  • Joined

  • Last visited

Reputation Activity

  1. Like
    bhills reacted to greeeg in SD card reader Sleep   
    Everytime you power cycle the card you will need to perform the initialization sequence again.
     
    Something like this
    SD_PWR_ON(); FATFS fs; disk_initialize(0); // Re-initialize the SD card pf_mount(&fs); // mount Fat FS pf_open("logfile.txt"); // re-open file pf_lseek(fs.fsize); // seek to end of file pf_write(...); // Write block of data Note that if the disk is re-initialized then you really should be performing pf_mount and pf_open again.
     
    Also be aware of the limitations when using PetietFS for writing to files.
    Cannot create file. Only existing file can be written. Cannot expand file size. Cannot update time stamp of the file. Write operation can start/stop on the sector boundary. Read-only attribute of the file cannot block write operation.  
    Particularly "Write operation can start/stop on the sector boundary." This requires that you write your data logs in multiples of 512 bytes.
×
×
  • Create New...