; 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\demo\mico-fire_f429\obj_rvmdk\platform_pwm.o --asm_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --list_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --depend=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\platform_pwm.d --cpu=Cortex-M4.fp --apcs=interwork -O0 --diag_suppress=9931,1,1293 -I..\..\..\..\Board\fire_F429 -I..\..\..\..\Demos\fire\ov2640 -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 -I..\..\..\..\libraries\daemons\homekit_server -I..\..\..\..\libraries\daemons\http_server -I..\..\..\..\Platform\Drivers\malloc -I..\..\..\..\Platform\Drivers\SDRAM -I..\..\..\..\Platform\Drivers\ov5640 -IG:\GIT_OSC\STM32_develop\F429-V2\develop\6-WIFI\STM32-WiFi\3.wifi_ov5640\Projects\STM32F429\demo\RVMDK\RTE -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -IC:\Keil_v5\ARM\CMSIS\Include -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0 -D__UVISION_VERSION=515 -DSTM32F429xx -DUSE_STDPERIPH_DRIVER -DDEBUG -DHSE_VALUE=25000000 -DOV5640 --omf_browse=..\..\..\..\build\demo\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  b570              PUSH     {r4-r6,lr}
;;;63     {
000002  ed2d8b04          VPUSH    {d8-d9}
000006  b08e              SUB      sp,sp,#0x38
000008  4604              MOV      r4,r0
00000a  460d              MOV      r5,r1
00000c  eef08a40          VMOV.F32 s17,s0
;;;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;
000010  2000              MOVS     r0,#0
000012  ee080a10          VMOV     s16,r0
;;;68       float                   adjusted_duty_cycle = ( ( duty_cycle > 100.0f ) ? 100.0f : duty_cycle );
000016  ed9f0a6e          VLDR     s0,|L1.464|
00001a  eef48ac0          VCMPE.F32 s17,s0
00001e  eef1fa10          VMRS     APSR_nzcv,FPSCR
000022  dd02              BLE      |L1.42|
000024  ed9f0a6a          VLDR     s0,|L1.464|
000028  e001              B        |L1.46|
                  |L1.42|
00002a  eeb00a68          VMOV.F32 s0,s17
                  |L1.46|
00002e  eeb09a40          VMOV.F32 s18,s0
;;;69       OSStatus                err                 = kNoErr;
000032  2600              MOVS     r6,#0
;;;70       
;;;71       require_action_quiet( pwm != NULL, exit, err = kParamErr);
000034  bf00              NOP      
000036  b90c              CBNZ     r4,|L1.60|
000038  4e66              LDR      r6,|L1.468|
00003a  e0c2              B        |L1.450|
                  |L1.60|
00003c  bf00              NOP      
;;;72     
;;;73       platform_mcu_powersave_disable();
00003e  f7fffffe          BL       platform_mcu_powersave_disable
;;;74     
;;;75       RCC_GetClocksFreq( &rcc_clock_frequencies );
000042  a802              ADD      r0,sp,#8
000044  f7fffffe          BL       RCC_GetClocksFreq
;;;76     
;;;77       if ( pwm->tim == TIM1 || pwm->tim == TIM8 || pwm->tim == TIM9 || pwm->tim == TIM10 || pwm->tim == TIM11 )
000048  4963              LDR      r1,|L1.472|
00004a  6820              LDR      r0,[r4,#0]
00004c  4288              CMP      r0,r1
00004e  d00f              BEQ      |L1.112|
000050  4962              LDR      r1,|L1.476|
000052  6820              LDR      r0,[r4,#0]
000054  4288              CMP      r0,r1
000056  d00b              BEQ      |L1.112|
000058  4961              LDR      r1,|L1.480|
00005a  6820              LDR      r0,[r4,#0]
00005c  4288              CMP      r0,r1
00005e  d007              BEQ      |L1.112|
000060  4960              LDR      r1,|L1.484|
000062  6820              LDR      r0,[r4,#0]
000064  4288              CMP      r0,r1
000066  d003              BEQ      |L1.112|
000068  495f              LDR      r1,|L1.488|
00006a  6820              LDR      r0,[r4,#0]
00006c  4288              CMP      r0,r1
00006e  d11e              BNE      |L1.174|
                  |L1.112|
;;;78       {
;;;79         RCC_APB2PeriphClockCmd( pwm->tim_peripheral_clock, ENABLE );
000070  2101              MOVS     r1,#1
000072  68a0              LDR      r0,[r4,#8]
000074  f7fffffe          BL       RCC_APB2PeriphClockCmd
;;;80         if( rcc_clock_frequencies.PCLK2_Frequency == rcc_clock_frequencies.HCLK_Frequency )
000078  9903              LDR      r1,[sp,#0xc]
00007a  9805              LDR      r0,[sp,#0x14]
00007c  4288              CMP      r0,r1
00007e  d10a              BNE      |L1.150|
;;;81           period = (uint16_t)( rcc_clock_frequencies.PCLK2_Frequency / 20 / frequency - 1 ); /* Auto-reload value counts from 0; hence the minus 1 */
000080  2114              MOVS     r1,#0x14
000082  9805              LDR      r0,[sp,#0x14]
000084  fbb0f0f1          UDIV     r0,r0,r1
000088  fbb0f0f5          UDIV     r0,r0,r5
00008c  1e40              SUBS     r0,r0,#1
00008e  b280              UXTH     r0,r0
000090  ee080a10          VMOV     s16,r0
000094  e029              B        |L1.234|
                  |L1.150|
;;;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 */
000096  9805              LDR      r0,[sp,#0x14]
000098  0040              LSLS     r0,r0,#1
00009a  2114              MOVS     r1,#0x14
00009c  fbb0f0f1          UDIV     r0,r0,r1
0000a0  fbb0f0f5          UDIV     r0,r0,r5
0000a4  1e40              SUBS     r0,r0,#1
0000a6  b280              UXTH     r0,r0
0000a8  ee080a10          VMOV     s16,r0
0000ac  e01d              B        |L1.234|
                  |L1.174|
;;;84       }
;;;85       else
;;;86       {
;;;87         RCC_APB1PeriphClockCmd( pwm->tim_peripheral_clock, ENABLE );
0000ae  2101              MOVS     r1,#1
0000b0  68a0              LDR      r0,[r4,#8]
0000b2  f7fffffe          BL       RCC_APB1PeriphClockCmd
;;;88         if( rcc_clock_frequencies.PCLK1_Frequency == rcc_clock_frequencies.HCLK_Frequency )
0000b6  e9dd1003          LDRD     r1,r0,[sp,#0xc]
0000ba  4288              CMP      r0,r1
0000bc  d10a              BNE      |L1.212|
;;;89           period = (uint16_t)( rcc_clock_frequencies.PCLK1_Frequency / 20 / frequency - 1 ); /* Auto-reload value counts from 0; hence the minus 1 */
0000be  2114              MOVS     r1,#0x14
0000c0  9804              LDR      r0,[sp,#0x10]
0000c2  fbb0f0f1          UDIV     r0,r0,r1
0000c6  fbb0f0f5          UDIV     r0,r0,r5
0000ca  1e40              SUBS     r0,r0,#1
0000cc  b280              UXTH     r0,r0
0000ce  ee080a10          VMOV     s16,r0
0000d2  e00a              B        |L1.234|
                  |L1.212|
;;;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 */
0000d4  9804              LDR      r0,[sp,#0x10]
0000d6  0040              LSLS     r0,r0,#1
0000d8  2114              MOVS     r1,#0x14
0000da  fbb0f0f1          UDIV     r0,r0,r1
0000de  fbb0f0f5          UDIV     r0,r0,r5
0000e2  1e40              SUBS     r0,r0,#1
0000e4  b280              UXTH     r0,r0
0000e6  ee080a10          VMOV     s16,r0
                  |L1.234|
;;;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 );
0000ea  7b20              LDRB     r0,[r4,#0xc]
0000ec  9000              STR      r0,[sp,#0]
0000ee  6922              LDR      r2,[r4,#0x10]
0000f0  7911              LDRB     r1,[r2,#4]
0000f2  2301              MOVS     r3,#1
0000f4  6810              LDR      r0,[r2,#0]
0000f6  2200              MOVS     r2,#0
0000f8  f7fffffe          BL       platform_gpio_set_alternate_function
;;;96       
;;;97       /* Time base configuration */
;;;98       tim_time_base_structure.TIM_Period            = (uint32_t) period;
0000fc  ed8d8a0c          VSTR     s16,[sp,#0x30]
;;;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 */
000100  2013              MOVS     r0,#0x13
000102  f8ad002c          STRH     r0,[sp,#0x2c]
;;;100      tim_time_base_structure.TIM_ClockDivision     = 0;
000106  2000              MOVS     r0,#0
000108  f8ad0034          STRH     r0,[sp,#0x34]
;;;101      tim_time_base_structure.TIM_CounterMode       = TIM_CounterMode_Up;
00010c  f8ad002e          STRH     r0,[sp,#0x2e]
;;;102      tim_time_base_structure.TIM_RepetitionCounter = 0;
000110  f88d0036          STRB     r0,[sp,#0x36]
;;;103      TIM_TimeBaseInit( pwm->tim, &tim_time_base_structure );
000114  a90b              ADD      r1,sp,#0x2c
000116  6820              LDR      r0,[r4,#0]
000118  f7fffffe          BL       TIM_TimeBaseInit
;;;104      
;;;105      /* PWM1 Mode configuration */
;;;106      tim_oc_init_structure.TIM_OCMode       = TIM_OCMode_PWM1;
00011c  2060              MOVS     r0,#0x60
00011e  f8ad0018          STRH     r0,[sp,#0x18]
;;;107      tim_oc_init_structure.TIM_OutputState  = TIM_OutputState_Enable;
000122  2001              MOVS     r0,#1
000124  f8ad001a          STRH     r0,[sp,#0x1a]
;;;108      tim_oc_init_structure.TIM_OutputNState = TIM_OutputNState_Enable;
000128  2004              MOVS     r0,#4
00012a  f8ad001c          STRH     r0,[sp,#0x1c]
;;;109      tim_oc_init_structure.TIM_Pulse        = (uint16_t) ( adjusted_duty_cycle * (float) period / 100.0f );
00012e  eeb80a48          VCVT.F32.U32 s0,s16
000132  ee290a00          VMUL.F32 s0,s18,s0
000136  eddf0a26          VLDR     s1,|L1.464|
00013a  ee801a20          VDIV.F32 s2,s0,s1
00013e  eebc0ac1          VCVT.U32.F32 s0,s2
000142  ee100a10          VMOV     r0,s0
000146  b280              UXTH     r0,r0
000148  9008              STR      r0,[sp,#0x20]
;;;110      tim_oc_init_structure.TIM_OCPolarity   = TIM_OCPolarity_High;
00014a  2000              MOVS     r0,#0
00014c  f8ad0024          STRH     r0,[sp,#0x24]
;;;111      tim_oc_init_structure.TIM_OCNPolarity  = TIM_OCNPolarity_High;
000150  f8ad0026          STRH     r0,[sp,#0x26]
;;;112      tim_oc_init_structure.TIM_OCIdleState  = TIM_OCIdleState_Reset;
000154  f8ad0028          STRH     r0,[sp,#0x28]
;;;113      tim_oc_init_structure.TIM_OCNIdleState = TIM_OCIdleState_Set;
000158  f44f7080          MOV      r0,#0x100
00015c  f8ad002a          STRH     r0,[sp,#0x2a]
;;;114      
;;;115      switch ( pwm->channel )
000160  7920              LDRB     r0,[r4,#4]
000162  2801              CMP      r0,#1
000164  d006              BEQ      |L1.372|
000166  2802              CMP      r0,#2
000168  d00d              BEQ      |L1.390|
00016a  2803              CMP      r0,#3
00016c  d014              BEQ      |L1.408|
00016e  2804              CMP      r0,#4
000170  d124              BNE      |L1.444|
000172  e01a              B        |L1.426|
                  |L1.372|
;;;116      {
;;;117      case 1:
;;;118        {
;;;119          TIM_OC1Init( pwm->tim, &tim_oc_init_structure );
000174  a906              ADD      r1,sp,#0x18
000176  6820              LDR      r0,[r4,#0]
000178  f7fffffe          BL       TIM_OC1Init
;;;120          TIM_OC1PreloadConfig( pwm->tim, TIM_OCPreload_Enable );
00017c  2108              MOVS     r1,#8
00017e  6820              LDR      r0,[r4,#0]
000180  f7fffffe          BL       TIM_OC1PreloadConfig
;;;121          break;
000184  e01b              B        |L1.446|
                  |L1.390|
;;;122        }
;;;123      case 2:
;;;124        {
;;;125          TIM_OC2Init( pwm->tim, &tim_oc_init_structure );
000186  a906              ADD      r1,sp,#0x18
000188  6820              LDR      r0,[r4,#0]
00018a  f7fffffe          BL       TIM_OC2Init
;;;126          TIM_OC2PreloadConfig( pwm->tim, TIM_OCPreload_Enable );
00018e  2108              MOVS     r1,#8
000190  6820              LDR      r0,[r4,#0]
000192  f7fffffe          BL       TIM_OC2PreloadConfig
;;;127          break;
000196  e012              B        |L1.446|
                  |L1.408|
;;;128        }
;;;129      case 3:
;;;130        {
;;;131          TIM_OC3Init( pwm->tim, &tim_oc_init_structure );
000198  a906              ADD      r1,sp,#0x18
00019a  6820              LDR      r0,[r4,#0]
00019c  f7fffffe          BL       TIM_OC3Init
;;;132          TIM_OC3PreloadConfig( pwm->tim, TIM_OCPreload_Enable );
0001a0  2108              MOVS     r1,#8
0001a2  6820              LDR      r0,[r4,#0]
0001a4  f7fffffe          BL       TIM_OC3PreloadConfig
;;;133          break;
0001a8  e009              B        |L1.446|
                  |L1.426|
;;;134        }
;;;135      case 4:
;;;136        {
;;;137          TIM_OC4Init( pwm->tim, &tim_oc_init_structure );
0001aa  a906              ADD      r1,sp,#0x18
0001ac  6820              LDR      r0,[r4,#0]
0001ae  f7fffffe          BL       TIM_OC4Init
;;;138          TIM_OC4PreloadConfig( pwm->tim, TIM_OCPreload_Enable );
0001b2  2108              MOVS     r1,#8
0001b4  6820              LDR      r0,[r4,#0]
0001b6  f7fffffe          BL       TIM_OC4PreloadConfig
;;;139          break;
0001ba  e000              B        |L1.446|
                  |L1.444|
;;;140        }
;;;141      default:
;;;142        {
;;;143          break;
0001bc  bf00              NOP      
                  |L1.446|
0001be  bf00              NOP                            ;121
;;;144        }
;;;145      }
;;;146    
;;;147    exit:  
0001c0  bf00              NOP      
                  |L1.450|
;;;148      platform_mcu_powersave_enable();
0001c2  f7fffffe          BL       platform_mcu_powersave_enable
;;;149      return err;
0001c6  4630              MOV      r0,r6
;;;150    }
0001c8  b00e              ADD      sp,sp,#0x38
0001ca  ecbd8b04          VPOP     {d8-d9}
0001ce  bd70              POP      {r4-r6,pc}
;;;151    
                          ENDP

                  |L1.464|
0001d0  42c80000          DCFS     0x42c80000 ; 100
                  |L1.468|
                          DCD      0xffffe5cf
                  |L1.472|
                          DCD      0x40010000
                  |L1.476|
                          DCD      0x40010400
                  |L1.480|
                          DCD      0x40014000
                  |L1.484|
                          DCD      0x40014400
                  |L1.488|
                          DCD      0x40014800

                          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  bf00              NOP      
00000c  b90c              CBNZ     r4,|L2.18|
00000e  4d08              LDR      r5,|L2.48|
000010  e009              B        |L2.38|
                  |L2.18|
000012  bf00              NOP      
;;;159      
;;;160      TIM_Cmd( pwm->tim, ENABLE );
000014  2101              MOVS     r1,#1
000016  6820              LDR      r0,[r4,#0]
000018  f7fffffe          BL       TIM_Cmd
;;;161      TIM_CtrlPWMOutputs( pwm->tim, ENABLE );
00001c  2101              MOVS     r1,#1
00001e  6820              LDR      r0,[r4,#0]
000020  f7fffffe          BL       TIM_CtrlPWMOutputs
;;;162      
;;;163    exit:  
000024  bf00              NOP      
                  |L2.38|
;;;164      platform_mcu_powersave_enable();
000026  f7fffffe          BL       platform_mcu_powersave_enable
;;;165      return err;
00002a  4628              MOV      r0,r5
;;;166    }
00002c  bd70              POP      {r4-r6,pc}
;;;167    
                          ENDP

00002e  0000              DCW      0x0000
                  |L2.48|
                          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  bf00              NOP      
00000c  b90c              CBNZ     r4,|L3.18|
00000e  4d08              LDR      r5,|L3.48|
000010  e009              B        |L3.38|
                  |L3.18|
000012  bf00              NOP      
;;;175      
;;;176      TIM_CtrlPWMOutputs( pwm->tim, DISABLE );
000014  2100              MOVS     r1,#0
000016  6820              LDR      r0,[r4,#0]
000018  f7fffffe          BL       TIM_CtrlPWMOutputs
;;;177      TIM_Cmd( pwm->tim, DISABLE );
00001c  2100              MOVS     r1,#0
00001e  6820              LDR      r0,[r4,#0]
000020  f7fffffe          BL       TIM_Cmd
;;;178      
;;;179    exit:  
000024  bf00              NOP      
                  |L3.38|
;;;180      platform_mcu_powersave_enable();
000026  f7fffffe          BL       platform_mcu_powersave_enable
;;;181      return err;
00002a  4628              MOV      r0,r5
;;;182    }
00002c  bd70              POP      {r4-r6,pc}
;;;183    
                          ENDP

00002e  0000              DCW      0x0000
                  |L3.48|
                          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 ***
