/*##-7- Open the text file object with read access ###############*/
if(f_open(&MyFile, "0:/STM32.TXT", FA_READ) != FR_OK)
{
/* 'STM32.TXT' file Open for read Error */
Error_Handler();
}
else
{
res = f_read(&MyFile, rtext, sizeof(rtext), (UINT*)&bytesread);
/*##-10- Compare read data with the expected data ############*/
if((bytesread != byteswritten))
{
/* Read data is different from the expected data */
Error_Handler();
}
else
{
/* Success of the demo: no error occurrence */
HAL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin);
}
}
}
}
}
}