示例#1
0
/*!
 * \brief	Start an initialized task running.
 * \param	taskId	Task handle passed back from a successful TaskSetup()
 * \param	autoStartEnable Boolean for whether autostart bit is enabled.
 *							If this is set then the parameter autoStartTask
 *							defines the task to auto start.
 * \param	autoStartTask	TaskId for task to autostart. If autoStartEnable
 *							is not set then this parameter is a don't care.
 * \param	intrEnable		Boolean for interrupt enable for this task.
 * \returns	TASK_ERR_NO_ERR on success or TASK_ERR_INVALID_ARG if taskId
 *			is invalid.
 */
int TaskStart(TaskId taskId, uint32 autoStartEnable, TaskId autoStartTask,
			  uint32 intrEnable)
{
	if (intrEnable) {
		SDMA_INT_ENABLE(SDMA_INT_MASK, taskId);
	} else {
		SDMA_INT_DISABLE(SDMA_INT_MASK, taskId);
	}
	SDMA_TASK_AUTO_START(SDMA_TCR, taskId, autoStartEnable, autoStartTask)
	SDMA_TASK_ENABLE(SDMA_TCR, taskId);

	TaskRunning[taskId] = 1;
	return TASK_ERR_NO_ERR;
}
示例#2
0
/*!
 * \brief	Start an initialized task running.
 * \param	taskId	Task handle passed back from a successful TaskSetup()
 * \param	autoStartEnable Boolean for whether autostart bit is enabled.
 *							If this is set then the parameter autoStartTask
 *							defines the task to auto start.
 * \param	autoStartTask	TaskId for task to autostart. If autoStartEnable
 *							is not set then this parameter is a don't care.
 * \param	intrEnable		Boolean for interrupt enable for this task.
 * \returns	TASK_ERR_NO_ERR on success or TASK_ERR_INVALID_ARG if taskId
 *			is invalid.
 */
int TaskStart( TaskId taskId, uint32 autoStartEnable, TaskId autoStartTask,
						uint32 intrEnable  )
{
	if( (0 <= taskId) && (taskId < MAX_TASKS) ) {
		if ( intrEnable ) {
			SDMA_INT_ENABLE( SDMA_INT_MASK, taskId );
		}
		else {
			SDMA_INT_DISABLE( SDMA_INT_MASK, taskId );
		}
		SDMA_TASK_AUTO_START(SDMA_TCR, taskId, autoStartEnable, autoStartTask)
		SDMA_TASK_ENABLE( SDMA_TCR, taskId );
		return TASK_ERR_NO_ERR;
	} else {
		return TASK_ERR_INVALID_ARG;
	}
}