AnsweredAssumed Answered

Wrong position of "EVENT_Delete(kEVENT_TransferComplete);" in fsl_sd_disk.c ?

Question asked by se7ensong on Nov 8, 2016
Latest reply on Nov 14, 2016 by se7ensong

Hello,

 

I am just wondering if the position of "EVENT_Delete(kEVENT_TransferComplete);" is wrong in SDK 2.0. The file is located in line 257 @ middleware\fatfs_0.11a\src\fsl_sd_disk\fsl_sd_disk.c.

 

I am thinking it should be placed between line 253 and 254 so that the event get removed upon failed initialisation. Could anyone from NXP please confirm if I have misunderstood the code? Thanks

 

Here is the code

 

if (kStatus_Success != SD_Init(&g_sd))
{
SD_Deinit(&g_sd);
SDHC_Deinit(BOARD_SDHC_BASEADDR);
memset(&g_sd, 0U, sizeof(g_sd));
memset(&g_sdhcAdmaTable, 0U, sizeof(g_sdhcAdmaTable));
memset(&g_sdhcHandle, 0U, sizeof(g_sdhcHandle));
+ EVENT_Delete(kEVENT_TransferComplete);
return STA_NOINIT;
}

- EVENT_Delete(kEVENT_TransferComplete);

Outcomes