; 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\wlan_platform_common.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\wlan_platform_common.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\wlan_platform_common.crf ..\..\..\..\Platform\MCU\wlan_platform_common.c]
                          THUMB

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

                  host_platform_deinit PROC
;;;107    
;;;108    OSStatus host_platform_deinit( void )
000000  b510              PUSH     {r4,lr}
;;;109    {
;;;110    #if defined ( MICO_USE_WIFI_RESET_PIN )
;;;111        platform_gpio_init( &wifi_control_pins[WIFI_PIN_RESET], OUTPUT_PUSH_PULL );
000002  2103              MOVS     r1,#3
000004  4804              LDR      r0,|L1.24|
000006  f7fffffe          BL       platform_gpio_init
;;;112        host_platform_reset_wifi( true );  /* Start wifi chip in reset */
00000a  2001              MOVS     r0,#1
00000c  f7fffffe          BL       host_platform_reset_wifi
;;;113    #endif
;;;114        
;;;115    #if defined ( MICO_USE_WIFI_POWER_PIN )
;;;116        platform_gpio_init( &wifi_control_pins[WIFI_PIN_POWER], OUTPUT_PUSH_PULL );
;;;117        host_platform_power_wifi( false ); /* Start wifi chip with regulators off */
;;;118    #endif
;;;119    
;;;120        host_platform_deinit_wlan_powersave_clock( );
000010  f7fffffe          BL       host_platform_deinit_wlan_powersave_clock
;;;121    
;;;122        return kNoErr;
000014  2000              MOVS     r0,#0
;;;123    }
000016  bd10              POP      {r4,pc}
;;;124    
                          ENDP

                  |L1.24|
                          DCD      wifi_control_pins+0x8

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

                  host_platform_deinit_wlan_powersave_clock PROC
;;;140    
;;;141    OSStatus host_platform_deinit_wlan_powersave_clock( void )
000000  2000              MOVS     r0,#0
;;;142    {
;;;143    #ifndef MICO_USE_WIFI_32K_PIN
;;;144        return kNoErr;
;;;145    #else
;;;146        /* Tie the pin to ground */
;;;147        platform_gpio_init( &wifi_control_pins[WIFI_PIN_32K_CLK], OUTPUT_PUSH_PULL );
;;;148        platform_gpio_output_low( &wifi_control_pins[WIFI_PIN_32K_CLK] );
;;;149        return kNoErr;
;;;150    #endif
;;;151    }
000002  4770              BX       lr
;;;152    
                          ENDP


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

                  host_platform_init PROC
;;;90     
;;;91     OSStatus host_platform_init( void )
000000  b510              PUSH     {r4,lr}
;;;92     {
;;;93         host_platform_deinit_wlan_powersave_clock( );
000002  f7fffffe          BL       host_platform_deinit_wlan_powersave_clock
;;;94     
;;;95     #if defined ( MICO_USE_WIFI_RESET_PIN )
;;;96         platform_gpio_init( &wifi_control_pins[WIFI_PIN_RESET], OUTPUT_PUSH_PULL );
000006  2103              MOVS     r1,#3
000008  4803              LDR      r0,|L3.24|
00000a  f7fffffe          BL       platform_gpio_init
;;;97         host_platform_reset_wifi( true );  /* Start wifi chip in reset */
00000e  2001              MOVS     r0,#1
000010  f7fffffe          BL       host_platform_reset_wifi
;;;98     #endif
;;;99         
;;;100    #if defined ( MICO_USE_WIFI_POWER_PIN )
;;;101        platform_gpio_init( &wifi_control_pins[WIFI_PIN_POWER], OUTPUT_PUSH_PULL );
;;;102        host_platform_power_wifi( false ); /* Start wifi chip with regulators off */
;;;103    #endif
;;;104    
;;;105        return kNoErr;
000014  2000              MOVS     r0,#0
;;;106    }
000016  bd10              POP      {r4,pc}
;;;107    
                          ENDP

                  |L3.24|
                          DCD      wifi_control_pins+0x8

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

                  host_platform_is_in_interrupt_context PROC
