📄 feeddog.c
字号:
/*------------------------------------------------------------------------------*/
/* Project Name: Multiplexer of MPEG-II */
/* Module Name: Alarm & Status detect */
/* Purpose : */
/* Author : LingYiChuan */
/* Date : 2000/9/20 */
/* Version : 1.0 */
/* Copyright HignSun Dvision, All Right Reservered. */
/*------------------------------------------------------------------------------*/
#include <icontrol\mpc8xx.h>
#include "constant.h"
#include "structure.h"
#include "command.h"
#include "tspack.h"
extern void my_Delay(unsigned long int dly_ms);
extern System_Data SystemData;
extern unsigned long MemCount;
extern unsigned char Connected;
extern unsigned char Has_Report_Device_Type;
extern void Display( const char *fmt, ... );
void RunLed(int H)
{
#if SC_SD_DEBUG_MODE==DBG_AP
if(H)
M_PortBDataReg&=0xFFFFFFDF;
else
M_PortBDataReg|=0x00000020;
#endif
}
void Feed(void)
{
WATCHDOG_REG=0xFF;
}
/*喂狗任务*/
void TK_Feed(void)
{
static unsigned char LED_State=0;
for(;;)
{
if(LED_State)
RunLed(1);
else
RunLed(0);
LED_State=!LED_State;
Feed();
/*Display(" Memcounter is %d, Connected=%d, HasReportDeviceType=%d \n",MemCount,Connected,Has_Report_Device_Type);*/
my_Delay(500);/*by xu*/
}
}
/*--------------------------------------------------------------------------*/
/* delete the feed dog task and rest system */
/*--------------------------------------------------------------------------*/
void SystemReset(void)
{
unsigned long tid;
#if SC_SD_DEBUG_MODE==DBG_AP
/*---------------------------------------------------------------------*/
/* 保存强制复位状态 */
/*---------------------------------------------------------------------*/
SystemData.ResetState.MPC860_State=STATE_SELFRESET;
SystemData.ResetState.C54_State =STATE_SELFRESET;
SystemData.ResetState.FPGA_State =STATE_SELFRESET;
SystemData.ResetState.Panel_State =STATE_SELFRESET;
SaveSystemData();
/*---------------------------------------------------------------------*/
/* 挂起喂狗任务,使系统复位 */
/*---------------------------------------------------------------------*/
while(t_ident(TN_FEEDDOG,0,&tid));
t_suspend(tid);
#endif
}
/*--------------------------------------------------------------------------*/
/* delete the feed dog task and rest system */
/*--------------------------------------------------------------------------*/
void SystemResetWithoutSave(void)
{
unsigned long tid;
#if SC_SD_DEBUG_MODE==DBG_AP
/*---------------------------------------------------------------------*/
/* 保存强制复位状态 */
/*---------------------------------------------------------------------*/
SystemData.ResetState.MPC860_State=STATE_SELFRESET;
SystemData.ResetState.C54_State =STATE_SELFRESET;
SystemData.ResetState.FPGA_State =STATE_SELFRESET;
SystemData.ResetState.Panel_State =STATE_SELFRESET;
/*---------------------------------------------------------------------*/
/* 挂起喂狗任务,使系统复位 */
/*---------------------------------------------------------------------*/
while(t_ident(TN_FEEDDOG,0,&tid));
t_suspend(tid);
#endif
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -