; generated by ARM C/C++ Compiler, 4.1 [Build 713]
; commandline ArmCC [--list --split_sections --debug -c --asm --interleave -o.\output\main.o --asm_dir=.\listing\ --list_dir=.\listing\ --depend=.\output\main.d --cpu=Cortex-M3 --apcs=interwork -O3 -I.\ -IC:\Keil\ARM\CMSIS\Include -IC:\Keil\ARM\INC\ST\STM32F10x --omf_browse=.\output\main.crf main.c]
                          THUMB

                          AREA ||i.Delay||, CODE, READONLY, ALIGN=1

                  Delay PROC
;;;219    *******************************************************************************/
;;;220    void Delay(vu32 nCount)
000000  e000              B        |L1.4|
                  |L1.2|
;;;221    {
;;;222      for(; nCount != 0; nCount--);
000002  1e40              SUBS     r0,r0,#1
                  |L1.4|
000004  2800              CMP      r0,#0
000006  d1fc              BNE      |L1.2|
;;;223    }
000008  4770              BX       lr
;;;224    
                          ENDP


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

                  EXTI_Configuration PROC
;;;192    *******************************************************************************/
;;;193    void EXTI_Configuration(void)
000000  b510              PUSH     {r4,lr}
;;;194    {
;;;195      /* Connect EXTI Line0 to PA.00 */
;;;196      GPIO_EXTILineConfig(GPIO_PortSourceGPIOC, GPIO_PinSource13);
000002  210d              MOVS     r1,#0xd
000004  2002              MOVS     r0,#2
000006  f7fffffe          BL       GPIO_EXTILineConfig
;;;197    
;;;198      /* Configure EXTI Line0 to generate an interrupt on falling edge */  
;;;199      EXTI_InitStructure.EXTI_Line = EXTI_Line13;  
00000a  4c0c              LDR      r4,|L2.60|
00000c  f44f5000          MOV      r0,#0x2000
;;;200      EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
000010  6020              STR      r0,[r4,#0]  ; EXTI_InitStructure
000012  2000              MOVS     r0,#0
000014  7120              STRB     r0,[r4,#4]
;;;201      EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
000016  200c              MOVS     r0,#0xc
000018  7160              STRB     r0,[r4,#5]
;;;202      EXTI_InitStructure.EXTI_LineCmd = ENABLE;
00001a  2001              MOVS     r0,#1
00001c  71a0              STRB     r0,[r4,#6]
;;;203      EXTI_Init(&EXTI_InitStructure);
00001e  4620              MOV      r0,r4
000020  f7fffffe          BL       EXTI_Init
;;;204      
;;;205      /* Connect EXTI Line8 to PC.08 */
;;;206      GPIO_EXTILineConfig(GPIO_PortSourceGPIOC, GPIO_PinSource8);
000024  2108              MOVS     r1,#8
000026  2002              MOVS     r0,#2
000028  f7fffffe          BL       GPIO_EXTILineConfig
;;;207    
;;;208      /* Configure EXTI Line9 to generate an interrupt on falling edge */    
;;;209      EXTI_InitStructure.EXTI_Line = EXTI_Line8;
00002c  f44f7080          MOV      r0,#0x100
;;;210      EXTI_Init(&EXTI_InitStructure);
000030  6020              STR      r0,[r4,#0]  ; EXTI_InitStructure
000032  4620              MOV      r0,r4
000034  e8bd4010          POP      {r4,lr}
000038  f7ffbffe          B.W      EXTI_Init
;;;211    }
;;;212    
                          ENDP

                  |L2.60|
                          DCD      ||.data||+0xc

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

                  GPIO_Configuration PROC
;;;163    *******************************************************************************/
;;;164    void GPIO_Configuration(void)
000000  b510              PUSH     {r4,lr}
;;;165    {
;;;166      /* Configure PD10, PD11, PD12 and PD13 as output push-pull */
;;;167      GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13;  
000002  4c0b              LDR      r4,|L3.48|
000004  f44f5070          MOV      r0,#0x3c00
;;;168      GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
;;;169      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
;;;170      GPIO_Init(GPIOD, &GPIO_InitStructure);
000008  4621              MOV      r1,r4
00000a  8020              STRH     r0,[r4,#0]            ;167
00000c  2003              MOVS     r0,#3                 ;168
00000e  70a0              STRB     r0,[r4,#2]            ;168
000010  2010              MOVS     r0,#0x10              ;169
000012  70e0              STRB     r0,[r4,#3]            ;169
000014  4807              LDR      r0,|L3.52|
000016  f7fffffe          BL       GPIO_Init
;;;171      
;;;172      /* Configure GPIOC Pin13 as input floating */
;;;173      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13|GPIO_Pin_8;
00001a  f44f5004          MOV      r0,#0x2100
00001e  8020              STRH     r0,[r4,#0]
;;;174      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
000020  2004              MOVS     r0,#4
000022  70e0              STRB     r0,[r4,#3]
;;;175      //GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
;;;176      GPIO_Init(GPIOC, &GPIO_InitStructure);
000024  4621              MOV      r1,r4
000026  e8bd4010          POP      {r4,lr}
00002a  4803              LDR      r0,|L3.56|
00002c  f7ffbffe          B.W      GPIO_Init
;;;177      
;;;178      /* Configure GPIOC Pin8 as input floating */
;;;179       /*
;;;180      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
;;;181      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
;;;182      GPIO_Init(GPIOC, &GPIO_InitStructure);
;;;183     	 */
;;;184    }
;;;185    
                          ENDP

                  |L3.48|
                          DCD      ||.data||+0x8
                  |L3.52|
                          DCD      0x40011400
                  |L3.56|
                          DCD      0x40011000

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

                  RCC_Configuration PROC
;;;103    *******************************************************************************/
;;;104    void RCC_Configuration(void)
000000  b510              PUSH     {r4,lr}
;;;105    {
;;;106      /* RCC system reset(for debug purpose) */
;;;107      RCC_DeInit();
000002  f7fffffe          BL       RCC_DeInit
;;;108    
;;;109      /* Enable HSE */
;;;110      RCC_HSEConfig(RCC_HSE_ON);
000006  f44f3480          MOV      r4,#0x10000
00000a  4620              MOV      r0,r4
00000c  f7fffffe          BL       RCC_HSEConfig
;;;111    
;;;112      /* Wait till HSE is ready */
;;;113      HSEStartUpStatus = RCC_WaitForHSEStartUp();
000010  f7fffffe          BL       RCC_WaitForHSEStartUp
000014  4916              LDR      r1,|L4.112|
;;;114    
;;;115      if(HSEStartUpStatus == SUCCESS)
000016  2801              CMP      r0,#1
000018  7088              STRB     r0,[r1,#2]            ;113
00001a  d123              BNE      |L4.100|
;;;116      {
;;;117        /* HCLK = SYSCLK */
;;;118        RCC_HCLKConfig(RCC_SYSCLK_Div1); 
00001c  2000              MOVS     r0,#0
00001e  f7fffffe          BL       RCC_HCLKConfig
;;;119      
;;;120        /* PCLK2 = HCLK */
;;;121        RCC_PCLK2Config(RCC_HCLK_Div1); 
000022  2000              MOVS     r0,#0
000024  f7fffffe          BL       RCC_PCLK2Config
;;;122    
;;;123        /* PCLK1 = HCLK/2 */
;;;124        RCC_PCLK1Config(RCC_HCLK_Div2);
000028  11a0              ASRS     r0,r4,#6
00002a  f7fffffe          BL       RCC_PCLK1Config
;;;125    
;;;126        /* Flash 2 wait state */
;;;127        FLASH_SetLatency(FLASH_Latency_2);
00002e  2002              MOVS     r0,#2
000030  f7fffffe          BL       FLASH_SetLatency
;;;128        /* Enable Prefetch Buffer */
;;;129        FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
000034  2010              MOVS     r0,#0x10
000036  f7fffffe          BL       FLASH_PrefetchBufferCmd
;;;130    
;;;131        /* PLLCLK = 8MHz * 9 = 72 MHz */
;;;132        RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
00003a  f44f11e0          MOV      r1,#0x1c0000
00003e  4620              MOV      r0,r4
000040  f7fffffe          BL       RCC_PLLConfig
;;;133    
;;;134        /* Enable PLL */ 
;;;135        RCC_PLLCmd(ENABLE);
000044  2001              MOVS     r0,#1
000046  f7fffffe          BL       RCC_PLLCmd
                  |L4.74|
;;;136    
;;;137        /* Wait till PLL is ready */
;;;138        while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
00004a  2039              MOVS     r0,#0x39
00004c  f7fffffe          BL       RCC_GetFlagStatus
000050  2800              CMP      r0,#0
000052  d0fa              BEQ      |L4.74|
;;;139        {
;;;140        }
;;;141    
;;;142        /* Select PLL as system clock source */
;;;143        RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
000054  2002              MOVS     r0,#2
000056  f7fffffe          BL       RCC_SYSCLKConfig
;;;144    
;;;145        /* Wait till PLL is used as system clock source */
;;;146        while(RCC_GetSYSCLKSource() != 0x08)
00005a  bf00              NOP      
                  |L4.92|
00005c  f7fffffe          BL       RCC_GetSYSCLKSource
000060  2808              CMP      r0,#8
000062  d1fb              BNE      |L4.92|
                  |L4.100|
;;;147        {
;;;148        }
;;;149      }
;;;150          
;;;151      /* Enable GPIOA, GPIOB, GPIOC and AFIO Clocks */
;;;152      RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | 
000064  2101              MOVS     r1,#1
000066  e8bd4010          POP      {r4,lr}
00006a  207d              MOVS     r0,#0x7d
00006c  f7ffbffe          B.W      RCC_APB2PeriphClockCmd
;;;153                             RCC_APB2Periph_GPIOC |RCC_APB2Periph_GPIOD |
;;;154    						 RCC_APB2Periph_GPIOE | RCC_APB2Periph_AFIO, ENABLE);
;;;155    }
;;;156    
                          ENDP

                  |L4.112|
                          DCD      ||.data||

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

                  main PROC
;;;36     *******************************************************************************/
;;;37     int main(void)
000000  f7fffffe          BL       RCC_Configuration
;;;38     {
;;;39     #ifdef DEBUG
;;;40       debug();
;;;41     #endif
;;;42       
;;;43       /* Configure the system clocks */
;;;44       RCC_Configuration();
;;;45     
;;;46       /* Configure GPIOs */
;;;47       GPIO_Configuration();
000004  f7fffffe          BL       GPIO_Configuration
;;;48     
;;;49       /* Configures the EXTI Lines */
;;;50       EXTI_Configuration();
000008  f7fffffe          BL       EXTI_Configuration
;;;51            
;;;52     #ifdef  VECT_TAB_RAM  
;;;53       /* Set the Vector Table base location at 0x20000000 */ 
;;;54       NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0); 
;;;55     #else  /* VECT_TAB_FLASH  */
;;;56       /* Set the Vector Table base location at 0x08000000 */ 
;;;57       NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);   
00000c  2100              MOVS     r1,#0
00000e  f04f6000          MOV      r0,#0x8000000
000012  f7fffffe          BL       NVIC_SetVectorTable
;;;58     #endif
;;;59     
;;;60       /* Configure one bit for preemption priority */
;;;61       NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
000016  f44f60c0          MOV      r0,#0x600
00001a  f7fffffe          BL       NVIC_PriorityGroupConfig
;;;62       
;;;63       /* Enable the EXTI15_10 Interrupt */
;;;64       NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQChannel;
00001e  4c32              LDR      r4,|L5.232|
000020  2028              MOVS     r0,#0x28
;;;65       NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = PreemptionPriorityValue;
000022  1ee6              SUBS     r6,r4,#3
000024  7020              STRB     r0,[r4,#0]            ;64
000026  7870              LDRB     r0,[r6,#1]  ; PreemptionPriorityValue
000028  7060              STRB     r0,[r4,#1]
;;;66       NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
00002a  2700              MOVS     r7,#0
00002c  70a7              STRB     r7,[r4,#2]
;;;67       NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
00002e  2501              MOVS     r5,#1
000030  70e5              STRB     r5,[r4,#3]
;;;68       NVIC_Init(&NVIC_InitStructure);
000032  4620              MOV      r0,r4
000034  f7fffffe          BL       NVIC_Init
;;;69       
;;;70       /* Enable the EXTI9_5 Interrupt */
;;;71       NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQChannel;
000038  2017              MOVS     r0,#0x17
00003a  7020              STRB     r0,[r4,#0]
;;;72       NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
00003c  7067              STRB     r7,[r4,#1]
;;;73       NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
00003e  70a5              STRB     r5,[r4,#2]
;;;74       NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
000040  70e5              STRB     r5,[r4,#3]
;;;75       NVIC_Init(&NVIC_InitStructure);
000042  4620              MOV      r0,r4
000044  f7fffffe          BL       NVIC_Init
;;;76       
;;;77       /* Configure the SysTick Handler Priority: Preemption priority and subpriority */
;;;78       NVIC_SystemHandlerPriorityConfig(SystemHandler_SysTick, !PreemptionPriorityValue, 0);
000048  7870              LDRB     r0,[r6,#1]  ; PreemptionPriorityValue
00004a  b100              CBZ      r0,|L5.78|
00004c  2500              MOVS     r5,#0
                  |L5.78|
00004e  4629              MOV      r1,r5
000050  2200              MOVS     r2,#0
000052  4826              LDR      r0,|L5.236|
000054  f7fffffe          BL       NVIC_SystemHandlerPriorityConfig
;;;79       
;;;80       while (1)
;;;81       {
;;;82         if(PreemptionOccured != FALSE)
;;;83         {
;;;84           GPIO_WriteBit(GPIOD, GPIO_Pin_10, (BitAction)(1 - GPIO_ReadOutputDataBit(GPIOD, GPIO_Pin_10)));
000058  4d25              LDR      r5,|L5.240|
;;;85           Delay(0x5FFFF);
00005a  f8df8098          LDR      r8,|L5.244|
                  |L5.94|
00005e  7830              LDRB     r0,[r6,#0]            ;82  ; PreemptionOccured
000060  2800              CMP      r0,#0                 ;82
000062  d0fc              BEQ      |L5.94|
000064  f44f6480          MOV      r4,#0x400             ;84
000068  4621              MOV      r1,r4                 ;84
00006a  4628              MOV      r0,r5                 ;84
00006c  f7fffffe          BL       GPIO_ReadOutputDataBit
000070  f1c00001          RSB      r0,r0,#1              ;84
000074  b2c2              UXTB     r2,r0                 ;84
000076  4621              MOV      r1,r4                 ;84
000078  4628              MOV      r0,r5                 ;84
00007a  f7fffffe          BL       GPIO_WriteBit
00007e  4644              MOV      r4,r8
000080  4640              MOV      r0,r8
                  |L5.130|
000082  1e40              SUBS     r0,r0,#1
000084  d1fd              BNE      |L5.130|
;;;86           GPIO_WriteBit(GPIOD, GPIO_Pin_11, (BitAction)(1 - GPIO_ReadOutputDataBit(GPIOD, GPIO_Pin_11)));
000086  f44f6700          MOV      r7,#0x800
00008a  4639              MOV      r1,r7
00008c  4628              MOV      r0,r5
00008e  f7fffffe          BL       GPIO_ReadOutputDataBit
000092  f1c00001          RSB      r0,r0,#1
000096  b2c2              UXTB     r2,r0
000098  4639              MOV      r1,r7
00009a  4628              MOV      r0,r5
00009c  f7fffffe          BL       GPIO_WriteBit
;;;87           Delay(0x5FFFF);
0000a0  4620              MOV      r0,r4
                  |L5.162|
0000a2  1e40              SUBS     r0,r0,#1
0000a4  d1fd              BNE      |L5.162|
;;;88           GPIO_WriteBit(GPIOD, GPIO_Pin_12, (BitAction)(1 - GPIO_ReadOutputDataBit(GPIOD, GPIO_Pin_12)));
0000a6  f44f5780          MOV      r7,#0x1000
0000aa  4639              MOV      r1,r7
0000ac  4628              MOV      r0,r5
0000ae  f7fffffe          BL       GPIO_ReadOutputDataBit
0000b2  f1c00001          RSB      r0,r0,#1
0000b6  b2c2              UXTB     r2,r0
0000b8  4639              MOV      r1,r7
0000ba  4628              MOV      r0,r5
0000bc  f7fffffe          BL       GPIO_WriteBit
;;;89           Delay(0x5FFFF);
0000c0  4620              MOV      r0,r4
                  |L5.194|
0000c2  1e40              SUBS     r0,r0,#1
0000c4  d1fd              BNE      |L5.194|
;;;90           GPIO_WriteBit(GPIOD, GPIO_Pin_13, (BitAction)(1 - GPIO_ReadOutputDataBit(GPIOD, GPIO_Pin_13)));
0000c6  f44f5700          MOV      r7,#0x2000
0000ca  4639              MOV      r1,r7
0000cc  4628              MOV      r0,r5
0000ce  f7fffffe          BL       GPIO_ReadOutputDataBit
0000d2  f1c00001          RSB      r0,r0,#1
0000d6  b2c2              UXTB     r2,r0
0000d8  4639              MOV      r1,r7
0000da  4628              MOV      r0,r5
0000dc  f7fffffe          BL       GPIO_WriteBit
                  |L5.224|
0000e0  1e64              SUBS     r4,r4,#1
0000e2  d1fd              BNE      |L5.224|
0000e4  e7bb              B        |L5.94|
;;;91           Delay(0x5FFFF); 
;;;92         }
;;;93     
;;;94       }
;;;95     }
;;;96     
                          ENDP

0000e6  0000              DCW      0x0000
                  |L5.232|
                          DCD      ||.data||+0x3
                  |L5.236|
                          DCD      0x0002c39a
                  |L5.240|
                          DCD      0x40011400
                  |L5.244|
                          DCD      0x0005ffff

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

                  PreemptionOccured
000000  00                DCB      0x00
                  PreemptionPriorityValue
000001  00                DCB      0x00
                  HSEStartUpStatus
000002  00                DCB      0x00
                  NVIC_InitStructure
000003  00                DCB      0x00
000004  00000000          DCB      0x00,0x00,0x00,0x00
                  GPIO_InitStructure
                          DCD      0x00000000
                  EXTI_InitStructure
                          %        8

                  __ARM_use_no_argv EQU 0
