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

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

                  TIM_TimeBase_Function PROC
;;;14     
;;;15     void TIM_TimeBase_Function(void)
000000  b50e              PUSH     {r1-r3,lr}
;;;16     {
;;;17       TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStruct;
;;;18     
;;;19       /* 使能TIM0时钟 */
;;;20       RCC_APB0Cmd(ENABLE);
000002  2001              MOVS     r0,#1
000004  f7fffffe          BL       RCC_APB0Cmd
;;;21       RCC_APB0PeriphClockCmd(RCC_APB0Periph_TIM0, ENABLE);
000008  2101              MOVS     r1,#1
00000a  4608              MOV      r0,r1
00000c  f7fffffe          BL       RCC_APB0PeriphClockCmd
;;;22     
;;;23       /* TIM配置结构体初始化 */
;;;24       TIM_TimeBaseStructInit(&TIM_TimeBaseInitStruct);
000010  4668              MOV      r0,sp
000012  f7fffffe          BL       TIM_TimeBaseStructInit
;;;25     
;;;26       /* 设置TIM配置结构体 */
;;;27       TIM_TimeBaseInitStruct.TIM_CounterMode = TIM_CounterMode_Up;	//TIM工作在向上计数模式
000016  2400              MOVS     r4,#0
000018  4669              MOV      r1,sp
00001a  808c              STRH     r4,[r1,#4]
;;;28       TIM_TimeBaseInitStruct.TIM_EXENX = TIM_EXENX_Disable;	//外部重加载管脚失能
00001c  80cc              STRH     r4,[r1,#6]
;;;29     #if defined(SC32f10xx)||defined(SC32f12xx)
;;;30       TIM_TimeBaseInitStruct.TIM_Preload = 65535 - (32000000 / 1000);	//设置TIM的定时器评论为1000Hz@APB0Clock=32M
00001e  4810              LDR      r0,|L1.96|
000020  8108              STRH     r0,[r1,#8]
;;;31     #endif
;;;32       TIM_TimeBaseInitStruct.TIM_Prescaler = TIM_PRESCALER_1;	//TIM分频为1分频
;;;33       TIM_TimeBaseInitStruct.TIM_WorkMode = TIM_WorkMode_Timer;	//TIM工作在定时器模式，时钟源为APB0时钟
;;;34     
;;;35       /* TIM时基配置 */
;;;36       TIM_TIMBaseInit(TIM0, &TIM_TimeBaseInitStruct);
000022  4d10              LDR      r5,|L1.100|
000024  800c              STRH     r4,[r1,#0]            ;32
000026  804c              STRH     r4,[r1,#2]            ;33
000028  4628              MOV      r0,r5
00002a  f7fffffe          BL       TIM_TIMBaseInit
;;;37     
;;;38       /* 使能TIM0中断 */
;;;39       TIM_ITConfig(TIM0, TIM_IT_TI | TIM_IT_INTEN, ENABLE);
00002e  2201              MOVS     r2,#1
000030  2103              MOVS     r1,#3
000032  4628              MOV      r0,r5
000034  f7fffffe          BL       TIM_ITConfig
000038  2101              MOVS     r1,#1
00003a  4a0b              LDR      r2,|L1.104|
00003c  03c9              LSLS     r1,r1,#15
00003e  6011              STR      r1,[r2,#0]
;;;40       NVIC_EnableIRQ(TIMER0_IRQn);
;;;41     
;;;42       /* TIM外设初始化 */
;;;43       TIM_Cmd(TIM0, ENABLE);
000040  2101              MOVS     r1,#1
000042  4628              MOV      r0,r5
000044  f7fffffe          BL       TIM_Cmd
;;;44     
;;;45       while(1)
;;;46       {
;;;47         if(TIM_BaseCnt >= 500)
000048  26ff              MOVS     r6,#0xff
00004a  4d08              LDR      r5,|L1.108|
00004c  36f5              ADDS     r6,r6,#0xf5
                  |L1.78|
00004e  8828              LDRH     r0,[r5,#0]  ; TIM_BaseCnt
000050  42b0              CMP      r0,r6
000052  d3fc              BCC      |L1.78|
;;;48         {
;;;49           TIM_BaseCnt = 0;
000054  802c              STRH     r4,[r5,#0]
;;;50           printf("TIM interrupt has been triggered 500 times.\r\n");
000056  a006              ADR      r0,|L1.112|
000058  f7fffffe          BL       __2printf
00005c  e7f7              B        |L1.78|
;;;51         }
;;;52       }
;;;53     }
;;;54     
                          ENDP

00005e  0000              DCW      0x0000
                  |L1.96|
                          DCD      0x000082ff
                  |L1.100|
                          DCD      0x40020100
                  |L1.104|
                          DCD      0xe000e100
                  |L1.108|
                          DCD      ||.data||
                  |L1.112|
000070  54494d20          DCB      "TIM interrupt has been triggered 500 times.\r\n",0
000074  696e7465
000078  72727570
00007c  74206861
000080  73206265
000084  656e2074
000088  72696767
00008c  65726564
000090  20353030
000094  2074696d
000098  65732e0d
00009c  0a00    
00009e  00                DCB      0
00009f  00                DCB      0

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

                  TIM_TimeBase_TIM0Handler PROC
;;;54     
;;;55     void TIM_TimeBase_TIM0Handler(void)
000000  b510              PUSH     {r4,lr}
;;;56     {
;;;57     
;;;58       /* 判断TIM0中断是否置起 */
;;;59       if(TIM_GetFlagStatus(TIM0, TIM_Flag_TI) == SET)
000002  4c08              LDR      r4,|L2.36|
000004  2101              MOVS     r1,#1
000006  4620              MOV      r0,r4
000008  f7fffffe          BL       TIM_GetFlagStatus
00000c  2801              CMP      r0,#1
00000e  d107              BNE      |L2.32|
;;;60       {
;;;61         TIM_ClearFlag(TIM0, TIM_Flag_TI);	//清除TIM0中断
000010  2101              MOVS     r1,#1
000012  4620              MOV      r0,r4
000014  f7fffffe          BL       TIM_ClearFlag
;;;62         TIM_BaseCnt ++;
000018  4803              LDR      r0,|L2.40|
00001a  8801              LDRH     r1,[r0,#0]  ; TIM_BaseCnt
00001c  1c49              ADDS     r1,r1,#1
00001e  8001              STRH     r1,[r0,#0]
                  |L2.32|
;;;63       }
;;;64     }
000020  bd10              POP      {r4,pc}
                          ENDP

000022  0000              DCW      0x0000
                  |L2.36|
                          DCD      0x40020100
                  |L2.40|
                          DCD      ||.data||

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

                  TIM_BaseCnt
000000  0000              DCW      0x0000

;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
