コード例 #1
0
ファイル: main.c プロジェクト: Maxim-DE/W5500_EVB
/**
 * @brief	Handle interrupt from 32-bit timer
 * @return	Nothing
 */
void TIMER32_0_IRQHandler(void)
{
	if (Chip_TIMER_MatchPending(LPC_TIMER32_0, 1))
	{
		Chip_TIMER_ClearMatch(LPC_TIMER32_0, 1);
		////////////////////////////////////////////////////////
		// SHOULD BE Added DHCP Timer Handler your 1s tick timer
		DHCP_time_handler(); 	// for DHCP timeout counter
		////////////////////////////////////////////////////////
	}
}
コード例 #2
0
ファイル: W7500x_it.c プロジェクト: Wiznet/W7500P
void SysTick_Handler(void)
{
	TimingDelay_Decrement();
	dhcp_1sec++;
	if(dhcp_1sec>1000)
	{
		DHCP_time_handler();
		dhcp_1sec =0;
	}

}
コード例 #3
0
ファイル: W7500x_it.c プロジェクト: alenyashka/W7500
void SysTick_Handler(void)
{
	TimingDelay_Decrement();
	systick++;
	if(systick % 1000 == 0) 
	{
		DHCP_time_handler();
		DNS_time_handler();
	}

}
コード例 #4
0
void DUALTIMER0_Handler(void)
{
    struct __network_info *net = (struct __network_info *)get_S2E_Packet_pointer()->network_info;
    struct __options *option = (struct __options *)&(get_S2E_Packet_pointer()->options);
    uint32_t count = 0;

    if(DUALTIMER_GetIntStatus(DUALTIMER0_0))
    {
        DUALTIMER_IntClear(DUALTIMER0_0);

        mill_cnt++;

        /* UART Packing Timer Process */
        if(!nagle_flag && net->packing_time) {
            count = RingBuffer_GetCount(&rxring);

            if(count != 0 && count == uart_recv_count)
                nagle_time++;
            else {
                nagle_time = 0;
                uart_recv_count = count;
            }

            if(nagle_time >= net->packing_time) {
                nagle_flag = 1;
                nagle_time = 0;
            }
        }

        /* Reconnection Process */
        if(reconn_flag)
            reconn_time++;

        if(net->reconnection <= reconn_time) {
            reconn_flag = 0;
            reconn_time = 0;
        }

        /* Factory Reset Process */
        if(factory_flag) {
            factory_time++;

            if(Board_factory_get()) {
                factory_time = factory_flag = 0;
                NVIC_EnableIRQ(EXTI_IRQn);
            }

            if(factory_time >= 5000) {
                /* Factory Reset */
                set_S2E_Packet_to_factory_value();
                save_S2E_Packet_to_storage();

                NVIC_SystemReset();
            }
        }

        /* Serial Trigger Timer Process */
        if(trigger_flag == 1)
            trigger_time++;

        if(trigger_time >= 500) {
            trigger_flag = 2;
            trigger_time = 0;
        }

        /* Second Process */
        if((mill_cnt % 1000) == 0) {
            LED_Toggle(LED2);
            mill_cnt = 0;
            sec_cnt++;

            /* DHCP Process */
            if(option->dhcp_use)
                DHCP_time_handler();

            /* DNS Process */
            if(option->dns_use) {
                DNS_time_handler();
            }

            /* Inactive Time Process */
            if(inactive_flag == 1) {
                if((ether_recv_cnt == ether_recv_prev) && (ether_send_cnt == ether_send_prev))
                    inactive_time++;
                else {
                    ether_send_prev = ether_send_cnt;
                    ether_recv_prev = ether_recv_cnt;
                    inactive_time = 0;
                }
            }

            if(net->inactivity && (net->inactivity <= inactive_time)) {
                inactive_flag = 2;
                inactive_time = 0;
            }

            /* Connect Password Process */
            if(auth_flag)
                auth_time++;

            /* Minute Process */
            if((sec_cnt % 60) == 0) {
                sec_cnt = 0;

                /* DNS Process */
                if(option->dns_use) {
                    run_dns = 1;
                }
            }
        }

        mill_sec++;

        //if((mill_sec % 100) == 0) {
        //	LED_Toggle(LED1);
        //	LED_Toggle(LED2);
        //}

        if((mill_sec % 1000) == 0) {
            mill_sec = 0;
            tftp_timeout_handler();
        }

    }
}