; 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_interrupt.o --asm_dir=..\List\ --list_dir=..\List\ --depend=..\output\cmp_interrupt.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_interrupt.crf ..\Apps\CMP_Interrupt.c]
                          THUMB

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

                  CMP_Interrupt_CMPHandler PROC
;;;61     #if defined(SC32f10xx)||defined(SC32f12xx)
;;;62     void CMP_Interrupt_CMPHandler(void)
000000  b510              PUSH     {r4,lr}
;;;63     {
;;;64       if(CMP_GetFlagStatus(CMP,CMP_FLAG_IF)) //判断CMP标志位
000002  4c0b              LDR      r4,|L1.48|
000004  2101              MOVS     r1,#1
000006  4620              MOV      r0,r4
000008  f7fffffe          BL       CMP_GetFlagStatus
00000c  2800              CMP      r0,#0
00000e  d00b              BEQ      |L1.40|
;;;65       {
;;;66         CMP_ClearFlag(CMP,CMP_FLAG_IF);  //清除CMP标志位
000010  2101              MOVS     r1,#1
000012  4620              MOV      r0,r4
000014  f7fffffe          BL       CMP_ClearFlag
;;;67         
;;;68         if(CMP_GetCMPSTA(CMP) == CMP_CMPSTA_High)	//触发的是上升沿中断
000018  4620              MOV      r0,r4
00001a  f7fffffe          BL       CMP_GetCMPSTA
;;;69         {
;;;70           CMP_Flag = 1;
00001e  4905              LDR      r1,|L1.52|
000020  2802              CMP      r0,#2                 ;68
000022  d002              BEQ      |L1.42|
;;;71         }
;;;72         else	//触发的是下降沿中断
;;;73         {
;;;74           CMP_Flag = 2;
000024  2002              MOVS     r0,#2
                  |L1.38|
000026  7008              STRB     r0,[r1,#0]
                  |L1.40|
;;;75         }
;;;76       }
;;;77     }
000028  bd10              POP      {r4,pc}
                  |L1.42|
00002a  2001              MOVS     r0,#1                 ;70
00002c  e7fb              B        |L1.38|
;;;78     
                          ENDP

00002e  0000              DCW      0x0000
                  |L1.48|
                          DCD      0x40022130
                  |L1.52|
                          DCD      ||.data||

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

                  CMP_Interrupt_Function PROC
;;;14     #endif
;;;15     void CMP_Interrupt_Function(void)
000000  b51f              PUSH     {r0-r4,lr}
;;;16     {
;;;17     #if defined(SC32f10xx)||defined(SC32f12xx)
;;;18     
;;;19       volatile uint16_t CMP_Value;
;;;20       CMP_InitTypeDef CMP_InitStruct; //定义CMP初始化结构体变量
;;;21       GPIO_InitTypeDef GPIO_InitStruct; //定义GPIO初始化结构体变量，定义为外部中断前需要将IO口设置为上拉输入
;;;22       
;;;23       RCC_APB2Cmd(ENABLE);  //CMP外设挂载在APB2时钟上
000002  2001              MOVS     r0,#1
000004  f7fffffe          BL       RCC_APB2Cmd
;;;24     #if defined(SC32f12xx)
;;;25     //PA5设置为上升沿中断
;;;26       GPIO_InitStruct.GPIO_Pin = GPIO_Pin_5;
;;;27       GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_PU;
;;;28       GPIO_Init(GPIOA, &GPIO_InitStruct);
;;;29     #elif  defined(SC32f10xx)
;;;30     //PA5设置为上升沿中断
;;;31       GPIO_InitStruct.GPIO_Pin = GPIO_Pin_0;
000008  2001              MOVS     r0,#1
00000a  4669              MOV      r1,sp
00000c  8108              STRH     r0,[r1,#8]
;;;32       GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_PU;
00000e  8148              STRH     r0,[r1,#0xa]
;;;33       GPIO_Init(GPIOA, &GPIO_InitStruct);	
000010  a902              ADD      r1,sp,#8
000012  4813              LDR      r0,|L2.96|
000014  f7fffffe          BL       GPIO_Init
;;;34     
;;;35     #endif
;;;36       CMP_InitStruct.CMP_Negative = CMP_Negative_5D16VDD;  //CMP负端为5/16 VDD
000018  2005              MOVS     r0,#5
00001a  0200              LSLS     r0,r0,#8
00001c  4669              MOV      r1,sp
00001e  8008              STRH     r0,[r1,#0]
;;;37       CMP_InitStruct.CMP_Positive = CMP_Positive_CMP0;  //CMP正端为CMP0输入管脚
000020  2500              MOVS     r5,#0
000022  804d              STRH     r5,[r1,#2]
;;;38       CMP_InitStruct.CMP_TriggerMode = CMP_TriggerMode_RISE_FALL; //上升沿和下降沿都能触发CMP标志位置起
000024  2060              MOVS     r0,#0x60
;;;39     
;;;40       CMP_Init(CMP, &CMP_InitStruct); //根据结构体标志位配置CMP
000026  4c0f              LDR      r4,|L2.100|
000028  8088              STRH     r0,[r1,#4]            ;38
00002a  4620              MOV      r0,r4
00002c  f7fffffe          BL       CMP_Init
000030  2101              MOVS     r1,#1
000032  4a0d              LDR      r2,|L2.104|
000034  0789              LSLS     r1,r1,#30
000036  6011              STR      r1,[r2,#0]
;;;41     	
;;;42       NVIC_EnableIRQ(CMP_IRQn);
;;;43       CMP_Cmd(CMP,ENABLE);	//使能CMP；
000038  2101              MOVS     r1,#1
00003a  4620              MOV      r0,r4
00003c  f7fffffe          BL       CMP_Cmd
;;;44       
;;;45       while(1)
;;;46       {
;;;47         if(CMP_Flag == 1)
000040  4c0a              LDR      r4,|L2.108|
                  |L2.66|
000042  7820              LDRB     r0,[r4,#0]  ; CMP_Flag
000044  2801              CMP      r0,#1
000046  d007              BEQ      |L2.88|
;;;48         {
;;;49           CMP_Flag = 0;
;;;50           printf("Comparator triggers a rising edge interrupt~\r\n");
;;;51         }
;;;52         else if(CMP_Flag == 2)
000048  7820              LDRB     r0,[r4,#0]  ; CMP_Flag
00004a  2802              CMP      r0,#2
00004c  d1f9              BNE      |L2.66|
;;;53         {
;;;54           CMP_Flag = 0;
00004e  7025              STRB     r5,[r4,#0]
;;;55           printf("Comparator triggers a falling edge interrupt~\r\n");
000050  a007              ADR      r0,|L2.112|
                  |L2.82|
000052  f7fffffe          BL       __2printf
000056  e7f4              B        |L2.66|
                  |L2.88|
000058  7025              STRB     r5,[r4,#0]            ;49
00005a  a011              ADR      r0,|L2.160|
00005c  e7f9              B        |L2.82|
;;;56         }
;;;57       }
;;;58     
;;;59     #endif
;;;60     }
;;;61     #if defined(SC32f10xx)||defined(SC32f12xx)
                          ENDP

00005e  0000              DCW      0x0000
                  |L2.96|
                          DCD      0x40011000
                  |L2.100|
                          DCD      0x40022130
                  |L2.104|
                          DCD      0xe000e100
                  |L2.108|
                          DCD      ||.data||
                  |L2.112|
000070  436f6d70          DCB      "Comparator triggers a falling edge interrupt~\r\n",0
000074  61726174
000078  6f722074
00007c  72696767
000080  65727320
000084  61206661
000088  6c6c696e
00008c  67206564
000090  67652069
000094  6e746572
000098  72757074
00009c  7e0d0a00
                  |L2.160|
0000a0  436f6d70          DCB      "Comparator triggers a rising edge interrupt~\r\n",0
0000a4  61726174
0000a8  6f722074
0000ac  72696767
0000b0  65727320
0000b4  61207269
0000b8  73696e67
0000bc  20656467
0000c0  6520696e
0000c4  74657272
0000c8  7570747e
0000cc  0d0a00  
0000cf  00                DCB      0

                          AREA ||.data||, DATA, ALIGN=0

                  CMP_Flag
000000  00                DCB      0x00

;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
