/*! * \brief Stop a running task. * \param taskId Task handle passed back from a successful TaskSetup() * \returns TASK_ERR_NO_ERR on success or TASK_ERR_INVALID_ARG if taskId * is invalid. * * \em Note: Stopping a polling buffer descriptor task is a catastrophic * operation. It does not merely pause execution. Context is not * saved. The task's pointer into the BD ring is reset back to the * beginning. * * \em Note: This is not the case for the new "fall-through" BD tasks. * They save the BD ring pointer across stop/start boundaries. The * previous polling tasks are considered deprecated. */ int TaskStop(TaskId taskId) { SDMA_INT_DISABLE(SDMA_INT_MASK, taskId); SDMA_TASK_DISABLE(SDMA_TCR, taskId); TaskRunning[taskId] = 0; return TASK_ERR_NO_ERR; }
/*! * \brief Stop a running task. * \param taskId Task handle passed back from a successful TaskSetup() * \returns TASK_ERR_NO_ERR on success or TASK_ERR_INVALID_ARG if taskId * is invalid. * * Stopping a task is a catastrophic operation. It does not merely * pause execution. Context is not saved. Any buffer descriptors are * cleared. This should be called, e.g., when a device driver is stopped. */ int TaskStop( TaskId taskId ) { if( (taskId < 0) || (taskId >= MAX_TASKS) ) { return TASK_ERR_INVALID_ARG; } SDMA_INT_DISABLE( SDMA_INT_MASK, taskId ); SDMA_TASK_DISABLE( SDMA_TCR, taskId ); BDHead[taskId] = BDTail[taskId] = 0; (TaskBDIdxTable[taskId].currBDInUse) = 0; return TASK_ERR_NO_ERR; }