diff --git a/packages/ti/sdo/edma3/drv/sample/src/sample_arm_cs.c b/packages/ti/sdo/edma3/drv/sample/src/sample_arm_cs.c
* These implementations MUST be provided by the user / application, using the
* EDMA3 driver, for its correct functioning.
*
- * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2009 - 2019 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
*/
#include <ti/sysbios/hal/Cache.h>
+
#include <ti/sysbios/hal/Hwi.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sdo/edma3/drv/sample/bios6_edma3_drv_sample.h>
-extern unsigned int ccXferCompInt[][EDMA3_MAX_REGIONS];
-extern unsigned int ccErrorInt[];
-extern unsigned int tcErrorInt[][EDMA3_MAX_TC];
+extern uint32_t ccXferCompInt[EDMA3_MAX_EDMA3_INSTANCES][EDMA3_MAX_REGIONS];
+extern uint32_t ccErrorInt[EDMA3_MAX_EDMA3_INSTANCES];
+extern uint32_t tcErrorInt[EDMA3_MAX_EDMA3_INSTANCES][EDMA3_MAX_TC];
/**
* Shadow Region on which the executable is running. Its value is
* populated with the DSP Instance Number here in this case.
*/
-extern unsigned int region_id;
+extern uint32_t region_id;
/**
* \brief EDMA3 OS Protect Entry
* for EDMA3_OS_PROTECT_INTERRUPT protection level).
* \return None
*/
-void edma3OsProtectEntry (unsigned int edma3InstanceId,
- int level, unsigned int *intState)
+void edma3OsProtectEntry (uint32_t edma3InstanceId,
+ int32_t level, uint32_t *intState)
{
if (((level == EDMA3_OS_PROTECT_INTERRUPT)
|| (level == EDMA3_OS_PROTECT_INTERRUPT_TC_ERROR))
&& (intState == NULL))
{
- return;
+ /* Nothing to be done here */
}
else
{
/* Disable scheduler */
case EDMA3_OS_PROTECT_SCHEDULER :
- Task_disable();
+ Task_disable();
break;
/* Disable EDMA3 transfer completion interrupt only */
break;
}
}
+ return;
}
* for EDMA3_OS_PROTECT_INTERRUPT protection level).
* \return None
*/
-void edma3OsProtectExit (unsigned int edma3InstanceId,
- int level, unsigned int intState)
+void edma3OsProtectExit (uint32_t edma3InstanceId,
+ int32_t level, uint32_t intState)
{
switch (level)
{
/* Enable EDMA3 TC error interrupt only */
case EDMA3_OS_PROTECT_INTERRUPT_TC_ERROR :
- switch (intState)
+ switch ((int32_t)intState)
{
case 0:
case 1:
* may or may not require the below implementation and
* should modify it according to her need.
*/
-EDMA3_DRV_Result Edma3_CacheInvalidate(unsigned int mem_start_ptr,
- unsigned int num_bytes)
+EDMA3_DRV_Result Edma3_CacheInvalidate(uint32_t mem_start_ptr,
+ uint32_t num_bytes)
{
EDMA3_DRV_Result cacheInvResult = EDMA3_DRV_SOK;
/* Verify whether the start address is cache aligned or not */
- if((mem_start_ptr & (EDMA3_CACHE_LINE_SIZE_IN_BYTES-1u)) != 0)
+ if((mem_start_ptr & (EDMA3_CACHE_LINE_SIZE_IN_BYTES-1U)) != 0)
{
#ifdef EDMA3_DRV_DEBUG
EDMA3_DRV_PRINTF("\r\n Cache : Memory is not %d bytes alinged\r\n",
}
else
{
- Cache_inv((Ptr)mem_start_ptr, num_bytes, Cache_Type_ALL, TRUE);
+ Cache_inv((Ptr)mem_start_ptr, num_bytes, Cache_Type_ALL, (Bool)TRUE);
}
return cacheInvResult;
* may or may not require the below implementation and
* should modify it according to her need.
*/
-EDMA3_DRV_Result Edma3_CacheFlush(unsigned int mem_start_ptr,
- unsigned int num_bytes)
+EDMA3_DRV_Result Edma3_CacheFlush(uint32_t mem_start_ptr,
+ uint32_t num_bytes)
{
EDMA3_DRV_Result cacheFlushResult = EDMA3_DRV_SOK;
/* Verify whether the start address is cache aligned or not */
- if((mem_start_ptr & (EDMA3_CACHE_LINE_SIZE_IN_BYTES-1u)) != 0)
+ if((mem_start_ptr & (EDMA3_CACHE_LINE_SIZE_IN_BYTES-1U)) != 0)
{
#ifdef EDMA3_DRV_DEBUG
EDMA3_DRV_PRINTF("\r\n Cache : Memory is not %d bytes alinged\r\n",
}
else
{
- Cache_wb((Ptr)mem_start_ptr, num_bytes, Cache_Type_ALL, TRUE);
+ Cache_wb((Ptr)mem_start_ptr, num_bytes, Cache_Type_ALL, (Bool)TRUE);
}
return cacheFlushResult;
* semaphore
* \return EDMA3_DRV_SOK if succesful, else a suitable error code.
*/
-EDMA3_DRV_Result edma3OsSemCreate(int initVal,
+EDMA3_DRV_Result edma3OsSemCreate(int32_t initVal,
const Semaphore_Params *semParams,
EDMA3_OS_Sem_Handle *hSem)
{
* a free semaphore.
* \param hSem [IN] is the handle of the specified semaphore
* \param mSecTimeout [IN] is wait time in milliseconds
- * \return EDMA3_DRV_Result if successful else a suitable error code
+ * \return EDMA3_Result if successful else a suitable error code
*/
-EDMA3_DRV_Result edma3OsSemTake(EDMA3_OS_Sem_Handle hSem, int mSecTimeout)
+EDMA3_Result edma3OsSemTake(EDMA3_OS_Sem_Handle hSem, int32_t mSecTimeout)
{
- EDMA3_DRV_Result semTakeResult = EDMA3_DRV_SOK;
- unsigned short semPendResult;
+ EDMA3_Result semTakeResult = EDMA3_DRV_SOK;
if(NULL == hSem)
{
}
else
{
- semPendResult = Semaphore_pend(hSem, mSecTimeout);
- if (semPendResult == FALSE)
+ if((Semaphore_pend((Semaphore_Handle)hSem, (uint32_t)mSecTimeout)) == FALSE)
{
semTakeResult = EDMA3_DRV_E_SEMAPHORE;
}
* This function gives or relinquishes an already
* acquired semaphore token
* \param hSem [IN] is the handle of the specified semaphore
- * \return EDMA3_DRV_Result if successful else a suitable error code
+ * \return EDMA3_Result if successful else a suitable error code
*/
-EDMA3_DRV_Result edma3OsSemGive(EDMA3_OS_Sem_Handle hSem)
+EDMA3_Result edma3OsSemGive(EDMA3_OS_Sem_Handle hSem)
{
- EDMA3_DRV_Result semGiveResult = EDMA3_DRV_SOK;
+ EDMA3_Result semGiveResult = EDMA3_DRV_SOK;
if(NULL == hSem)
{
}
else
{
- Semaphore_post(hSem);
+ Semaphore_post((Semaphore_Handle)hSem);
}
return semGiveResult;