From 711a7998afc4a4a2aa54072afd0be59f33084d45 Mon Sep 17 00:00:00 2001 From: armink Date: Tue, 27 Dec 2016 19:05:10 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E3=80=90=E5=AE=8C=E5=96=84=E3=80=91S?= =?UTF-8?q?TM32F10X=20=E8=A3=B8=E6=9C=BA=20Demo=20=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- demo/non_os/stm32f10x/RVMDK/CmBacktrace.uvopt | 2 +- demo/non_os/stm32f10x/RVMDK/CmBacktrace.uvproj | 2 +- demo/non_os/stm32f10x/app/src/app.c | 6 +++--- demo/non_os/stm32f10x/components/others/bsp.c | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/demo/non_os/stm32f10x/RVMDK/CmBacktrace.uvopt b/demo/non_os/stm32f10x/RVMDK/CmBacktrace.uvopt index 65665ff..4858580 100644 --- a/demo/non_os/stm32f10x/RVMDK/CmBacktrace.uvopt +++ b/demo/non_os/stm32f10x/RVMDK/CmBacktrace.uvopt @@ -288,7 +288,7 @@ cm_backtrace - 1 + 0 0 0 0 diff --git a/demo/non_os/stm32f10x/RVMDK/CmBacktrace.uvproj b/demo/non_os/stm32f10x/RVMDK/CmBacktrace.uvproj index de0cf18..07eb813 100644 --- a/demo/non_os/stm32f10x/RVMDK/CmBacktrace.uvproj +++ b/demo/non_os/stm32f10x/RVMDK/CmBacktrace.uvproj @@ -48,7 +48,7 @@ CmBacktrace 1 0 - 1 + 0 1 1 .\Output\list\ diff --git a/demo/non_os/stm32f10x/app/src/app.c b/demo/non_os/stm32f10x/app/src/app.c index 65d4a36..fe84be7 100644 --- a/demo/non_os/stm32f10x/app/src/app.c +++ b/demo/non_os/stm32f10x/app/src/app.c @@ -19,12 +19,12 @@ int main(void){ // fault_test_by_unalign(); fault_test_by_div0(); - _continue = 0; - while(_continue == 0) { + _continue = 1; + while(_continue == 1) { LED_RUN_ON; delay(1000000); LED_RUN_OFF; - delay(1000000); + delay(1000000); } return 0; diff --git a/demo/non_os/stm32f10x/components/others/bsp.c b/demo/non_os/stm32f10x/components/others/bsp.c index 506d57a..1da9e84 100644 --- a/demo/non_os/stm32f10x/components/others/bsp.c +++ b/demo/non_os/stm32f10x/components/others/bsp.c @@ -7,6 +7,7 @@ #include #include +#include /* ********************************************************************************************************* @@ -88,8 +89,6 @@ static void GPIO_Configuration(void) GPIO_Init(GPIOF, &GPIO_InitStructure); GPIO_Init(GPIOG, &GPIO_InitStructure); - - /******************system run led*******************/ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; @@ -147,7 +146,6 @@ int fgetc(FILE *f) while(!(USART_GetFlagStatus(USART1, USART_FLAG_RXNE) == SET)) { } - return (USART_ReceiveData(USART1)); } @@ -157,6 +155,7 @@ void assert_failed(u8* file, u32 line) /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* Infinite loop */ + cm_backtrace_assert(__get_SP()); printf("assert failed at %s:%d \n", file, line); while (1) { }