📄 main.c
字号:
/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* This software is copyrighted by and is the sole property of
* VIA Networking Technologies, Inc. This software may only be used
* in accordance with the corresponding license agreement. Any unauthorized
* use, duplication, transmission, distribution, or disclosure of this
* software is expressly forbidden.
*
* This software is provided by VIA Networking Technologies, Inc. "as is"
* and any express or implied warranties, including, but not limited to, the
* implied warranties of merchantability and fitness for a particular purpose
* are disclaimed. In no event shall VIA Networking Technologies, Inc.
* be liable for any direct, indirect, incidental, special, exemplary, or
* consequential damages.
*
*
* File: main.c
*
* Purpose: Firmware main function
*
* Author: Tevin Chen
*
* Date: Feb 18, 2002
*
* Functions:
*
* Revision History:
*
*/
#if !defined(__TIMER_H__)
#include "timer.h"
#endif
#if !defined(__UART_H__)
#include "uart.h"
#endif
#if !defined(__TTY_H__)
#include "tty.h"
#endif
#if !defined(__SWSYS_H__)
#include "swsys.h"
#endif
#include "login.h"
#include "engine.h"
#include "pisystem.h"
#include "pitrunk.h"
#include "swmisc.h"
#ifdef __MODULE_WEB_SMART
#if !defined(__NETIF_H__)
#include "netif.h"
#endif
#if !defined(__HTTPD_H__)
#include "httpd.h"
#endif
#include "swpkt.h"
#include "weblib.h"
#endif
/*--------------------- Static Definitions ------------------------*/
/*--------------------- Static Types ------------------------------*/
/*--------------------- Static Macros -----------------------------*/
/*--------------------- Static Classes ----------------------------*/
/*--------------------- Static Variables --------------------------*/
/*--------------------- Static Functions --------------------------*/
/*--------------------- Export Variables --------------------------*/
/*--------------------- Import Functions --------------------------*/
#ifdef __MODULE_WEB_SMART
void NPARP_vTimer(void);
void TASKvHandleInPkt(void);
void NPTFTPC_vTftpClient(void);
#endif
void Main_Entry(void)
{
#ifdef __MODULE_WEB_SMART
// init tcp/ip
g_pfnWebPageFunc = (PFN_CALLBACK_WP)WEB_wProcHttpRequest;
ETHIF_vInit();
#endif
// init switch setting
g_pfnLinkChangeFunc = PITRK_vFailOverForLnkChg;
PISYS_vBoardBoot();
// hook ticker function into timer ISR
UART_vSetHookFunc(PIMISC_vHookAutoLogout);
// set timer to call every 1 min
if (TMR_iSetPeriodicTimer(6000, (PFN_CALLBACK_TIMER)TASKvLogoutTimer, NULL) == FAILED)
TTY_vPutStr("\n Set timer failed!\n");
#ifdef __MODULE_WEB_SMART
// set timer to call every 10 sec
if (TMR_iSetPeriodicTimer(1000, (PFN_CALLBACK_TIMER)NPARP_vTimer, NULL) == FAILED)
TTY_vPutStr("\n Set timer failed!\n");
// set timer to call every 10 ms
if (TMR_iSetPeriodicTimer(1, (PFN_CALLBACK_TIMER)TASKvHandleInPkt, NULL) == FAILED)
TTY_vPutStr("\n Set timer failed!\n");
// set timer to call every 100 ms
if (TMR_iSetPeriodicTimer(10, (PFN_CALLBACK_TIMER)NPTFTPC_vTftpClient, NULL) == FAILED)
TTY_vPutStr("\n Set timer failed!\n");
#endif
while (1) {
if (AUTHbLogin()) {
// it's a new login, don't set logout semaphore
g_bSemaphoreTtyLogout = FALSE;
ENGvEnterPage();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -