; generated by Component: ARM Compiler 5.05 update 1 (build 106) Tool: ArmCC [4d0efa]
; 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 -ID:\Keil5\ARM\Pack\Keil\SC32F10xx_DFP\1.0.0\Device\SC32F10xx\FWLib\SC32_Lib\inc -ID:\Keil5\ARM\Pack\Keil\SC32F10xx_DFP\1.0.0\Device\SH32F2xx\Include -D__UVISION_VERSION=538 -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
;;;51     
;;;52     void CMP_Interrupt_CMPHandler(void)
000000  b510              PUSH     {r4,lr}
;;;53     {
;;;54       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|
;;;55       {
;;;56         CMP_ClearFlag(CMP,CMP_FLAG_IF);  //CMP־λ
000010  2101              MOVS     r1,#1
000012  4620              MOV      r0,r4
000014  f7fffffe          BL       CMP_ClearFlag
;;;57     		
;;;58     		if(CMP_GetCMPSTA(CMP) == CMP_CMPSTA_High)	//ж
000018  4620              MOV      r0,r4
00001a  f7fffffe          BL       CMP_GetCMPSTA
;;;59     		{
;;;60     			CMP_Flag = 1;
00001e  4905              LDR      r1,|L1.52|
000020  2802              CMP      r0,#2                 ;58
000022  d002              BEQ      |L1.42|
;;;61     		}
;;;62     		else	//½ж
;;;63     		{
;;;64     			CMP_Flag = 2;
000024  2002              MOVS     r0,#2
                  |L1.38|
000026  7008              STRB     r0,[r1,#0]
                  |L1.40|
;;;65     		}
;;;66       }
;;;67     }
000028  bd10              POP      {r4,pc}
                  |L1.42|
00002a  2001              MOVS     r0,#1                 ;60
00002c  e7fb              B        |L1.38|
                          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
;;;13     
;;;14     void CMP_Interrupt_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);  //CMPAPB2ʱ
000002  2001              MOVS     r0,#1
000004  f7fffffe          BL       RCC_APB2Cmd
;;;20     
;;;21       CMP_InitStruct.CMP_Negative = CMP_Negative_5D16VDD;  //CMPΪ5/16 VDD
000008  2005              MOVS     r0,#5
00000a  0200              LSLS     r0,r0,#8
00000c  4669              MOV      r1,sp
00000e  8008              STRH     r0,[r1,#0]
;;;22       CMP_InitStruct.CMP_Positive = CMP_Positive_CMP0;  //CMPΪCMP0ܽ
000010  2500              MOVS     r5,#0
000012  804d              STRH     r5,[r1,#2]
;;;23       CMP_InitStruct.CMP_TriggerMode = CMP_TriggerMode_RISE_FALL; //غ½ضܴCMP־λ
000014  2060              MOVS     r0,#0x60
;;;24       CMP_Init(CMP, &CMP_InitStruct); //ݽṹ־λCMP
000016  4c0e              LDR      r4,|L2.80|
000018  8088              STRH     r0,[r1,#4]            ;23
00001a  4620              MOV      r0,r4
00001c  f7fffffe          BL       CMP_Init
000020  2101              MOVS     r1,#1
000022  4a0c              LDR      r2,|L2.84|
000024  0789              LSLS     r1,r1,#30
000026  6011              STR      r1,[r2,#0]
;;;25     	
;;;26     	NVIC_EnableIRQ(CMP_IRQn);//ʹCMPж
;;;27     	
;;;28     	CMP_Cmd(CMP,ENABLE);	//ʹCMP
000028  2101              MOVS     r1,#1
00002a  4620              MOV      r0,r4
00002c  f7fffffe          BL       CMP_Cmd
;;;29     
;;;30     	while(1)
;;;31     	{
;;;32     		if(CMP_Flag == 1)
000030  4c09              LDR      r4,|L2.88|
                  |L2.50|
000032  7820              LDRB     r0,[r4,#0]  ; CMP_Flag
000034  2801              CMP      r0,#1
000036  d007              BEQ      |L2.72|
;;;33     		{
;;;34     			CMP_Flag = 0;
;;;35     			printf("Comparator triggers a rising edge interrupt~\r\n");
;;;36     		}
;;;37     		else if(CMP_Flag == 2)
000038  7820              LDRB     r0,[r4,#0]  ; CMP_Flag
00003a  2802              CMP      r0,#2
00003c  d1f9              BNE      |L2.50|
;;;38     		{
;;;39     			CMP_Flag = 0;
00003e  7025              STRB     r5,[r4,#0]
;;;40     			printf("Comparator triggers a falling edge interrupt~\r\n");
000040  a006              ADR      r0,|L2.92|
                  |L2.66|
000042  f7fffffe          BL       __2printf
000046  e7f4              B        |L2.50|
                  |L2.72|
000048  7025              STRB     r5,[r4,#0]            ;34
00004a  a010              ADR      r0,|L2.140|
00004c  e7f9              B        |L2.66|
;;;41     		}
;;;42     
;;;43     /*  //CMP/޸	
;;;44     		uint16_t delay=10000;
;;;45     		while(delay--);
;;;46     		CMP_SetPositiveChannel(CMP,CMP_Positive_CMP3);//CMPΪCMP3
;;;47     		CMP_SetNegativeChannel(CMP,CMP_Negative_1D16VDD);//CMPΪ12/16 VDD
;;;48     */		
;;;49     	}
;;;50     }
;;;51     
                          ENDP

00004e  0000              DCW      0x0000
                  |L2.80|
                          DCD      0x40022130
                  |L2.84|
                          DCD      0xe000e100
                  |L2.88|
                          DCD      ||.data||
                  |L2.92|
00005c  436f6d70          DCB      "Comparator triggers a falling edge interrupt~\r\n",0
000060  61726174
000064  6f722074
000068  72696767
00006c  65727320
000070  61206661
000074  6c6c696e
000078  67206564
00007c  67652069
000080  6e746572
000084  72757074
000088  7e0d0a00
                  |L2.140|
00008c  436f6d70          DCB      "Comparator triggers a rising edge interrupt~\r\n",0
000090  61726174
000094  6f722074
000098  72696767
00009c  65727320
0000a0  61207269
0000a4  73696e67
0000a8  20656467
0000ac  6520696e
0000b0  74657272
0000b4  7570747e
0000b8  0d0a00  
0000bb  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 ***
