Mistři v programování na #hovnokod

C/C++ #4395

IFDEF pro každý bug

void wifi_start()
{
    #if WOP_A4_WIFI_API_SERVICE
#ifdef JIRA_WIFI0215_288
    uint32_t actual_flags = 0;
#endif //JIRA_WIFI0215_288
    OS_ERROR_CODE_T error;
#ifdef JIRA_WIFI0215_225
#if 0	//Disable the DCT
    /* Init DCT_1 */
    init_dct( );
    wiced_rtos_delay_milliseconds(1000);
#endif
#endif //JIRA_WIFI0215_225
    
#ifdef JIRA_WIFI0215_509	
     wwd_wifi_set_ioctl_value( WLC_SET_INTERFERENCE_MODE, 3, WWD_STA_INTERFACE );
#endif
#ifdef JIRA_WIFI0215_219	
    /* Register callbacks */
    wiced_network_register_link_callback( wifi_link_up, wifi_link_down, WICED_STA_INTERFACE );
#endif //JIRA_WIFI0215_219        

#ifdef JIRA_WIFI0215_288
    wiced_rtos_delay_milliseconds(1000);

    /* init flags for wifi async events */    
    wiced_rtos_init_event_flags( &g_wifiAsynEvent );
#endif     
    
#ifdef JIRA_WIFI0215_387
    wiced_rtos_init_timer  ( &update_radio_level, RADIO_LEVEL_UPDATE_PERIOD_MS, check_radio_level_event, NULL );

    // wiced_rtos_start_timer ( &update_radio_level );
#endif

#ifdef JIRA_WIFI0215_443
    host_rtos_init_semaphore( &scan_connect_semaphore );
    host_rtos_set_semaphore ( &scan_connect_semaphore, WICED_FALSE );
    
    wiced_rtos_init_timer ( &try_to_reconnect, RECONNECT_INTERVAL, reconnect_to_ap, NULL );
#endif //JIRA_WIFI0215_443

    wiced_set_ap_info_callback(wiced_vat_to_ap_info);
    /* finish wifi initialize */        
    g_isWifiInit = 1;

#ifdef JIRA_WIFI0215_288    
    while(1)
    {
        /* waiting for attach/detach event and send unsolict msg */
#ifdef JIRA_WIFI0215_443
        error = OS_EventWait(&g_wifiAsynEvent, &actual_flags, WIFI_ASYNC_EVENT_ATTACH | WIFI_ASYNC_EVENT_DETACH | WIFI_ASYNC_EVENT_RECONNECT, OS_FLAG_EVENT_ANY | OS_FLAG_CLEAR, TX_WAIT_FOREVER);
        assert(error == OS_ERR_OK);
#else      
        tx_event_flags_get( &g_wifiAsynEvent, (WIFI_ASYNC_EVENT_ATTACH | WIFI_ASYNC_EVENT_DETACH), TX_OR_CLEAR, &actual_flags, TX_WAIT_FOREVER );
#endif //JIRA_WIFI0215_443
#ifdef JIRA_WIFI0215_650
	if(g_flagSolicitedResponse == 0)
#endif
        send_Solicited_msg_to_wm( actual_flags );
#ifdef JIRA_WIFI0215_458
	send_keep_alive_data_package(actual_flags);
#endif

        actual_flags = 0;
    }
#endif //JIRA_WIFI0215_288
    #endif
}

Anonymous,