FRESULT create_name ( DIR *dj, /* Pointer to the directory object */ const XCHAR **path /* Pointer to pointer to the segment in the path string */ ) { .... //no lfn
BYTE b, c, d, *sfn; int ni, si, i; const char *p;
/* Create file name in directory form */ sfn = dj->fn; mem_set(sfn, ' ', 11); si = i = b = 0; ni = 8; p = *path; ....
c = p[si++]; printf("PATH[%d]=%c\n",si-1,c); //insert by me }
Изначально путь содержится в переменной типа UCHAR *ptr; (ptr="0:") Затем в эта переменная передается в ф-ю scan_files. ( static FRESULT scan_files (char* path)). В данной ф-ии параметр path передается в ф-ю f_opendir. FRESULT f_opendir ( DIR *dj, /* Pointer to directory object to create */ const XCHAR *path /* Pointer to the directory path */ ) Затем в f_opendir перелается в ф-ю follow_path. static FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */ DIR *dj, /* Directory object to return last directory and found object */ const XCHAR *path /* Full-path string to find a file or directory */ ). И затем уже передается в create_name.
Вот что я вижу на экране:
19:37:23.468> p = 0: (* вроде как правильно передается *) 19:37:23.531> PATH[0]=@ вроде же должно быть PATH[0]=0 ? 19:37:23.593> PATH[1]=@ вроде же должно быть PATH[1]=: ? 19:37:23.593> PATH[2]=@ 19:37:23.593> PATH[3]=@ 19:37:23.593> PATH[4]=@ 19:37:23.593> PATH[5]=@ 19:37:23.593> PATH[6]=@ 19:37:23.656> PATH[7]=@ 19:37:23.656> PATH[8]=@
Вот только не пойму: как передалось значение UCHAR *ptr, расположенного в SRAM в переменную const XCHAR path*, которая расположена во FLASH. ????
|