; generated by Component: ARM Compiler 5.06 update 7 (build 960) Tool: ArmCC [4d365d]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\output\cmp_analogwatchdog.o --asm_dir=..\List\ --list_dir=..\List\ --depend=..\output\cmp_analogwatchdog.d --cpu=Cortex-M0+ --apcs=interwork --diag_suppress=9931 -I..\FWLib\SC32F1XXX_Lib\inc -I..\User\HeadFiles -I..\User -I..\Drivers -I..\Apps -I..\CMSIS -IF:\Users\SOC\AppData\Local\Arm\Packs\ARM\CMSIS\5.8.0\Device\ARM\ARMCM0plus\Include -D__UVISION_VERSION=536 -DARMCM0P -DSC32f10xx --omf_browse=..\output\cmp_analogwatchdog.crf ..\Apps\CMP_AnalogWatchdog.c]
                          THUMB

                          AREA ||i.CMP_AnalogWatchdog_CMPHandler||, CODE, READONLY, ALIGN=2

                  CMP_AnalogWatchdog_CMPHandler PROC
;;;47     
;;;48     void CMP_AnalogWatchdog_CMPHandler(void)
000000  b510              PUSH     {r4,lr}
;;;49     {
;;;50       /* 发生了上升沿中断，复位 */
;;;51       if(CMP_GetFlagStatus(CMP, CMP_FLAG_IF)) //判断CMP标志位
000002  4c08              LDR      r4,|L1.36|
000004  2101              MOVS     r1,#1
000006  4620              MOV      r0,r4
000008  f7fffffe          BL       CMP_GetFlagStatus
00000c  2800              CMP      r0,#0
00000e  d008              BEQ      |L1.34|
;;;52       {
;;;53         CMP_ClearFlag(CMP, CMP_FLAG_IF); //清除CMP标志位
000010  2101              MOVS     r1,#1
000012  4620              MOV      r0,r4
000014  f7fffffe          BL       CMP_ClearFlag
;;;54         printf("CMP Analog Watchdog Reset!\r\n");
000018  a003              ADR      r0,|L1.40|
00001a  f7fffffe          BL       __2printf
;;;55         NVIC_SystemReset();
00001e  f7fffffe          BL       __NVIC_SystemReset
                  |L1.34|
;;;56       }
;;;57     }
000022  bd10              POP      {r4,pc}
;;;58     #endif
                          ENDP

                  |L1.36|
                          DCD      0x40022130
                  |L1.40|
000028  434d5020          DCB      "CMP Analog Watchdog Reset!\r\n",0
00002c  416e616c
000030  6f672057
000034  61746368
000038  646f6720
00003c  52657365
000040  74210d0a
000044  00      
000045  00                DCB      0
000046  00                DCB      0
000047  00                DCB      0

                          AREA ||i.CMP_AnalogWatchdog_Function||, CODE, READONLY, ALIGN=2

                  CMP_AnalogWatchdog_Function PROC
