📄 pcsyn.c
字号:
/*
+-------------------------------------------------------------------+
| PROJECT: PC Synchronization
| $Workfile: pcsyn.c
| $Author: Talcon Hu
| CREATED: 18.05.2004
+-------------------------------------------------------------------+
*/
#define ENTITY_PCSYN
/*==== INCLUDES ===================================================*/
#if defined (NEW_FRAME)
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include "typedefs.h"
#include "pcm.h"
#include "pconst.cdg"
#include "mconst.cdg"
#include "message.h"
#include "ccdapi.h"
#include "vsi.h"
#include "custom.h"
#include "gsm.h"
#include "prim.h"
#include "pei.h"
#include "tok.h"
#else
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include "stddefs.h"
#include "pconst.cdg"
#include "mconst.cdg"
#include "message.h"
#include "ccdapi.h"
#include "custom.h"
#include "gsm.h"
#include "prim.h"
#include "vsi.h"
#include "pei.h"
#include "tok.h"
#endif
#include "ffs.h"
#include <string.h> /* needed for memcmp & memset */
#include "rvf_api.h"
#include "rv.cfg"
#include "pcsyn.h"
#include "pcsyn_protocol.h"
int g_codepcsynmem = 0;
#ifdef PCSYN_MEM_STATIC
BYTE mem_buffer[64000];
#endif
/*****************************************
$Description:
hisr of pcsyn serial
*********************************************/
void pcsyn_RX_process(BYTE *buffer,unsigned short size)
{
if(size >= PACKET_MINSIZE)
{
unsigned short l_buf = 8*size;
PALLOC_SDU ( hisr_pcsyn_ind, HISR_PCSYN_IND , l_buf);
hisr_pcsyn_ind->event_id = 0;
hisr_pcsyn_ind->sdu.o_buf = 0;
hisr_pcsyn_ind->sdu.l_buf = l_buf;
memcpy(hisr_pcsyn_ind->sdu.buf,buffer,size);
PSENDX (PCSYN, hisr_pcsyn_ind);
}
}
BYTE pcsyn_id;
int pcsyn_init (void)
{
static int pcsyninit = 0;
if(pcsyninit )return 1;
rvt_register_id("L1",&pcsyn_id, pcsyn_RX_process) ;
pcsyninit = 1;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -