optical/SEW-EXA1/Users/App/workctrl/workctrl.c
2025-09-04 09:45:08 +08:00

87 lines
1.7 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//-------------------------------------------------------------------------------
// File Name: workctrl.c
// 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
//-------------------------------------------------------------------------------
#define _IN_WORKCTRL_C
#include "workctrl.h"
#include "inout.h"
#include "shell.h"
#include "delay.h"
#include "trigger.h"
#include "funcs.h"
#include "sewhead.h"
#include "debug.h"
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
void InitWorkCtrl(void)
{
DelayMs(1000);
memset(&g_workCtrl, 0, sizeof(WorkCtrl));
g_workCtrl.workSta = 1;
#if (BOARD_USE_FOR == SEW_HEAD)
InitSewHeadBoard();
#endif
#if (CONTROL_BUS == COMM_CAN)
InitCAN();
#endif
InitDebug();
//printf("Init work finish.\r\n");
}
//-------------------------------------------------------------------------------
void DelayRef(u32 ms)
{
while(ms != 0)
{
TriggerTask(); // 定时触发任务执行TCP 连接,缝纫任务
//CanBusTask(); // 输入输出任务执行
DelayMs(1);
ms--;
}
}
//-------------------------------------------------------------------------------
void WorkCtrlTask(void)
{
#if (BOARD_USE_FOR == SEW_HEAD)
SewHeadBoardTask();
#endif
#if (CONTROL_BUS == COMM_CAN)
CanBusTask();
#endif
}
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------