2018-03-22 05:13 PM
As I am debugging code I ran into a problem in f_close which leads me to the disk_write function in diskio.c. It looks like this function calls itself? I am stuggling to understand just what this line does:
res = disk.drv[pdrv]->disk_write(disk.lun[pdrv], buff, sector, count);
2018-03-22 05:25 PM
Calling a function pointer in a structure, allows for multiple drives, multiple interfaces
This from sd_diskio.h, your wrapper would call SD_write()
const Diskio_drvTypeDef SD_Driver =
{ SD_initialize, SD_status, SD_read,#if _USE_WRITE == 1 SD_write,#endif /* _USE_WRITE == 1 */#if _USE_IOCTL == 1
SD_ioctl,#endif /* _USE_IOCTL == 1 */};