Exemplo n.º 1
0
void mmcFileTest(void) {
    CSL_Status status;
    AtaError ataStatus;
    Bool testFailed;

    testFailed = FALSE;

    printf("MMCSD-ATAFS TESTS!\n\n");
    printf("\n\n\nMMCSD-ATAFS DMA MODE TEST!\n\n");

    status = configSdCard(CSL_MMCSD_OPMODE_DMA);
    if (status != CSL_SOK) {
        testFailed = TRUE;
        /////  Reseting PaSs_StAtE to 0 if error detected here.
        PaSs_StAtE = 0x0000; // Was intialized to 1 at declaration.
        printf("SD card initialization Failed\n");
        printf("\nMMCSD-ATAFS DMA MODE TEST FAILED!!\n");
    } else {
        printf("SD card initialization Successful\n");
        ataStatus = mmcConfigFs("dmaTest");
        if (ataStatus != ATA_ERROR_NONE) {
            testFailed = TRUE;
            /////  Reseting PaSs_StAtE to 0 if error detected here.
            PaSs_StAtE = 0x0000; // Was intialized to 1 at declaration.
            printf("\nMMCSD-ATAFS DMA MODE TEST FAILED!!\n");
        } else {
            printf("\nMMCSD-ATAFS DMA MODE TEST PASSED!!\n");
        }
    }

    /////  At program exit, copy "PaSs_StAtE" into "PaSs".
    PaSs = PaSs_StAtE; //If flow gets here, override PaSs' initial 0 with

    if (testFailed == TRUE) {
        printf("\n\nMMCSD-ATAFS TESTS FAILED!!\n\n");
        exit(EXIT_FAILURE);
    } else {
        printf("\n\nMMCSD-ATAFS TESTS PASSED!!\n\n");
        exit(EXIT_SUCCESS);
    }
}
   /////                                  program flow reaches expected exit point(s).
   /////
void mmcFileTest(void)
{
	CSL_Status    status;
	AtaError      ataStatus;
	Bool          testFailed;

	testFailed = FALSE;

	printf("MMCSD-ATAFS TESTS!\n\n");

	printf("MMCSD-ATAFS POLL MODE TEST!\n\n");

	status = configSdCard(CSL_MMCSD_OPMODE_POLLED);
	if(status != CSL_SOK)
	{
		testFailed = TRUE;
   /////INSTRUMENTATION FOR BATCH TESTING -- Part 2 --
   /////  Reseting PaSs_StAtE to 0 if error detected here.
        PaSs_StAtE = 0x0000; // Was intialized to 1 at declaration.
   /////
		printf("SD card initialization Failed\n");
		printf("\nMMCSD-ATAFS POLL MODE TEST FAILED!!\n");
	}
	else
	{
		printf("SD card initialization Successful\n");
		ataStatus = mmcConfigFs("pollTest");
		if(ataStatus != ATA_ERROR_NONE)
		{
			testFailed = TRUE;
   /////INSTRUMENTATION FOR BATCH TESTING -- Part 2 --
   /////  Reseting PaSs_StAtE to 0 if error detected here.
        PaSs_StAtE = 0x0000; // Was intialized to 1 at declaration.
   /////
			printf("\nMMCSD-ATAFS POLL MODE TEST FAILED!!\n");
		}
		else
		{
			printf("\nMMCSD-ATAFS POLL MODE TEST PASSED!!\n");
		}
	}

	printf("\n\n\nMMCSD-ATAFS DMA MODE TEST!\n\n");

	status = configSdCard(CSL_MMCSD_OPMODE_DMA);
	if(status != CSL_SOK)
	{
		testFailed = TRUE;
   /////INSTRUMENTATION FOR BATCH TESTING -- Part 2 --
   /////  Reseting PaSs_StAtE to 0 if error detected here.
        PaSs_StAtE = 0x0000; // Was intialized to 1 at declaration.
   /////
		printf("SD card initialization Failed\n");
		printf("\nMMCSD-ATAFS DMA MODE TEST FAILED!!\n");
	}
	else
	{
		printf("SD card initialization Successful\n");
		ataStatus = mmcConfigFs("dmaTest");
		if(ataStatus != ATA_ERROR_NONE)
		{
			testFailed = TRUE;
   /////INSTRUMENTATION FOR BATCH TESTING -- Part 2 --
   /////  Reseting PaSs_StAtE to 0 if error detected here.
        PaSs_StAtE = 0x0000; // Was intialized to 1 at declaration.
   /////
			printf("\nMMCSD-ATAFS DMA MODE TEST FAILED!!\n");
		}
		else
		{
			printf("\nMMCSD-ATAFS DMA MODE TEST PASSED!!\n");
		}
	}

   /////INSTRUMENTATION FOR BATCH TESTING -- Part 3 --
   /////  At program exit, copy "PaSs_StAtE" into "PaSs".
        PaSs = PaSs_StAtE; //If flow gets here, override PaSs' initial 0 with
   /////                   // pass/fail value determined during program execution.
   /////  Note:  Program should next exit to C$$EXIT and halt, where DSS, under
   /////   control of a host PC script, will read and record the PaSs' value.
   /////

	if (testFailed == TRUE)
	{
		printf("\n\nMMCSD-ATAFS TESTS FAILED!!\n\n");
		exit(EXIT_FAILURE);
	}
	else
	{
		printf("\n\nMMCSD-ATAFS TESTS PASSED!!\n\n");
		exit(EXIT_SUCCESS);
	}
}