

//-------------------------------------------------------------------------------
// File Name:	workctrl.h
// Brief: 
// Version:		1.0.0
// Create Date: 2018/03/19
// Create by: 	Marshal Lee
// Copyright: 
//				Copyright (c)  2017, Richpeace Co., LTD.
//				All rights reserved.
//
// Modify by:	Marshal Lee
// Modify Date:	2018/03/19
//-------------------------------------------------------------------------------

#ifndef __WORKCTRL_H__
#define	__WORKCTRL_H__

#include "config.h"

#if (CONTROL_BUS == COMM_CAN)
#include "canwork.h"
#include "sewhdcontrol.h"
#endif

//----------------------------

typedef struct
{
	//-----------------------
	int workSta;	// 工作状态, = 0, 初始化状态; = 1, 遍历状态; = 2, 正常工作状态

	//-----------------------
	u8 device;		// 本节点设备类型
	u8 nodeId;		// 本节点ID

	u8 hostDev;		// 主节点设备类型
	u8 hostId;		// 主节点ID
#if (CONTROL_BUS == COMM_CAN)
	SewHeadControl curBdCtrl;
#endif
	//-----------------------
	int idxSetSta;
	
}WorkCtrl;

#ifdef _IN_WORKCTRL_C
WorkCtrl g_workCtrl;
#else
extern WorkCtrl g_workCtrl;
#endif

//----------------------------


void InitWorkCtrl(void);

void WorkCtrlTask(void);

//----------------------------

void DelayRef(u32 ms);

//----------------------------





#endif
