; generated by Component: ARM Compiler 5.05 update 2 (build 169) Tool: ArmCC [4d0f38]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\..\..\..\build\bootloader\mico-fire_f429\obj_rvmdk\platform_pwm.o --asm_dir=..\..\..\..\Build\Bootloader\MICO-Fire_F429\list_RVMDK\ --list_dir=..\..\..\..\Build\Bootloader\MICO-Fire_F429\list_RVMDK\ --depend=..\..\..\..\build\bootloader\mico-fire_f429\obj_rvmdk\platform_pwm.d --cpu=Cortex-M4.fp --apcs=interwork --diag_suppress=9931,1,1293 -I..\..\..\..\Bootloader -I..\..\..\..\Board\fire_F429 -I..\..\..\..\include -I..\..\..\..\libraries\utilities -I..\..\..\..\libraries\utilities\json_c -I..\..\..\..\MICO\core -I..\..\..\..\MICO\security -I..\..\..\..\MICO\system -I..\..\..\..\MICO\system\command_console -I..\..\..\..\Platform\include -I..\..\..\..\Platform\Cortex-M4 -I..\..\..\..\Platform\Cortex-M4\CMSIS -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries -I..\..\..\..\Platform\MCU\STM32F4xx\wlan_bus_driver -I..\..\..\..\Platform\Drivers\spi_flash -I..\..\..\..\Platform\Drivers -IG:\GIT_OSC\F429_OV2640_MICO_SDRAM\Projects\STM32F429\bootloader\RVMDK\RTE -ID:\work\keil5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -ID:\work\keil5\ARM\CMSIS\Include -ID:\work\keil5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0 -D__MICROLIB -D__UVISION_VERSION=516 -DSTM32F429xx -DUSE_STDPERIPH_DRIVER -DBOOTLOADER -DNO_MICO_RTOS -DHSE_VALUE=25000000 --omf_browse=..\..\..\..\build\bootloader\mico-fire_f429\obj_rvmdk\platform_pwm.crf ..\..\..\..\Platform\MCU\STM32F4xx\peripherals\platform_pwm.c]
                          THUMB

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

                  platform_pwm_init PROC
