센서보드 RF IRQ 테스트 중 and bug fix?
Fork of EV-COG-AD3029LZ by
Diff: source/libs/spirit1/SPIRIT1_Library/Src/SPIRIT_Types.c
- Revision:
- 84:45b9ff78a066
- Parent:
- 67:93bec0baf1de
- Child:
- 85:38de5ee78824
--- a/source/libs/spirit1/SPIRIT1_Library/Src/SPIRIT_Types.c Wed Mar 21 05:06:08 2018 +0000 +++ b/source/libs/spirit1/SPIRIT1_Library/Src/SPIRIT_Types.c Fri Jun 22 03:42:24 2018 +0000 @@ -41,6 +41,12 @@ #include "MCU_Interface.h" +//180621 HJM : init 재시작을 위한 카운팅 변수 +//static int iSpiritTypesErrorCounting = 0; +#define MAX_ERROR_COUNTING 10 +#define RETURN_ERROR_NUMBER 100 + + /** @addtogroup SPIRIT_Libraries * @{ */ @@ -126,15 +132,19 @@ * @param line assert_param error line source number * @retval : None */ -void s_assert_failed(uint8_t* file, uint32_t line) +int s_assert_failed(uint8_t* file, uint32_t line) { /* User can add his own implementation to report the file name and line number */ printf("Wrong parameters value: file %s on line %d\r\n", file, (int)line); /* Infinite loop */ - while (1) - { - } + //180621 HJM : 다시 init 하도록 수정 + //while (1) +// { +// } + return RETURN_ERROR_NUMBER; + + } #elif SPIRIT_USE_VCOM_ASSERT @@ -148,7 +158,7 @@ * @param expression: string representing the assert failed expression * @retval : None */ -void s_assert_failed(uint8_t* file, uint32_t line, char* expression) +int s_assert_failed(uint8_t* file, uint32_t line, char* expression) { printf("\n\rVCOM DEBUG: Incorrect parameter. Please reboot.\n\r"); @@ -156,9 +166,12 @@ printf("The expression %s returned FALSE.\n\r", expression); /* Infinite loop */ - while (1) - { - } + //180621 HJM : 다시 init 하도록 수정 + //while (1) +// { +// } + return RETURN_ERROR_NUMBER; + } #elif SPIRIT_USE_FRAME_ASSERT @@ -171,7 +184,7 @@ * @param expression: string representing the assert failed expression * @retval : None */ -void s_assert_failed(char* expression) +int s_assert_failed(char* expression) { char pcPayload[100]; uint16_t i; @@ -184,6 +197,7 @@ //sprintf(pcPayload, "The expression %s returned FALSE.\n\r", expression); SpiritNotifyAssertFailed(pcPayload); + return RETURN_ERROR_NUMBER; } #endif