Code: Select all
int iOk,iCount;
FIL iHandle;
f_unlink((const TCHAR*)"/demodir/r.txt");
iOk=f_open(&iHandle,(TCHAR*)"/demodir/r.txt",(BYTE)(FA_CREATE_NEW|FA_WRITE));
gpio_pad_select_gpio(25);
gpio_set_direction(25, GPIO_MODE_INPUT);
gpio_set_pull_mode(25, GPIO_PULLUP_ONLY);
while(1)
{
//printf ("\niok is %d",iOk);
iOk =f_write(&iHandle,"1",1,(UINT*)&iCount);
//printf ("\niok is %d",iOk);
printf ("\niok is %d",iCount);
//vTaskDelay(1000 / portTICK_RATE_MS);
if(gpio_get_level(25) == 0) break;
}
iOk=f_close(&iHandle);
Any mistake i could improve?