;;;61     
;;;62     OSStatus platform_pwm_init( const platform_pwm_t* pwm, uint32_t frequency, float duty_cycle )
000000  b5f0              PUSH     {r4-r7,lr}
;;;63     {
000002  4604              MOV      r4,r0
000004  460d              MOV      r5,r1
;;;64       TIM_TimeBaseInitTypeDef tim_time_base_structure;
;;;65       TIM_OCInitTypeDef       tim_oc_init_structure;
;;;66       RCC_ClocksTypeDef       rcc_clock_frequencies;
;;;67       uint16_t                period              = 0;
;;;68       float                   adjusted_duty_cycle = ( ( duty_cycle > 100.0f ) ? 100.0f : duty_cycle );
000006  ee100a10          VMOV     r0,s0
00000a  ed2d8b02          VPUSH    {d8}                  ;63
00000e  b08d              SUB      sp,sp,#0x34           ;63
000010  4953              LDR      r1,|L1.352|
000012  eddf8a54          VLDR     s17,|L1.356|
000016  4288              CMP      r0,r1
000018  dd02              BLE      |L1.32|
00001a  eeb08a68          VMOV.F32 s16,s17
00001e  e001              B        |L1.36|
                  |L1.32|
000020  eeb08a40          VMOV.F32 s16,s0
                  |L1.36|
;;;69       OSStatus                err                 = kNoErr;
000024  2600              MOVS     r6,#0
;;;70       
;;;71       require_action_quiet( pwm != NULL, exit, err = kParamErr);
000026  b1e4              CBZ      r4,|L1.98|
;;;72     
;;;73       platform_mcu_powersave_disable();
000028  f7fffffe          BL       platform_mcu_powersave_disable
;;;74     
;;;75       RCC_GetClocksFreq( &rcc_clock_frequencies );
00002c  a806              ADD      r0,sp,#0x18
00002e  f7fffffe          BL       RCC_GetClocksFreq
;;;76     
;;;77       if ( pwm->tim == TIM1 || pwm->tim == TIM8 || pwm->tim == TIM9 || pwm->tim == TIM10 || pwm->tim == TIM11 )
000032  494d              LDR      r1,|L1.360|
000034  6820              LDR      r0,[r4,#0]
;;;78       {
;;;79         RCC_APB2PeriphClockCmd( pwm->tim_peripheral_clock, ENABLE );
;;;80         if( rcc_clock_frequencies.PCLK2_Frequency == rcc_clock_frequencies.HCLK_Frequency )
;;;81           period = (uint16_t)( rcc_clock_frequencies.PCLK2_Frequency / 20 / frequency - 1 ); /* Auto-reload value counts from 0; hence the minus 1 */
000036  2714              MOVS     r7,#0x14
000038  4288              CMP      r0,r1                 ;77
00003a  d00b              BEQ      |L1.84|
00003c  494b              LDR      r1,|L1.364|
00003e  4288              CMP      r0,r1                 ;77
000040  d008              BEQ      |L1.84|
000042  494b              LDR      r1,|L1.368|
000044  4288              CMP      r0,r1                 ;77
000046  d005              BEQ      |L1.84|
000048  494a              LDR      r1,|L1.372|
00004a  4288              CMP      r0,r1                 ;77
00004c  d002              BEQ      |L1.84|
00004e  494a              LDR      r1,|L1.376|
000050  4288              CMP      r0,r1                 ;77
000052  d10a              BNE      |L1.106|
                  |L1.84|
000054  2101              MOVS     r1,#1                 ;79
000056  68a0              LDR      r0,[r4,#8]            ;79
000058  f7fffffe          BL       RCC_APB2PeriphClockCmd
00005c  9907              LDR      r1,[sp,#0x1c]         ;80
00005e  9809              LDR      r0,[sp,#0x24]         ;80
000060  e009              B        |L1.118|
                  |L1.98|
000062  4e46              LDR      r6,|L1.380|
000064  e075              B        |L1.338|
                  |L1.102|
;;;82         else
;;;83           period = (uint16_t)( rcc_clock_frequencies.PCLK2_Frequency * 2 / 20 / frequency - 1 ); /* Auto-reload value counts from 0; hence the minus 1 */
000066  0040              LSLS     r0,r0,#1
000068  e007              B        |L1.122|
                  |L1.106|
;;;84       }
;;;85       else
;;;86       {
;;;87         RCC_APB1PeriphClockCmd( pwm->tim_peripheral_clock, ENABLE );
00006a  2101              MOVS     r1,#1
00006c  68a0              LDR      r0,[r4,#8]
00006e  f7fffffe          BL       RCC_APB1PeriphClockCmd
000072  e9dd1007          LDRD     r1,r0,[sp,#0x1c]
                  |L1.118|
000076  4288              CMP      r0,r1                 ;80
000078  d1f5              BNE      |L1.102|
                  |L1.122|
;;;88         if( rcc_clock_frequencies.PCLK1_Frequency == rcc_clock_frequencies.HCLK_Frequency )
;;;89           period = (uint16_t)( rcc_clock_frequencies.PCLK1_Frequency / 20 / frequency - 1 ); /* Auto-reload value counts from 0; hence the minus 1 */
00007a  fbb0f0f7          UDIV     r0,r0,r7
00007e  fbb0f0f5          UDIV     r0,r0,r5
000082  1e40              SUBS     r0,r0,#1
000084  b285              UXTH     r5,r0
;;;90         else
;;;91           period = (uint16_t)( rcc_clock_frequencies.PCLK1_Frequency * 2 / 20 / frequency - 1 ); /* Auto-reload value counts from 0; hence the minus 1 */
;;;92       }
;;;93         
;;;94       /* Set alternate function */
;;;95       platform_gpio_set_alternate_function( pwm->pin->port, pwm->pin->pin_number, GPIO_OType_PP, GPIO_PuPd_UP, pwm->gpio_af );
000086  7b20              LDRB     r0,[r4,#0xc]
000088  9000              STR      r0,[sp,#0]
00008a  6920              LDR      r0,[r4,#0x10]
00008c  2301              MOVS     r3,#1
00008e  2200              MOVS     r2,#0
000090  7901              LDRB     r1,[r0,#4]
000092  6800              LDR      r0,[r0,#0]
000094  f7fffffe          BL       platform_gpio_set_alternate_function
;;;96       
;;;97       /* Time base configuration */
;;;98       tim_time_base_structure.TIM_Period            = (uint32_t) period;
;;;99       tim_time_base_structure.TIM_Prescaler         = (uint16_t) 19;  /* Divide clock by 19 + 1 to enable a count of high cycle + low cycle = 1 PWM cycle */
;;;100      tim_time_base_structure.TIM_ClockDivision     = 0;
000098  2700              MOVS     r7,#0
00009a  2013              MOVS     r0,#0x13              ;99
00009c  f8ad0028          STRH     r0,[sp,#0x28]         ;99
0000a0  f8ad7030          STRH     r7,[sp,#0x30]
0000a4  950b              STR      r5,[sp,#0x2c]         ;99
;;;101      tim_time_base_structure.TIM_CounterMode       = TIM_CounterMode_Up;
0000a6  f8ad702a          STRH     r7,[sp,#0x2a]
;;;102      tim_time_base_structure.TIM_RepetitionCounter = 0;
0000aa  f88d7032          STRB     r7,[sp,#0x32]
;;;103      TIM_TimeBaseInit( pwm->tim, &tim_time_base_structure );
0000ae  a90a              ADD      r1,sp,#0x28
0000b0  6820              LDR      r0,[r4,#0]
0000b2  f7fffffe          BL       TIM_TimeBaseInit
;;;104      
;;;105      /* PWM1 Mode configuration */
;;;106      tim_oc_init_structure.TIM_OCMode       = TIM_OCMode_PWM1;
;;;107      tim_oc_init_structure.TIM_OutputState  = TIM_OutputState_Enable;
;;;108      tim_oc_init_structure.TIM_OutputNState = TIM_OutputNState_Enable;
;;;109      tim_oc_init_structure.TIM_Pulse        = (uint16_t) ( adjusted_duty_cycle * (float) period / 100.0f );
0000b6  ee005a10          VMOV     s0,r5
0000ba  2060              MOVS     r0,#0x60              ;106
0000bc  f8ad0004          STRH     r0,[sp,#4]            ;106
0000c0  eeb80a40          VCVT.F32.U32 s0,s0
0000c4  2001              MOVS     r0,#1                 ;107
0000c6  f8ad0006          STRH     r0,[sp,#6]            ;107
0000ca  2004              MOVS     r0,#4                 ;108
0000cc  ee280a00          VMUL.F32 s0,s16,s0
0000d0  f8ad0008          STRH     r0,[sp,#8]            ;108
;;;110      tim_oc_init_structure.TIM_OCPolarity   = TIM_OCPolarity_High;
0000d4  f8ad7010          STRH     r7,[sp,#0x10]
;;;111      tim_oc_init_structure.TIM_OCNPolarity  = TIM_OCNPolarity_High;
;;;112      tim_oc_init_structure.TIM_OCIdleState  = TIM_OCIdleState_Reset;
0000d8  f8ad7014          STRH     r7,[sp,#0x14]
0000dc  eec00a28          VDIV.F32 s1,s0,s17             ;109
0000e0  f8ad7012          STRH     r7,[sp,#0x12]         ;111
0000e4  eebc0ae0          VCVT.U32.F32 s0,s1                 ;109
0000e8  ee100a10          VMOV     r0,s0                 ;109
0000ec  b280              UXTH     r0,r0                 ;109
0000ee  9003              STR      r0,[sp,#0xc]          ;110
;;;113      tim_oc_init_structure.TIM_OCNIdleState = TIM_OCIdleState_Set;
0000f0  f44f7080          MOV      r0,#0x100
0000f4  f8ad0016          STRH     r0,[sp,#0x16]
;;;114      
;;;115      switch ( pwm->channel )
0000f8  7920              LDRB     r0,[r4,#4]
0000fa  2801              CMP      r0,#1
0000fc  d006              BEQ      |L1.268|
0000fe  2802              CMP      r0,#2
000100  d00d              BEQ      |L1.286|
000102  2803              CMP      r0,#3
000104  d014              BEQ      |L1.304|
000106  2804              CMP      r0,#4
000108  d123              BNE      |L1.338|
00010a  e01a              B        |L1.322|
                  |L1.268|
;;;116      {
;;;117      case 1:
;;;118        {
;;;119          TIM_OC1Init( pwm->tim, &tim_oc_init_structure );
00010c  a901              ADD      r1,sp,#4
00010e  6820              LDR      r0,[r4,#0]
000110  f7fffffe          BL       TIM_OC1Init
;;;120          TIM_OC1PreloadConfig( pwm->tim, TIM_OCPreload_Enable );
000114  2108              MOVS     r1,#8
000116  6820              LDR      r0,[r4,#0]
000118  f7fffffe          BL       TIM_OC1PreloadConfig
;;;121          break;
00011c  e019              B        |L1.338|
                  |L1.286|
;;;122        }
;;;123      case 2:
;;;124        {
;;;125          TIM_OC2Init( pwm->tim, &tim_oc_init_structure );
00011e  a901              ADD      r1,sp,#4
000120  6820              LDR      r0,[r4,#0]
000122  f7fffffe          BL       TIM_OC2Init
;;;126          TIM_OC2PreloadConfig( pwm->tim, TIM_OCPreload_Enable );
000126  2108              MOVS     r1,#8
000128  6820              LDR      r0,[r4,#0]
00012a  f7fffffe          BL       TIM_OC2PreloadConfig
;;;127          break;
00012e  e010              B        |L1.338|
                  |L1.304|
;;;128        }
;;;129      case 3:
;;;130        {
;;;131          TIM_OC3Init( pwm->tim, &tim_oc_init_structure );
000130  a901              ADD      r1,sp,#4
000132  6820              LDR      r0,[r4,#0]
000134  f7fffffe          BL       TIM_OC3Init
;;;132          TIM_OC3PreloadConfig( pwm->tim, TIM_OCPreload_Enable );
000138  2108              MOVS     r1,#8
00013a  6820              LDR      r0,[r4,#0]
00013c  f7fffffe          BL       TIM_OC3PreloadConfig
;;;133          break;
000140  e007              B        |L1.338|
                  |L1.322|
;;;134        }
;;;135      case 4:
;;;136        {
;;;137          TIM_OC4Init( pwm->tim, &tim_oc_init_structure );
000142  a901              ADD      r1,sp,#4
000144  6820              LDR      r0,[r4,#0]
000146  f7fffffe          BL       TIM_OC4Init
;;;138          TIM_OC4PreloadConfig( pwm->tim, TIM_OCPreload_Enable );
00014a  2108              MOVS     r1,#8
00014c  6820              LDR      r0,[r4,#0]
00014e  f7fffffe          BL       TIM_OC4PreloadConfig
                  |L1.338|
;;;139          break;
;;;140        }
;;;141      default:
;;;142        {
;;;143          break;
;;;144        }
;;;145      }
;;;146    
;;;147    exit:  
;;;148      platform_mcu_powersave_enable();
000152  f7fffffe          BL       platform_mcu_powersave_enable
;;;149      return err;
;;;150    }
000156  b00d              ADD      sp,sp,#0x34
000158  4630              MOV      r0,r6                 ;149
00015a  ecbd8b02          VPOP     {d8}
00015e  bdf0              POP      {r4-r7,pc}
;;;151    
                          ENDP

                  |L1.352|
                          DCD      0x42c80000
                  |L1.356|
000164  42c80000          DCFS     0x42c80000 ; 100
                  |L1.360|
                          DCD      0x40010000
                  |L1.364|
                          DCD      0x40010400
                  |L1.368|
                          DCD      0x40014000
                  |L1.372|
                          DCD      0x40014400
                  |L1.376|
                          DCD      0x40014800
                  |L1.380|
                          DCD      0xffffe5cf

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

                  platform_pwm_start PROC
;;;151    
;;;152    OSStatus platform_pwm_start( const platform_pwm_t* pwm )
000000  b570              PUSH     {r4-r6,lr}
;;;153    {
000002  4604              MOV      r4,r0
;;;154      OSStatus err = kNoErr;
000004  2500              MOVS     r5,#0
;;;155      
;;;156      platform_mcu_powersave_disable();
000006  f7fffffe          BL       platform_mcu_powersave_disable
;;;157    
;;;158      require_action_quiet( pwm != NULL, exit, err = kParamErr);
00000a  b15c              CBZ      r4,|L2.36|
;;;159      
;;;160      TIM_Cmd( pwm->tim, ENABLE );
00000c  2101              MOVS     r1,#1
00000e  6820              LDR      r0,[r4,#0]
000010  f7fffffe          BL       TIM_Cmd
;;;161      TIM_CtrlPWMOutputs( pwm->tim, ENABLE );
000014  2101              MOVS     r1,#1
000016  6820              LDR      r0,[r4,#0]
000018  f7fffffe          BL       TIM_CtrlPWMOutputs
                  |L2.28|
;;;162      
;;;163    exit:  
;;;164      platform_mcu_powersave_enable();
00001c  f7fffffe          BL       platform_mcu_powersave_enable
;;;165      return err;
000020  4628              MOV      r0,r5
;;;166    }
000022  bd70              POP      {r4-r6,pc}
                  |L2.36|
000024  4d00              LDR      r5,|L2.40|
000026  e7f9              B        |L2.28|
;;;167    
                          ENDP

                  |L2.40|
                          DCD      0xffffe5cf

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

                  platform_pwm_stop PROC
;;;167    
;;;168    OSStatus platform_pwm_stop( const platform_pwm_t* pwm )
000000  b570              PUSH     {r4-r6,lr}
;;;169    {
000002  4604              MOV      r4,r0
;;;170      OSStatus err = kNoErr;
000004  2500              MOVS     r5,#0
;;;171      
;;;172      platform_mcu_powersave_disable();
000006  f7fffffe          BL       platform_mcu_powersave_disable
;;;173    
;;;174      require_action_quiet( pwm != NULL, exit, err = kParamErr);
00000a  b15c              CBZ      r4,|L3.36|
;;;175      
;;;176      TIM_CtrlPWMOutputs( pwm->tim, DISABLE );
00000c  2100              MOVS     r1,#0
00000e  6820              LDR      r0,[r4,#0]
000010  f7fffffe          BL       TIM_CtrlPWMOutputs
;;;177      TIM_Cmd( pwm->tim, DISABLE );
000014  2100              MOVS     r1,#0
000016  6820              LDR      r0,[r4,#0]
000018  f7fffffe          BL       TIM_Cmd
                  |L3.28|
;;;178      
;;;179    exit:  
;;;180      platform_mcu_powersave_enable();
00001c  f7fffffe          BL       platform_mcu_powersave_enable
;;;181      return err;
000020  4628              MOV      r0,r5
;;;182    }
000022  bd70              POP      {r4-r6,pc}
                  |L3.36|
000024  4d00              LDR      r5,|L3.40|
000026  e7f9              B        |L3.28|
;;;183    
                          ENDP

                  |L3.40|
                          DCD      0xffffe5cf

;*** Start embedded assembler ***

#line 1 "..\\..\\..\\..\\Platform\\MCU\\STM32F4xx\\peripherals\\platform_pwm.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___14_platform_pwm_c_8cd4dfb8____REV16|
#line 114 "..\\..\\..\\..\\Platform\\Cortex-M4\\CMSIS\\core_cmInstr.h"
|__asm___14_platform_pwm_c_8cd4dfb8____REV16| PROC
#line 115

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___14_platform_pwm_c_8cd4dfb8____REVSH|
#line 128
|__asm___14_platform_pwm_c_8cd4dfb8____REVSH| PROC
#line 129

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
