Problem saving data from SD Card

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem saving data from SD Card

72 Views
Contributor I

Hi, I have the next code.

void file_directory (void)  {

  FINFO info;

    struct {char *name;} mensaje[255];

    int i = 0;

    char *aux;

  info.fileID = 0;                             /* info.fileID must be set to 0 */

  while (ffind ("M:*.bmp", &info) == 0) 

    {       /* find whatever is in drive "R0:" */

        printf ("\n%-32s %5d bytes, ID: %04d", info.name, info.size, info.fileID);

        aux = (char*)info.name;

        mensaje[i].name = aux;

        i++;

  }

  if (info.fileID == 0)  {

    printf ("\nNo files...");

  }

}

When I tried to save the all the files .BMP in the array mensaje[], I get the next:

NXP.png

All the positions of mensaje[] were filled with the last image reading. Who I can solve it.

Tags (3)
0 Kudos
0 Replies