;;;124    
;;;125    bool host_platform_is_in_interrupt_context( void )
000000  4804              LDR      r0,|L4.20|
;;;126    {
;;;127        /* From the ARM Cortex-M3 Techinical Reference Manual
;;;128         * 0xE000ED04   ICSR    RW [a]  Privileged  0x00000000  Interrupt Control and State Register */
;;;129        uint32_t active_interrupt_vector = (uint32_t)( SCB ->ICSR & 0x3fU );
000002  6800              LDR      r0,[r0,#0]
000004  f000013f          AND      r1,r0,#0x3f
;;;130    
;;;131        if ( active_interrupt_vector != 0 )
000008  b109              CBZ      r1,|L4.14|
;;;132        {
;;;133            return true;
00000a  2001              MOVS     r0,#1
                  |L4.12|
;;;134        }
;;;135        else
;;;136        {
;;;137            return false;
;;;138        }
;;;139    }
00000c  4770              BX       lr
                  |L4.14|
00000e  2000              MOVS     r0,#0                 ;137
000010  e7fc              B        |L4.12|
;;;140    
                          ENDP

000012  0000              DCW      0x0000
                  |L4.20|
                          DCD      0xe000ed04

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

                  host_platform_power_wifi PROC
;;;79     
;;;80     void host_platform_power_wifi( bool power_enabled )
000000  4770              BX       lr
;;;81     {
;;;82     #if   defined ( MICO_USE_WIFI_POWER_PIN ) && defined ( MICO_USE_WIFI_POWER_PIN_ACTIVE_HIGH )
;;;83         ( power_enabled == true ) ? platform_gpio_output_high( &wifi_control_pins[WIFI_PIN_POWER] ) : platform_gpio_output_low ( &wifi_control_pins[WIFI_PIN_POWER] );
;;;84     #elif defined ( MICO_USE_WIFI_POWER_PIN )
;;;85         ( power_enabled == true ) ? platform_gpio_output_low ( &wifi_control_pins[WIFI_PIN_POWER] ) : platform_gpio_output_high( &wifi_control_pins[WIFI_PIN_POWER] );
;;;86     #else
;;;87         UNUSED_PARAMETER( power_enabled );
;;;88     #endif
;;;89     }
;;;90     
                          ENDP


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

                  host_platform_reset_wifi PROC
;;;70     
;;;71     void host_platform_reset_wifi( bool reset_asserted )
000000  b510              PUSH     {r4,lr}
;;;72     {
000002  4604              MOV      r4,r0
;;;73     #if defined (MICO_USE_WIFI_RESET_PIN )
;;;74         ( reset_asserted == true ) ? platform_gpio_output_low( &wifi_control_pins[ WIFI_PIN_RESET ] ) : platform_gpio_output_high( &wifi_control_pins[ WIFI_PIN_RESET ] );
000004  2c01              CMP      r4,#1
000006  d103              BNE      |L6.16|
000008  4803              LDR      r0,|L6.24|
00000a  f7fffffe          BL       platform_gpio_output_low
00000e  e002              B        |L6.22|
                  |L6.16|
000010  4801              LDR      r0,|L6.24|
000012  f7fffffe          BL       platform_gpio_output_high
                  |L6.22|
;;;75     #else
;;;76         UNUSED_PARAMETER( reset_asserted );
;;;77     #endif
;;;78     }
000016  bd10              POP      {r4,pc}
;;;79     
                          ENDP

                  |L6.24|
                          DCD      wifi_control_pins+0x8

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

                  platform_get_wifi_image PROC
;;;205    
;;;206    uint32_t platform_get_wifi_image(unsigned char* buffer, uint32_t size, uint32_t offset)
000000  e92d43f8          PUSH     {r3-r9,lr}
;;;207    {
000004  4605              MOV      r5,r0
000006  460e              MOV      r6,r1
000008  4614              MOV      r4,r2
;;;208        uint32_t buffer_size;
;;;209        uint32_t read_address = offset;
00000a  9400              STR      r4,[sp,#0]
;;;210        mico_logic_partition_t *driver_partition = MicoFlashGetInfo( MICO_PARTITION_RF_FIRMWARE );
00000c  2004              MOVS     r0,#4
00000e  f7fffffe          BL       MicoFlashGetInfo
000012  4680              MOV      r8,r0
;;;211        
;;;212        if( image_size == 0)
000014  480d              LDR      r0,|L7.76|
000016  6800              LDR      r0,[r0,#0]  ; image_size
000018  b918              CBNZ     r0,|L7.34|
;;;213          image_size = driver_partition->partition_length;
00001a  490c              LDR      r1,|L7.76|
00001c  f8d8000c          LDR      r0,[r8,#0xc]
000020  6008              STR      r0,[r1,#0]  ; image_size
                  |L7.34|
;;;214        
;;;215        buffer_size = MIN(size, (image_size - offset));
000022  480a              LDR      r0,|L7.76|
000024  6800              LDR      r0,[r0,#0]  ; image_size
000026  1b00              SUBS     r0,r0,r4
000028  42b0              CMP      r0,r6
00002a  d901              BLS      |L7.48|
00002c  4630              MOV      r0,r6
00002e  e002              B        |L7.54|
                  |L7.48|
000030  4806              LDR      r0,|L7.76|
000032  6800              LDR      r0,[r0,#0]  ; image_size
000034  1b00              SUBS     r0,r0,r4
                  |L7.54|
000036  4607              MOV      r7,r0
;;;216    
;;;217        MicoFlashRead( MICO_PARTITION_RF_FIRMWARE, &read_address, buffer, buffer_size);
000038  463b              MOV      r3,r7
00003a  462a              MOV      r2,r5
00003c  4669              MOV      r1,sp
00003e  2004              MOVS     r0,#4
000040  f7fffffe          BL       MicoFlashRead
;;;218        return buffer_size;
000044  4638              MOV      r0,r7
;;;219    }
000046  e8bd83f8          POP      {r3-r9,pc}
;;;220    #endif
                          ENDP

00004a  0000              DCW      0x0000
                  |L7.76|
                          DCD      image_size

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

                  platform_get_wifi_image_size PROC
;;;176    
;;;177    uint32_t platform_get_wifi_image_size(void)
000000  b5f8              PUSH     {r3-r7,lr}
;;;178    {
;;;179    #define READ_LEN 2048
;;;180        mico_logic_partition_t *driver_partition = MicoFlashGetInfo( MICO_PARTITION_RF_FIRMWARE );
000002  2004              MOVS     r0,#4
000004  f7fffffe          BL       MicoFlashGetInfo
000008  4606              MOV      r6,r0
;;;181        uint32_t offset = driver_partition->partition_length;
00000a  68f0              LDR      r0,[r6,#0xc]
00000c  9000              STR      r0,[sp,#0]
;;;182        uint32_t *p;
;;;183        uint32_t *buf = (uint32_t *)malloc(READ_LEN);
00000e  f44f6000          MOV      r0,#0x800
000012  f7fffffe          BL       malloc
000016  4604              MOV      r4,r0
;;;184    
;;;185        uint32_t image_size = driver_partition->partition_length;
000018  68f7              LDR      r7,[r6,#0xc]
;;;186        do {
00001a  bf00              NOP      
                  |L8.28|
;;;187            offset -= READ_LEN; // Next block
00001c  9800              LDR      r0,[sp,#0]
00001e  f5a06000          SUB      r0,r0,#0x800
000022  9000              STR      r0,[sp,#0]
;;;188            MicoFlashRead( MICO_PARTITION_RF_FIRMWARE, &offset, (uint8_t *)buf, READ_LEN);
000024  f44f6300          MOV      r3,#0x800
000028  4622              MOV      r2,r4
00002a  4669              MOV      r1,sp
00002c  2004              MOVS     r0,#4
00002e  f7fffffe          BL       MicoFlashRead
;;;189            offset -= READ_LEN; // MicoFlashRead will increase FlashAddress READ_LEN, move back.
000032  9800              LDR      r0,[sp,#0]
000034  f5a06000          SUB      r0,r0,#0x800
000038  9000              STR      r0,[sp,#0]
;;;190            p = buf + (READ_LEN - 4)/sizeof(uint32_t);
00003a  f20475fc          ADD      r5,r4,#0x7fc
;;;191            while(p >= buf) {
00003e  e005              B        |L8.76|
                  |L8.64|
;;;192                if (*p != 0xFFFFFFFF) {
000040  6828              LDR      r0,[r5,#0]
000042  1c40              ADDS     r0,r0,#1
000044  b100              CBZ      r0,|L8.72|
;;;193                    goto EXIT;
000046  e007              B        |L8.88|
                  |L8.72|
;;;194                }
;;;195                p--;
000048  1f2d              SUBS     r5,r5,#4
;;;196                image_size -= 4;
00004a  1f3f              SUBS     r7,r7,#4
                  |L8.76|
00004c  42a5              CMP      r5,r4                 ;191
00004e  d2f7              BCS      |L8.64|
;;;197            }
;;;198        } while (offset > 0);
000050  9800              LDR      r0,[sp,#0]
000052  2800              CMP      r0,#0
000054  d1e2              BNE      |L8.28|
;;;199    
;;;200    EXIT:
000056  bf00              NOP      
                  |L8.88|
;;;201        free(buf);
000058  4620              MOV      r0,r4
00005a  f7fffffe          BL       free
;;;202        return image_size;
00005e  4638              MOV      r0,r7
;;;203    }
000060  bdf8              POP      {r3-r7,pc}
;;;204    
                          ENDP


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

                  image_size
                          DCD      0x00000000

;*** Start embedded assembler ***

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

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

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
