Skip to content

Commit c4e0fc6

Browse files
authored
Merge pull request #7920 from li-ho/aducm3029_sys_return_code
Resolve duplicate ADuCM3029 system return code
2 parents 81d0948 + b57f902 commit c4e0fc6

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/TARGET_EV_COG_AD3029LZ/device/system_ADuCM3029.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ void adi_system_EnableISRAM(bool bEnable)
259259
* \n
260260
* \n false :To disable retention during the hibernation.
261261
* \n
262-
* @return : SUCCESS : Configured successfully.
263-
* FAILURE : For invalid bank.
262+
* @return : ADI_SYS_SUCCESS : Configured successfully.
263+
* ADI_SYS_FAILURE : For invalid bank.
264264
* @note: Please note that respective linker file need to support the configuration. Only BANK-1 and
265265
BANK-2 of SRAM is valid.
266266
*/
@@ -269,7 +269,7 @@ uint32_t adi_system_EnableRetention(ADI_SRAM_BANK eBank,bool bEnable)
269269
#ifdef ADI_DEBUG
270270
if((eBank != ADI_SRAM_BANK_1) && (eBank != ADI_SRAM_BANK_2))
271271
{
272-
return FAILURE;
272+
return ADI_SYS_FAILURE;
273273
}
274274
#endif
275275
pADI_PMG0->PWRKEY = PWRKEY_VALUE_KEY;
@@ -282,5 +282,5 @@ uint32_t adi_system_EnableRetention(ADI_SRAM_BANK eBank,bool bEnable)
282282
pADI_PMG0->SRAMRET &= ~((uint32_t)eBank >> 1);
283283
}
284284

285-
return SUCCESS;
285+
return ADI_SYS_SUCCESS;
286286
}

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/bsp/system_ADuCM3029.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ extern "C" {
4040
#endif /* __cplusplus */
4141

4242
/*! \cond PRIVATE */
43-
#define SUCCESS 0u
44-
45-
#define FAILURE 1u
43+
/*! System API function return codes */
44+
typedef enum
45+
{
46+
ADI_SYS_SUCCESS = 0, /*!< No error detected. */
47+
ADI_SYS_FAILURE, /*!< The API call failed. */
48+
} ADI_SYS_RESULT;
4649

4750
/* System clock constant */
4851
#define __HFOSC 26000000u

0 commit comments

Comments
 (0)