; generated by ARM C/C++ Compiler with , RVCT4.0 [Build 524] for uVision
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o.\output\main.o --depend=.\output\main.d --device=DARMSTM --apcs=interwork -O3 -I.\ -Id:\Keil\ARM\INC\ST\STM32F10x --omf_browse=.\output\main.crf main.c]
                          THUMB

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

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


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

                  EXTI_Configuration PROC
;;;188    *******************************************************************************/
;;;189    void EXTI_Configuration(void)
000000  b510              PUSH     {r4,lr}
;;;190    {
;;;191      /* Connect EXTI Line0 to PA.00 */
;;;192      GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource0);
000002  2100              MOVS     r1,#0
000004  4608              MOV      r0,r1
000006  f7fffffe          BL       GPIO_EXTILineConfig
;;;193    
;;;194      /* Configure EXTI Line0 to generate an interrupt on falling edge */  
;;;195      EXTI_InitStructure.EXTI_Line = EXTI_Line0;  
00000a  4c0b              LDR      r4,|L2.56|
00000c  2001              MOVS     r0,#1
;;;196      EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
00000e  2100              MOVS     r1,#0
000010  6020              STR      r0,[r4,#0]  ; EXTI_InitStructure
000012  7121              STRB     r1,[r4,#4]
;;;197      EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
000014  210c              MOVS     r1,#0xc
000016  7161              STRB     r1,[r4,#5]
;;;198      EXTI_InitStructure.EXTI_LineCmd = ENABLE;
000018  71a0              STRB     r0,[r4,#6]
;;;199      EXTI_Init(&EXTI_InitStructure);
00001a  4620              MOV      r0,r4
00001c  f7fffffe          BL       EXTI_Init
;;;200      
;;;201      /* Connect EXTI Line9 to PB.09 */
;;;202      GPIO_EXTILineConfig(GPIO_PortSourceGPIOB, GPIO_PinSource9);
000020  2109              MOVS     r1,#9
000022  2001              MOVS     r0,#1
000024  f7fffffe          BL       GPIO_EXTILineConfig
;;;203    
;;;204      /* Configure EXTI Line9 to generate an interrupt on falling edge */    
;;;205      EXTI_InitStructure.EXTI_Line = EXTI_Line9;
000028  f44f7000          MOV      r0,#0x200
;;;206      EXTI_Init(&EXTI_InitStructure);
00002c  6020              STR      r0,[r4,#0]  ; EXTI_InitStructure
00002e  4620              MOV      r0,r4
000030  e8bd4010          POP      {r4,lr}
000034  f7ffbffe          B.W      EXTI_Init
;;;207    }
;;;208    
                          ENDP

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

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

                  GPIO_Configuration PROC
;;;162    *******************************************************************************/
;;;163    void GPIO_Configuration(void)
000000  b510              PUSH     {r4,lr}
;;;164    {
;;;165      /* Configure PC6, PC7, PC8 and PC9 as output push-pull */
;;;166      GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9;  
000002  4c0f              LDR      r4,|L3.64|
000004  f44f7070          MOV      r0,#0x3c0
000008  8020              STRH     r0,[r4,#0]
;;;167      GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
00000a  2003              MOVS     r0,#3
00000c  70a0              STRB     r0,[r4,#2]
;;;168      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
00000e  2010              MOVS     r0,#0x10
000010  70e0              STRB     r0,[r4,#3]
;;;169      GPIO_Init(GPIOC, &GPIO_InitStructure);
000012  4621              MOV      r1,r4
000014  480b              LDR      r0,|L3.68|
000016  f7fffffe          BL       GPIO_Init
;;;170      
;;;171      /* Configure GPIOA Pin0 as input floating */
;;;172      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
00001a  2001              MOVS     r0,#1
00001c  8020              STRH     r0,[r4,#0]
;;;173      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
00001e  2004              MOVS     r0,#4
000020  70e0              STRB     r0,[r4,#3]
;;;174      GPIO_Init(GPIOA, &GPIO_InitStructure);
000022  4621              MOV      r1,r4
000024  4808              LDR      r0,|L3.72|
000026  f7fffffe          BL       GPIO_Init
;;;175      
;;;176      /* Configure GPIOB Pin9 as input floating */
;;;177      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
00002a  f44f7000          MOV      r0,#0x200
00002e  8020              STRH     r0,[r4,#0]
;;;178      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
000030  2048              MOVS     r0,#0x48
000032  70e0              STRB     r0,[r4,#3]
;;;179      GPIO_Init(GPIOB, &GPIO_InitStructure);
000034  4621              MOV      r1,r4
000036  e8bd4010          POP      {r4,lr}
00003a  4804              LDR      r0,|L3.76|
00003c  f7ffbffe          B.W      GPIO_Init
;;;180    }
;;;181    
                          ENDP

                  |L3.64|
                          DCD      ||.data||+0x8
                  |L3.68|
                          DCD      0x40011000
                  |L3.72|
                          DCD      0x40010800
                  |L3.76|
                          DCD      0x40010c00

                          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|
000016  7088              STRB     r0,[r1,#2]
;;;114    
;;;115      if(HSEStartUpStatus == SUCCESS)
000018  b2c0              UXTB     r0,r0
00001a  2801              CMP      r0,#1
00001c  d122              BNE      |L4.100|
;;;116      {
;;;117        /* HCLK = SYSCLK */
;;;118        RCC_HCLKConfig(RCC_SYSCLK_Div1); 
00001e  2000              MOVS     r0,#0
000020  f7fffffe          BL       RCC_HCLKConfig
;;;119      
;;;120        /* PCLK2 = HCLK */
;;;121        RCC_PCLK2Config(RCC_HCLK_Div1); 
000024  2000              MOVS     r0,#0
000026  f7fffffe          BL       RCC_PCLK2Config
;;;122    
;;;123        /* PCLK1 = HCLK/2 */
;;;124        RCC_PCLK1Config(RCC_HCLK_Div2);
00002a  11a0              ASRS     r0,r4,#6
00002c  f7fffffe          BL       RCC_PCLK1Config
;;;125    
;;;126        /* Flash 2 wait state */
;;;127        FLASH_SetLatency(FLASH_Latency_2);
000030  2002              MOVS     r0,#2
000032  f7fffffe          BL       FLASH_SetLatency
;;;128        /* Enable Prefetch Buffer */
;;;129        FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
000036  2010              MOVS     r0,#0x10
000038  f7fffffe          BL       FLASH_PrefetchBufferCmd
;;;130    
;;;131        /* PLLCLK = 8MHz * 9 = 72 MHz */
;;;132        RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
00003c  f44f11e0          MOV      r1,#0x1c0000
000040  4620              MOV      r0,r4
000042  f7fffffe          BL       RCC_PLLConfig
;;;133    
;;;134        /* Enable PLL */ 
;;;135        RCC_PLLCmd(ENABLE);
000046  2001              MOVS     r0,#1
000048  f7fffffe          BL       RCC_PLLCmd
                  |L4.76|
;;;136    
;;;137        /* Wait till PLL is ready */
;;;138        while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
00004c  2039              MOVS     r0,#0x39
00004e  f7fffffe          BL       RCC_GetFlagStatus
000052  2800              CMP      r0,#0
000054  d0fa              BEQ      |L4.76|
;;;139        {
;;;140        }
;;;141    
;;;142        /* Select PLL as system clock source */
;;;143        RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
000056  2002              MOVS     r0,#2
000058  f7fffffe          BL       RCC_SYSCLKConfig
                  |L4.92|
;;;144    
;;;145        /* Wait till PLL is used as system clock source */
;;;146        while(RCC_GetSYSCLKSource() != 0x08)
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  201d              MOVS     r0,#0x1d
00006c  f7ffbffe          B.W      RCC_APB2PeriphClockCmd
;;;153                             RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE);
;;;154    }
;;;155    
                          ENDP

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

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

                  main PROC
;;;36     *******************************************************************************/
;;;37     int main(void)
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;38     {
;;;39     #ifdef DEBUG
;;;40       debug();
;;;41     #endif
;;;42       
;;;43       /* Configure the system clocks */
;;;44       RCC_Configuration();
000004  f7fffffe          BL       RCC_Configuration
;;;45     
;;;46       /* Configure GPIOs */
;;;47       GPIO_Configuration();
000008  f7fffffe          BL       GPIO_Configuration
;;;48     
;;;49       /* Configures the EXTI Lines */
;;;50       EXTI_Configuration();
00000c  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);   
000010  2100              MOVS     r1,#0
000012  f04f6000          MOV      r0,#0x8000000
000016  f7fffffe          BL       NVIC_SetVectorTable
;;;58     #endif
;;;59     
;;;60       /* Configure one bit for preemption priority */
;;;61       NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
00001a  f44f60c0          MOV      r0,#0x600
00001e  f7fffffe          BL       NVIC_PriorityGroupConfig
;;;62       
;;;63       /* Enable the EXTI0 Interrupt */
;;;64       NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQChannel;
000022  4c2f              LDR      r4,|L5.224|
000024  2006              MOVS     r0,#6
000026  7020              STRB     r0,[r4,#0]
;;;65       NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = PreemptionPriorityValue;
000028  1ee7              SUBS     r7,r4,#3
00002a  7878              LDRB     r0,[r7,#1]  ; PreemptionPriorityValue
00002c  7060              STRB     r0,[r4,#1]
;;;66       NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
00002e  2600              MOVS     r6,#0
000030  70a6              STRB     r6,[r4,#2]
;;;67       NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
000032  2501              MOVS     r5,#1
000034  70e5              STRB     r5,[r4,#3]
;;;68       NVIC_Init(&NVIC_InitStructure);
000036  4620              MOV      r0,r4
000038  f7fffffe          BL       NVIC_Init
;;;69       
;;;70       /* Enable the EXTI9_5 Interrupt */
;;;71       NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQChannel;
00003c  2017              MOVS     r0,#0x17
00003e  7020              STRB     r0,[r4,#0]
;;;72       NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
000040  7066              STRB     r6,[r4,#1]
;;;73       NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
000042  70a5              STRB     r5,[r4,#2]
;;;74       NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
000044  70e5              STRB     r5,[r4,#3]
;;;75       NVIC_Init(&NVIC_InitStructure);
000046  4620              MOV      r0,r4
000048  f7fffffe          BL       NVIC_Init
;;;76       
;;;77       /* Configure the SysTick Handler Priority: Preemption priority and subpriority */
;;;78       NVIC_SystemHandlerPriorityConfig(SystemHandler_SysTick, !PreemptionPriorityValue, 0);
00004c  7878              LDRB     r0,[r7,#1]  ; PreemptionPriorityValue
00004e  4629              MOV      r1,r5
000050  b100              CBZ      r0,|L5.84|
000052  2100              MOVS     r1,#0
                  |L5.84|
000054  2200              MOVS     r2,#0
000056  4823              LDR      r0,|L5.228|
000058  f7fffffe          BL       NVIC_SystemHandlerPriorityConfig
;;;79       
;;;80       while (1)
;;;81       {
;;;82         if(PreemptionOccured != FALSE)
;;;83         {
;;;84           GPIO_WriteBit(GPIOC, GPIO_Pin_6, (BitAction)(1 - GPIO_ReadOutputDataBit(GPIOC, GPIO_Pin_6)));
00005c  4d22              LDR      r5,|L5.232|
;;;85           Delay(0x5FFFF);
00005e  4c23              LDR      r4,|L5.236|
                  |L5.96|
000060  7838              LDRB     r0,[r7,#0]            ;82  ; PreemptionOccured
000062  2800              CMP      r0,#0                 ;82
000064  d0fc              BEQ      |L5.96|
000066  2140              MOVS     r1,#0x40              ;84
000068  4628              MOV      r0,r5                 ;84
00006a  f7fffffe          BL       GPIO_ReadOutputDataBit
00006e  f1c00001          RSB      r0,r0,#1              ;84
000072  b2c2              UXTB     r2,r0                 ;84
000074  2140              MOVS     r1,#0x40              ;84
000076  4628              MOV      r0,r5                 ;84
000078  f7fffffe          BL       GPIO_WriteBit
00007c  4620              MOV      r0,r4
                  |L5.126|
00007e  1e40              SUBS     r0,r0,#1
000080  d1fd              BNE      |L5.126|
;;;86           GPIO_WriteBit(GPIOC, GPIO_Pin_7, (BitAction)(1 - GPIO_ReadOutputDataBit(GPIOC, GPIO_Pin_7)));
000082  2180              MOVS     r1,#0x80
000084  4628              MOV      r0,r5
000086  f7fffffe          BL       GPIO_ReadOutputDataBit
00008a  f1c00001          RSB      r0,r0,#1
00008e  b2c2              UXTB     r2,r0
000090  2180              MOVS     r1,#0x80
000092  4628              MOV      r0,r5
000094  f7fffffe          BL       GPIO_WriteBit
;;;87           Delay(0x5FFFF);
000098  4620              MOV      r0,r4
                  |L5.154|
00009a  1e40              SUBS     r0,r0,#1
00009c  d1fd              BNE      |L5.154|
;;;88           GPIO_WriteBit(GPIOC, GPIO_Pin_8, (BitAction)(1 - GPIO_ReadOutputDataBit(GPIOC, GPIO_Pin_8)));
00009e  f44f7680          MOV      r6,#0x100
0000a2  4631              MOV      r1,r6
0000a4  4628              MOV      r0,r5
0000a6  f7fffffe          BL       GPIO_ReadOutputDataBit
0000aa  f1c00001          RSB      r0,r0,#1
0000ae  b2c2              UXTB     r2,r0
0000b0  4631              MOV      r1,r6
0000b2  4628              MOV      r0,r5
0000b4  f7fffffe          BL       GPIO_WriteBit
;;;89           Delay(0x5FFFF);
0000b8  4620              MOV      r0,r4
                  |L5.186|
0000ba  1e40              SUBS     r0,r0,#1
0000bc  d1fd              BNE      |L5.186|
;;;90           GPIO_WriteBit(GPIOC, GPIO_Pin_9, (BitAction)(1 - GPIO_ReadOutputDataBit(GPIOC, GPIO_Pin_9)));
0000be  f44f7600          MOV      r6,#0x200
0000c2  4631              MOV      r1,r6
0000c4  4628              MOV      r0,r5
0000c6  f7fffffe          BL       GPIO_ReadOutputDataBit
0000ca  f1c00001          RSB      r0,r0,#1
0000ce  b2c2              UXTB     r2,r0
0000d0  4631              MOV      r1,r6
0000d2  4628              MOV      r0,r5
0000d4  f7fffffe          BL       GPIO_WriteBit
;;;91           Delay(0x5FFFF); 
0000d8  4620              MOV      r0,r4
                  |L5.218|
0000da  1e40              SUBS     r0,r0,#1
0000dc  d1fd              BNE      |L5.218|
0000de  e7bf              B        |L5.96|
;;;92         }
;;;93     
;;;94       }
;;;95     }
;;;96     
                          ENDP

                  |L5.224|
                          DCD      ||.data||+0x3
                  |L5.228|
                          DCD      0x0002c39a
                  |L5.232|
                          DCD      0x40011000
                  |L5.236|
                          DCD      0x0005ffff

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

                  PreemptionOccured
000000  00                DCB      0x00
                  PreemptionPriorityValue
000001  00                DCB      0x00
                  HSEStartUpStatus
000002  00                DCB      0x00
                  NVIC_InitStructure
                          DCDU     0x00000000
000007  00                DCB      0x00
                  GPIO_InitStructure
                          DCD      0x00000000
                  EXTI_InitStructure
                          %        8

                  __ARM_use_no_argv EQU 0