;;;13     
;;;14     void CMP_AnalogWatchdog_Function(void)
000000  b51c              PUSH     {r2-r4,lr}
;;;15     {
;;;16       volatile uint16_t CMP_Value;
;;;17       CMP_InitTypeDef CMP_InitStruct; //定义CMP初始化结构体变量
;;;18     
;;;19       RCC_APB2Cmd(ENABLE);  //CMP外设挂载在APB2时钟上
000002  2001              MOVS     r0,#1
000004  f7fffffe          BL       RCC_APB2Cmd
;;;20       CMP_Cmd(CMP, ENABLE);	//使能CMP；
000008  4c13              LDR      r4,|L2.88|
00000a  2101              MOVS     r1,#1
00000c  4620              MOV      r0,r4
00000e  f7fffffe          BL       CMP_Cmd
;;;21     
;;;22       /* 配置正负端输入，CMP中断触发条件为 VDD < 1.5V/10*16 = 2.4V */
;;;23       CMP_InitStruct.CMP_Negative = CMP_Negative_10D16VDD;  //CMP负端为10/16 VDD
000012  2105              MOVS     r1,#5
000014  0249              LSLS     r1,r1,#9
000016  4668              MOV      r0,sp
000018  8001              STRH     r1,[r0,#0]
;;;24     #if defined(SC32f10xx) 
;;;25       CMP_InitStruct.CMP_Positive = CMP_Positive_1_5V;  //CMP正端为内部1.5V基准源
00001a  2110              MOVS     r1,#0x10
00001c  8041              STRH     r1,[r0,#2]
;;;26     #elif defined(SC32f12xx)
;;;27       CMP_InitStruct.CMP_Positive = CMP_Positive_1_6V;  //CMP正端为内部1.6V基准源	
;;;28     #endif
;;;29       CMP_InitStruct.CMP_TriggerMode = CMP_TriggerMode_RISE; //VDD变小时，正端向大于负端趋势变化，上升沿
00001e  2120              MOVS     r1,#0x20
000020  8081              STRH     r1,[r0,#4]
;;;30     
;;;31       CMP_Init(CMP, &CMP_InitStruct); //根据结构体标志位配置CMP
000022  4669              MOV      r1,sp
000024  4620              MOV      r0,r4
000026  f7fffffe          BL       CMP_Init
;;;32     
;;;33       CMP_ClearFlag(CMP, CMP_FLAG_IF); //清除CMP标志位
00002a  2101              MOVS     r1,#1
00002c  4620              MOV      r0,r4
00002e  f7fffffe          BL       CMP_ClearFlag
000032  2101              MOVS     r1,#1
000034  4809              LDR      r0,|L2.92|
000036  0789              LSLS     r1,r1,#30
000038  6001              STR      r1,[r0,#0]
;;;34     
;;;35       NVIC_EnableIRQ(CMP_IRQn);
;;;36     
;;;37       printf("CMP Analog Watchdog Initialization successful!\r\n");
00003a  a009              ADR      r0,|L2.96|
00003c  f7fffffe          BL       __2printf
;;;38       /* 判断初始状态正端是否已大于负端，如果是则直接复位 */
;;;39       if(CMP_GetCMPSTA(CMP) == CMP_CMPSTA_High)
000040  4620              MOV      r0,r4
000042  f7fffffe          BL       CMP_GetCMPSTA
000046  2802              CMP      r0,#2
000048  d000              BEQ      |L2.76|
                  |L2.74|
;;;40       {
;;;41         printf("CMP Analog Watchdog Reset!\r\n");
;;;42         NVIC_SystemReset();
;;;43       }
;;;44     
;;;45       while(1);
00004a  e7fe              B        |L2.74|
                  |L2.76|
00004c  a011              ADR      r0,|L2.148|
00004e  f7fffffe          BL       __2printf
000052  f7fffffe          BL       __NVIC_SystemReset
;;;46     }
;;;47     
                          ENDP

000056  0000              DCW      0x0000
                  |L2.88|
                          DCD      0x40022130
                  |L2.92|
                          DCD      0xe000e100
                  |L2.96|
000060  434d5020          DCB      "CMP Analog Watchdog Initialization successful!\r\n",0
000064  416e616c
000068  6f672057
00006c  61746368
000070  646f6720
000074  496e6974
000078  69616c69
00007c  7a617469
000080  6f6e2073
000084  75636365
000088  73736675
00008c  6c210d0a
000090  00      
000091  00                DCB      0
000092  00                DCB      0
000093  00                DCB      0
                  |L2.148|
000094  434d5020          DCB      "CMP Analog Watchdog Reset!\r\n",0
000098  416e616c
00009c  6f672057
0000a0  61746368
0000a4  646f6720
0000a8  52657365
0000ac  74210d0a
0000b0  00      
0000b1  00                DCB      0
0000b2  00                DCB      0
0000b3  00                DCB      0

                          AREA ||i.__NVIC_SystemReset||, CODE, READONLY, ALIGN=2

                  __NVIC_SystemReset PROC
;;;982     */
;;;983    __NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
000000  f3bf8f4f          DSB      
;;;984    {
;;;985      __DSB();                                                          /* Ensure all outstanding memory accesses included
;;;986                                                                           buffered write are completed before reset */
;;;987      SCB->AIRCR  = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
000004  4904              LDR      r1,|L3.24|
000006  4803              LDR      r0,|L3.20|
000008  60c8              STR      r0,[r1,#0xc]
;;;988                     SCB_AIRCR_SYSRESETREQ_Msk);
;;;989      __DSB();                                                          /* Ensure completion of memory access */
00000a  f3bf8f4f          DSB      
                  |L3.14|
;;;990    
;;;991      for(;;)                                                           /* wait until reset */
;;;992      {
;;;993        __NOP();
00000e  bf00              NOP      
000010  e7fd              B        |L3.14|
;;;994      }
;;;995    }
;;;996    
                          ENDP

000012  0000              DCW      0x0000
                  |L3.20|
                          DCD      0x05fa0004
                  |L3.24|
                          DCD      0xe000ed00

;*** Start embedded assembler ***

#line 1 "..\\Apps\\CMP_AnalogWatchdog.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___20_CMP_AnalogWatchdog_c_c2d0c57d____REV16|
#line 463 "..\\CMSIS\\cmsis_armcc.h"
|__asm___20_CMP_AnalogWatchdog_c_c2d0c57d____REV16| PROC
#line 464

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___20_CMP_AnalogWatchdog_c_c2d0c57d____REVSH|
#line 478
|__asm___20_CMP_AnalogWatchdog_c_c2d0c57d____REVSH| PROC
#line 479

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
