Exemple #1
0
/** ============================================================================
 *  @func   main
 *
 *  @desc   Entry function.
 *
 *  @modif  None
 *  ============================================================================
 */
Void main(Int argc, Char *argv[])
{
#if defined (SWI_MODE)
    /* SWI based loopback */
    SWILOOP_TransferInfo * info;
#else /* if defined (SWI_MODE) */
    /* TSK based loopback */
    TSK_Handle tskLoopTask;
#endif /* if defined (SWI_MODE) */
#if defined (SWI_MODE) || defined (CHNL_PCPY_LINK)
    Int status ;
#endif /* if defined (SWI_MODE) || defined (CHNL_PCPY_LINK) */

#if defined (DSP_BOOTMODE_NOBOOT)
    /* register the init ISR */
    HAL_intRegister (DSPLINK_INT_ID,
                     DSPLINK_INT_VEC_ID,
                    (Fxn) &HAL_initIsr,
                     0) ;
#endif

#if !defined (DSP_BOOTMODE_NOBOOT)
    /* Initialize DSP/BIOS LINK. */
    DSPLINK_init () ;

    /* Get the number of transfers to be done by the application */
    numTransfers = atoi (argv[1]) ;

    /* Transfer size for loopback given by GPP side */
    xferBufSize = DSPLINK_ALIGN ((atoi (argv[0]) / DSP_MAUSIZE),
                                  DSPLINK_BUF_ALIGN) ;
#else
    /* Get the number of transfers to be done by the application */
    numTransfers = 10000 ;

    /* Transfer size for loopback given by GPP side */
    xferBufSize = 1024 ;
#endif
#if defined (SWI_MODE)
    /* Create phase of SWILOOP application */
    status = SWILOOP_create(&info);
    if (status == SYS_OK) {

        /* Execute phase of SWILOOP application */
        status = SWILOOP_execute(info);
        if (status != SYS_OK) {
            SET_FAILURE_REASON (status);
        }
    }
    else {
        SET_FAILURE_REASON (status);
    }

    /* Delete phase of SWILOOP application: This is not called right now
     * because SWI application runs forever
     */
    /*
    deleteStatus = SWILOOP_delete(info);
    if (deleteStatus != SYS_OK) {
        SET_FAILURE_REASON (deleteStatus);
    }
    */
#else /* if defined (SWI_MODE) */
    /* Creating task for TSKLOOP application */
    tskLoopTask = TSK_create(tskLoop, NULL, 0);
    if (tskLoopTask != NULL) {
        LOG_printf(&trace, "Create TSKLOOP: Success\n");
    }
    else {
        LOG_printf(&trace, "Create TSKLOOP: Failed.\n");
        return;
    }
#endif /* if defined (SWI_MODE) */

    return;
}
Exemple #2
0
/** ============================================================================
 *  @func   main
 *
 *  @desc   Entry function.
 *
 *  @modif  None
 *  ============================================================================
 */
Void main(Int argc, Char *argv[]) {
	/* TSK based ring_io application */
	TSK_Handle tskRingIoTask1; //for sending
	TSK_Handle tskRingIoTask2; // for receiving

	TSK_Attrs attrs = TSK_ATTRS;

#if defined (DSP_BOOTMODE_NOBOOT)
	/* register the init ISR */
	HAL_intRegister (DSPLINK_INT_ID,
			DSPLINK_INT_VEC_ID,
			(Fxn) &HAL_initIsr,
			0);
#endif

#if !defined (DSP_BOOTMODE_NOBOOT)
	/* Initialize DSP/BIOS LINK. */
	DSPLINK_init();
	/* Get the size of the data buffer to be allocated for the RingIO. */
	RING_IO_dataBufSize1 = atoi(argv[0]);
	RING_IO_dataBufSize2 = atoi(argv[1]);

	/* Get the size of the attribute  buffer to be allocated for the RingIO.*/
	RING_IO_attrBufSize = atoi(argv[2]);

	/* Get the size of the footbuffer to be allocated for the RingIO. */
	RING_IO_footBufSize = atoi(argv[3]);
#else
	/* Get the size of the data buffer to be allocated for the RingIO. */
	RING_IO_dataBufSize1 = 10240;
	RING_IO_dataBufSize2 = 10240;
	/* Get the size of the attribute  buffer to be allocated for the RingIO.*/
	RING_IO_attrBufSize = 2048;

	/* Get the size of the footbuffer to be allocated for the RingIO. */
	RING_IO_footBufSize = 0;
#endif

	/* Create Phase */
	TSKRING_IO_create1(&info1);
	/* Create Phase */
	TSKRING_IO_create2(&info2);


	attrs.stacksize = 16384;

	/* Creating task for RING_IO application */
	//tskRingIoTask1 = TSK_create(tskRingIo1, NULL, 0);
	tskRingIoTask1 = TSK_create(tskRingIo1, &attrs, 0);
	if (tskRingIoTask1 != NULL) {
		LOG_printf(&trace, "Create RING_IO TSK1: Success\n");
	} else {
		LOG_printf(&trace, "Create RING_IO TSK1: Failed.\n");
	}

	/* Creating task for RING_IO application */
	//tskRingIoTask2 = TSK_create(tskRingIo2, NULL, 0);
	tskRingIoTask2 = TSK_create(tskRingIo2, &attrs, 0);
	if (tskRingIoTask2 != NULL) {
		LOG_printf(&trace, "Create RING_IO TSK2: Success\n");
	} else {
		LOG_printf(&trace, "Create RING_IO TSK2: Failed.\n");
	}

}