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

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

                  TIM_CounterBase_Function PROC
;;;13     
;;;14     void TIM_CounterBase_Function(void)
000000  b50e              PUSH     {r1-r3,lr}
;;;15     {
;;;16       TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStruct;
;;;17       
;;;18       /* 使能TIM1时钟 */
;;;19       RCC_APB0Cmd(ENABLE);
000002  2001              MOVS     r0,#1
000004  f7fffffe          BL       RCC_APB0Cmd
;;;20       RCC_APB0PeriphClockCmd(RCC_APB0Periph_TIM1,ENABLE);
000008  2101              MOVS     r1,#1
00000a  2002              MOVS     r0,#2
00000c  f7fffffe          BL       RCC_APB0PeriphClockCmd
;;;21       
;;;22       /* TIM配置结构体初始化 */
;;;23       TIM_TimeBaseStructInit(&TIM_TimeBaseInitStruct);
000010  4668              MOV      r0,sp
000012  f7fffffe          BL       TIM_TimeBaseStructInit
;;;24       
;;;25       /* 设置TIM配置结构体 */
;;;26       TIM_TimeBaseInitStruct.TIM_CounterMode = TIM_CounterMode_Up;	//TIM工作在向上计数模式
000016  2000              MOVS     r0,#0
000018  466a              MOV      r2,sp
00001a  8090              STRH     r0,[r2,#4]
;;;27       TIM_TimeBaseInitStruct.TIM_EXENX = TIM_EXENX_Disable;	//外部重加载管脚失能
;;;28       TIM_TimeBaseInitStruct.TIM_Preload = 65535-10;	//每计数10次触发一次TIM溢出中断
00001c  210a              MOVS     r1,#0xa
00001e  80d0              STRH     r0,[r2,#6]            ;27
000020  43c9              MVNS     r1,r1
000022  8111              STRH     r1,[r2,#8]
;;;29       TIM_TimeBaseInitStruct.TIM_Prescaler = TIM_PRESCALER_1;	//TIM分频为1分频
000024  8010              STRH     r0,[r2,#0]
;;;30       TIM_TimeBaseInitStruct.TIM_WorkMode = TIM_WorkMode_Counter;	//TIM工作在计数器模式
000026  2002              MOVS     r0,#2
;;;31       
;;;32       /* TIM时基配置 */
;;;33       TIM_TIMBaseInit(TIM1,&TIM_TimeBaseInitStruct);
000028  4c09              LDR      r4,|L1.80|
00002a  8050              STRH     r0,[r2,#2]            ;30
00002c  4669              MOV      r1,sp
00002e  4620              MOV      r0,r4
000030  f7fffffe          BL       TIM_TIMBaseInit
;;;34       
;;;35       /* 使能TIM1中断 */
;;;36       TIM_ITConfig(TIM1,TIM_IT_TI | TIM_IT_INTEN,ENABLE);
000034  2201              MOVS     r2,#1
000036  2103              MOVS     r1,#3
000038  4620              MOV      r0,r4
00003a  f7fffffe          BL       TIM_ITConfig
00003e  2101              MOVS     r1,#1
000040  4a04              LDR      r2,|L1.84|
000042  0409              LSLS     r1,r1,#16
000044  6011              STR      r1,[r2,#0]
;;;37       NVIC_EnableIRQ(TIMER1_IRQn);
;;;38       
;;;39       /* TIM外设初始化 */
;;;40       TIM_Cmd(TIM1,ENABLE);
000046  2101              MOVS     r1,#1
000048  4620              MOV      r0,r4
00004a  f7fffffe          BL       TIM_Cmd
                  |L1.78|
;;;41       
;;;42       while(1);
00004e  e7fe              B        |L1.78|
;;;43     }
;;;44     
                          ENDP

                  |L1.80|
                          DCD      0x40020140
                  |L1.84|
                          DCD      0xe000e100

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

                  TIM_CounterBase_TIM1Handler PROC
;;;44     
;;;45     void TIM_CounterBase_TIM1Handler(void)
000000  b510              PUSH     {r4,lr}
;;;46     {
;;;47       /* 判断TIM1中断是否置起 */
;;;48       if(TIM_GetFlagStatus(TIM1,TIM_Flag_TI) == SET)
000002  4c07              LDR      r4,|L2.32|
000004  2101              MOVS     r1,#1
000006  4620              MOV      r0,r4
000008  f7fffffe          BL       TIM_GetFlagStatus
00000c  2801              CMP      r0,#1
00000e  d106              BNE      |L2.30|
;;;49       {
;;;50         TIM_ClearFlag(TIM1,TIM_Flag_TI);	//清除TIM1中断
000010  2101              MOVS     r1,#1
000012  4620              MOV      r0,r4
000014  f7fffffe          BL       TIM_ClearFlag
;;;51         printf("TIM In\r\n");
000018  a002              ADR      r0,|L2.36|
00001a  f7fffffe          BL       __2printf
                  |L2.30|
;;;52       }
;;;53     }
00001e  bd10              POP      {r4,pc}
                          ENDP

                  |L2.32|
                          DCD      0x40020140
                  |L2.36|
000024  54494d20          DCB      "TIM In\r\n",0
000028  496e0d0a
00002c  00      
00002d  00                DCB      0
00002e  00                DCB      0
00002f  00                DCB      0

;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
