📄 root.c
字号:
/*
* FUNCTION NAME: ROOT_CreateTask()
* PURPOSE:
*
* INPUT:
* None
* OUTPUT:
* None
* RETURN:
* NOne
* NOTES:
* None
*/
static void ROOT_CreateTask(void)
{
/* LOCAL VARIABLES DECLARATIONS */
#ifdef SYS_COMP_NIC
/* create the link scan for port status */
#ifndef ECOS_UITRON
if (S3C2510NIC_CreateTask() == FALSE)
{
printf("Link scan Task create fail\n");
}
#endif
#endif
/* create task for Interniche TCP/IP protocol stack */
#ifdef SYS_COMP_APMODE
INTERNICHE_TaskSpawn(root_isNotapmode);
#else
INTERNICHE_TaskSpawn();
#endif
#ifdef SYS_COMP_APMODE
if (root_isNotapmode)
{
#endif
#ifdef SYS_COMP_SNTPCLIENT
if(SNTP_MGR_CreateTask() == FALSE)
{
printf("SNTP Task create fail\n");
}
#endif
#ifdef SYS_COMP_DHCP_SERVER
if (DHCPSMGR_CreateTask() == FALSE)
{
printf("DHCP Server Task create fail\n");
}
#endif
#ifdef SYS_COMP_WEBCAM
if (WEBCAMMGR_CreateTask() == FALSE)
{
printf("WEBCAM Server Task create fail\n");
}
#endif
#ifdef SYS_COMP_WCM_MGR
/* create task for WCM */
if( WCM_MGR_CreateTask() == FALSE)
{
printf("WCM Task create fail\n");
}
#endif
/*Create task for the PPTP Client*/
#ifdef SYS_COMP_PPTP_CLIENT
PPTP_Client_Main();
#endif /*SYS_COMP_PPTP_CLIENT*/
#ifdef SYS_COMP_APMODE
}
#endif
/*Create task for the PPTP Server*/
#ifdef SYS_COMP_PPTP_SERVER
PPTPS_Server_Main();
#endif /*SYS_COMP_PPTP_SERVER*/
/*Create task for the Printer Server*/
#ifdef SYS_COMP_PRINTER_SERVER
if(PrinterServer_CreateTask()==FALSE)
{
printf("PrinterServer Task create fail\n");
}
#endif
#ifdef SYS_COMP_APMODE
if (root_isNotapmode)
{
#endif
#ifdef SYS_COMP_DDNS
if(DDNS_Create_Task()==FALSE)
{
printf("\nDDNS client Task create fail\n");
}
#endif
#ifdef SYS_COMP_APMODE
}
#endif
#ifdef SYS_COMP_USB
if(USB_HUB_CreateTask() == FALSE)
{
printf("create USB hub task fail\n");
}
if(USB_OHCI_CreateFreeBufTask() == FALSE)
{
printf("create USB free buffer task fail\n");
}
#endif
#ifdef SYS_COMP_APMODE
if (root_isNotapmode)
{
#endif
#ifdef SYS_COMP_SMTPC
if(SMTPC_CreateTask() ==FALSE)
{
printf("SMTPC create task fail\n");
}
#endif
#ifdef SYS_COMP_TASK1
if(TASK1_CreateTask() ==FALSE)
{
printf("TASK1 create task fail\n");
}
#endif
#ifdef SYS_COMP_TASK2
if(TASK2_CreateTask() ==FALSE)
{
printf("TASK2 create task fail\n");
}
#endif
#ifdef SYS_COMP_TASK3
if(TASK3_CreateTask() ==FALSE)
{
printf("TASK3 create task fail\n");
}
#endif
#ifdef SYS_COMP_RMGR
if(RMGR_CreateTask() ==FALSE)
{
printf("RMGR create task fail\n");
}
#endif
#ifdef SYS_COMP_APMODE
}
#endif
#ifdef SYS_COMP_WLMGMT
if (WLMGMT_CreateTask() == FALSE)
{
printf("Link scan Task create fail\n");
}
#endif
#ifdef SYS_COMP_APMODE
if (root_isNotapmode)
{
#endif
#ifdef SYS_COMP_DNSRELAY
/* create task for DNS Relay */
if( DNSRELAY_CreateTask() == FALSE)
{
printf("DNS Relay Task create fail\n");
}
#endif /* SYS_COMP_DNSRELAY */
#ifdef SYS_COMP_UPNP
/* create task for UPnP */
if( UPNP_CreateTask() == FALSE)
{
printf("UPnP Task create fail\n");
}
if( GENA_NOTIFY_CreateTask() == FALSE)
{
printf("Gena Notify Task create fail\n");
}
#endif /* SYS_COMP_UPNP */
#ifdef SYS_COMP_L2TP
/* create task for L2TP */
if( L2TP_CreateTask() == FALSE)
{
printf("L2TP Task create fail\n");
}
/* create task for L2TP_FP */
if( L2TP_FP_CreateTask() == FALSE)
{
printf("L2TP_FP Task create fail\n");
}
#endif /* SYS_COMP_L2TP_FP */
#ifdef SYS_COMP_APMODE
}
#endif
#ifdef SYS_COMP_NETMON
if (NETMON_CreateTask() == FALSE)
{
printf("NETMON: Task create fail!\n");
}
#endif
#ifdef SYS_COMP_WPA
if (WPA_CreateTask() == FALSE)
{
printf("WPA: Task create fail!\n");
}
#endif
#ifdef SYS_COMP_APMODE
if (root_isNotapmode)
{
#endif
#ifdef SYS_COMP_FASTROUTE
if (FASTRT_CreateTask() == FALSE)
{
printf("FASTROUTE: Task create fail!\n");
}
#endif
#ifdef SYS_COMP_BGLONG
if (BIGPOND_MGR_CreateTask() == FALSE)
{
printf("BIGPOND: Task create fail!\n");
}
#endif
#ifdef SYS_COMP_FTPSERVER
if(FTPS_MGR_CreateTask() == FALSE)
{
printf("\n\nFTPS create task fail!\n\n\n");
}
#endif
#ifdef SYS_COMP_APMODE
}
#endif
if (LED_CreateTask() == FALSE)
{
printf("ROOT LED: Task create fail!\n");
}
#ifdef SYS_COMP_APMODE
if (root_isNotapmode)
{
#endif
#ifdef SYS_COMP_VPN
if (IPSECMGR_CreateTask() == FALSE)
{
printf("VPN create task fail\n");
}
#endif
#ifdef SYS_COMP_SCTL
if(SCTL_CreateTask() ==FALSE)
{
printf("SCTL create task fail!\n");
}
#endif
#ifdef SYS_COMP_APMODE
}
#endif
} /* end of ROOT_CreateTask */
#ifdef SYS_COMP_MFS
/*
* FUNCTION NAME: ROOT_InitMFS()
* PURPOSE:
*
* INPUT:
* None
* OUTPUT:
* None
* RETURN:
* TRUE
* FALSE
* NOTES:
* None
*/
static BOOL ROOT_InitMFS(void)
{
MFS_Init(MFS_SYSMODE_RTOS);
{ /*
reserved flash memory sectors usage
*/
UI8 sector_list[8];
UI32 i, sector_id;
/* reserve for Loader */
i = 0;
for (sector_id=SYS_HWCFG_FM_LOADER_START; sector_id<=SYS_HWCFG_FM_LOADER_END; sector_id++)
{
sector_list[i++] = sector_id;
} /* end of for */
if (MFS_SetFileSector(MFS_FT_LOADER, sector_list, i) != MFS_RC_OK)
printf("\n\r\tMFS reserve Loader blocks fail!");
/* reserve for Board information */
if (SYS_HWCFG_FM_BINFO_START != SYS_HWCFG_FM_NO_SPECIFY)
{
i = 0;
for (sector_id=SYS_HWCFG_FM_BINFO_START; sector_id<=SYS_HWCFG_FM_BINFO_END; sector_id++)
{
sector_list[i++] = sector_id;
} /* end of for */
if (MFS_SetFileSector(MFS_FT_BINFO, sector_list, i) != MFS_RC_OK)
printf("\n\r\tMFS reserve Board Info blocks fail!");
}
/* reserve for system configuration */
if (SYS_HWCFG_FM_SYSCFG_START != SYS_HWCFG_FM_NO_SPECIFY)
{
i = 0;
for (sector_id=SYS_HWCFG_FM_SYSCFG_START; sector_id<=SYS_HWCFG_FM_SYSCFG_END; sector_id++)
{
sector_list[i++] = sector_id;
} /* end of for */
if (MFS_SetFileSector(MFS_FT_CONFIG, sector_list, i) != MFS_RC_OK)
printf("\n\r\tMFS reserve Config blocks fail!");
}
/* reserve for DHCP configuration */
if (SYS_HWCFG_FM_DHCPCFG_START != SYS_HWCFG_FM_NO_SPECIFY)
{
i = 0;
for (sector_id=SYS_HWCFG_FM_DHCPCFG_START; sector_id<=SYS_HWCFG_FM_DHCPCFG_END; sector_id++)
{
sector_list[i++] = sector_id;
} /* end of for */
if (MFS_SetFileSector(MFS_FT_DHCPCFG, sector_list, i) != MFS_RC_OK)
printf("\n\r\tMFS reserve DhcpCfg blocks fail!");
}
#ifdef SYS_COMP_SCTL
/* reserve for Surf-Control CPA cache */
if (SYS_HWCFG_FM_CPA_START != SYS_HWCFG_FM_NO_SPECIFY)
{
i = 0;
for (sector_id=SYS_HWCFG_FM_CPA_START; sector_id<=SYS_HWCFG_FM_CPA_END; sector_id++)
{
sector_list[i++] = sector_id;
} /* end of for */
if (MFS_SetFileSector(MFS_FT_CPA, sector_list, i) != MFS_RC_OK)
printf("\n\r\tMFS reserve CPA blocks fail!");
}
/* reserve for Surf-Control Custom cache */
if (SYS_HWCFG_FM_CTM_START != SYS_HWCFG_FM_NO_SPECIFY)
{
i = 0;
for (sector_id=SYS_HWCFG_FM_CTM_START; sector_id<=SYS_HWCFG_FM_CTM_END; sector_id++)
{
sector_list[i++] = sector_id;
} /* end of for */
if (MFS_SetFileSector(MFS_FT_CTM, sector_list, i) != MFS_RC_OK)
printf("\n\r\tMFS reserve CTM blocks fail!");
}
#endif /* SYS_COMP_SCTL */
/* reserve for module1 */
if (SYS_HWCFG_FM_MODULE1_START != SYS_HWCFG_FM_NO_SPECIFY)
{
i = 0;
for (sector_id=SYS_HWCFG_FM_MODULE1_START; sector_id<=SYS_HWCFG_FM_MODULE1_END; sector_id++)
{
sector_list[i++] = sector_id;
} /* end of for */
if (MFS_SetFileSector(MFS_FT_MODULE1, sector_list, i) != MFS_RC_OK)
printf("\n\r\tMFS reserve Module1 blocks fail!");
}
#ifdef SYS_HWCFG_FM_MODULE1_NEW_START
/* reserve for module1_new */
if (SYS_HWCFG_FM_MODULE1_NEW_START != SYS_HWCFG_FM_NO_SPECIFY)
{
i = 0;
for (sector_id=SYS_HWCFG_FM_MODULE1_NEW_START; sector_id<=SYS_HWCFG_FM_MODULE1_NEW_END; sector_id++)
{
sector_list[i++] = sector_id;
} /* end of for */
if (MFS_SetFileSector(MFS_FT_MODULE1_NEW, sector_list, i) != MFS_RC_OK)
printf("\n\r\tMFS reserve Module1_New blocks fail!");
}
#endif /* end of SYS_HWCFG_FM_MODULE1_NEW_START */
/* reserve for RESERVE1 */
if (SYS_HWCFG_FM_RESERVE1_START != SYS_HWCFG_FM_NO_SPECIFY)
{
i = 0;
for (sector_id=SYS_HWCFG_FM_RESERVE1_START; sector_id<=SYS_HWCFG_FM_RESERVE1_END; sector_id++)
{
sector_list[i++] = sector_id;
} /* end of for */
if (MFS_SetFileSector(MFS_FT_RESERVE1, sector_list, i) != MFS_RC_OK)
printf("\n\r\tMFS reserve Reserve1 blocks fail!");
}
/* reserve for RESERVE2 */
if (SYS_HWCFG_FM_RESERVE2_START != SYS_HWCFG_FM_NO_SPECIFY)
{
i = 0;
for (sector_id=SYS_HWCFG_FM_RESERVE2_START; sector_id<=SYS_HWCFG_FM_RESERVE2_END; sector_id++)
{
sector_list[i++] = sector_id;
} /* end of for */
if (MFS_SetFileSector(MFS_FT_RESERVE2, sector_list, i) != MFS_RC_OK)
printf("\n\r\tMFS reserve Reserve2 blocks fail!");
}
/* reserve for RESERVE3 */
if (SYS_HWCFG_FM_RESERVE3_START != SYS_HWCFG_FM_NO_SPECIFY)
{
i = 0;
for (sector_id=SYS_HWCFG_FM_RESERVE3_START; sector_id<=SYS_HWCFG_FM_RESERVE3_END; sector_id++)
{
sector_list[i++] = sector_id;
} /* end of for */
if (MFS_SetFileSector(MFS_FT_RESERVE3, sector_list, i) != MFS_RC_OK)
printf("\n\r\tMFS reserve Reserve3 blocks fail!");
}
}
return TRUE;
} /* end of ROOT_InitMFS() */
#endif /* SYS_COMP_MFS */
/*
* FUNCTION NAME: ROOT_Idle()
* PURPOSE:
*
* INPUT:
* None
* OUTPUT:
* None
* RETURN:
* TRUE
* FALSE
* NOTES:
* None
*/
static BOOL ROOT_Idle(void)
{
#ifdef SYS_COMP_SYSMGMT
#ifndef ECOS_UITRON
switch (SYSMGMT_DetectResetRequest())
{
case SYSMGMT_RESET_MODE_NONE: /* no reset */
break;
case SYSMGMT_RESET_MODE_SHORT: /* short reset */
printf("\n\r\n\r\tShort reset...\n\r");
dly_tsk(10);
SYSMGMT_RestartSystem(SYSMGMT_RESTART_MODE_COLD);
break;
case SYSMGMT_RESET_MODE_LONG: /* long reset */
printf("\n\r\n\r\tFactory reset...\n\r");
dly_tsk(10);
SYSMGMT_FactoryReset();
break;
default:
break;
} /* end of switch */
#endif /* ECOS_UITRON */
#endif /* SYS_COMP_SYSMGMT */
#ifdef SYS_COMP_WDT
SYSMGMT_KickSoftwareWDT();
#endif
#ifdef SYS_COMP_SYSIO
SYSIO_WorkAroundPatch();
#endif
return TRUE;
} /* end of ROOT_Idle() */
/* end of ROOT.C */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -