remove heartbeat and PackOutputData for key and scan data
This commit is contained in:
parent
7017c4c821
commit
a42c99e284
@ -6,7 +6,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#define CVERSION "1-3-3"
|
||||
#define CVERSION "1-3-9"
|
||||
#define VERSIONLEN 5
|
||||
|
||||
#define DEVICEMOD "SQ01-PDD-D1"
|
||||
|
||||
@ -155,7 +155,7 @@ void PackOutputData(uint8_t type)
|
||||
*/
|
||||
void ReportData(int barType)
|
||||
{
|
||||
PackOutputData(gPackType);
|
||||
// PackOutputData(gPackType);
|
||||
AppUSBSendData(gOutputBuf, gOutputLen);
|
||||
ClearOutputLen();
|
||||
SetSysPackType();
|
||||
|
||||
26
App/main.c
26
App/main.c
@ -114,9 +114,10 @@ int main(void)
|
||||
|
||||
AppTIMxInterrupt(TIM6,2);//keyboard use
|
||||
|
||||
if(gConfgBuf.heartbeatInterval==0xff||gConfgBuf.heartbeatInterval==0)gConfgBuf.heartbeatInterval=3;
|
||||
HeartBeatTime = gConfgBuf.heartbeatInterval*1000;
|
||||
HeartBeatTick = TMC_GetTick();
|
||||
// if(gConfgBuf.heartbeatInterval==0xff||gConfgBuf.heartbeatInterval==0)gConfgBuf.heartbeatInterval=3;
|
||||
// HeartBeatTime = gConfgBuf.heartbeatInterval*1000;
|
||||
// HeartBeatTick = TMC_GetTick();
|
||||
// startShowDevicemod();
|
||||
|
||||
while(1)
|
||||
{
|
||||
@ -136,15 +137,16 @@ int main(void)
|
||||
gCfgUpdateFlag = 0;
|
||||
}
|
||||
|
||||
|
||||
//通信接收命令,指令分发
|
||||
nCmdCount = 0;
|
||||
while(RecieveData(&comData))
|
||||
{
|
||||
CommunicationCmdHandle(&comData);
|
||||
Delay_us(1000);
|
||||
nCmdCount++;
|
||||
if(nCmdCount>100)break;
|
||||
}
|
||||
// while(RecieveData(&comData))
|
||||
// {
|
||||
// CommunicationCmdHandle(&comData);
|
||||
// Delay_us(1000);
|
||||
// nCmdCount++;
|
||||
// if(nCmdCount>100)break;
|
||||
// }
|
||||
|
||||
//扫码成功,指令分发
|
||||
if(ScanModeReceiveData(&codeBar) == TRUE)
|
||||
@ -155,7 +157,7 @@ int main(void)
|
||||
}
|
||||
}
|
||||
|
||||
CheckHeartBeat();
|
||||
// CheckHeartBeat();
|
||||
|
||||
gFunTrace = 38;
|
||||
|
||||
@ -240,7 +242,7 @@ void HardwareInit(void)
|
||||
//串口初始化
|
||||
AppUartInit(gConfgBuf.uartBaudRate, UART_PARITY_MODE_NONE);
|
||||
//USB初始化
|
||||
gConfgBuf.comunitationType = USBDEVTYPE_VSP;
|
||||
gConfgBuf.comunitationType = USBDEVTYPE_HIDKBD;
|
||||
AppUSBInit(gConfgBuf.comunitationType);
|
||||
//蜂鸣器初始化
|
||||
AppBuzzerInit();
|
||||
|
||||
@ -395,16 +395,19 @@ void PayCodeReport(BarData *pCode)
|
||||
|
||||
} else {
|
||||
//扫码数据输出
|
||||
if(!gReceiveKey)
|
||||
{
|
||||
SetPackType(PACK_TYPEA);
|
||||
SetOutputData((uint8_t *)"NOKEY", 5);
|
||||
ReportData(pCode->bartype);
|
||||
} else {
|
||||
SetOutputData((uint8_t *)"SCAN", 4);
|
||||
SetOutputData((uint8_t *)POSOUTBUF, dataLen);
|
||||
ReportData(pCode->bartype);
|
||||
}
|
||||
// if(!gReceiveKey)
|
||||
// {
|
||||
// SetPackType(PACK_TYPEA);
|
||||
// SetOutputData((uint8_t *)"NOKEY", 5);
|
||||
// ReportData(pCode->bartype);
|
||||
// } else {
|
||||
// SetOutputData((uint8_t *)"SCAN", 4);
|
||||
// SetOutputData((uint8_t *)POSOUTBUF, dataLen);
|
||||
// ReportData(pCode->bartype);
|
||||
// }
|
||||
// SetOutputData((uint8_t *)"SCAN", 4);
|
||||
SetOutputData((uint8_t *)POSOUTBUF, dataLen);
|
||||
ReportData(pCode->bartype);
|
||||
}
|
||||
|
||||
#if(SUPPORT_VOICE)
|
||||
|
||||
35
Key/Key.c
35
Key/Key.c
@ -428,6 +428,16 @@ uint8_t Fn88ShowDevicemod(BarData *pCode)
|
||||
return TMC_NONE;
|
||||
}
|
||||
|
||||
uint8_t startShowDevicemod(void)
|
||||
{
|
||||
ClearOutputLen();
|
||||
SetOutputData((uint8_t *)"DEVICEMOD",9);
|
||||
SetPackType(PACK_TYPEA);
|
||||
SetOutputData(DEVICEMOD,DEVICEMODLEN);
|
||||
ReportData(Communication_Id);
|
||||
return TMC_NONE;
|
||||
}
|
||||
|
||||
uint8_t ChangeToCom(BarData *pCode)
|
||||
{
|
||||
if(USBVirtualCOM(pCode)==TMC_OK)
|
||||
@ -793,15 +803,20 @@ void Key_SendData(void)
|
||||
dat[j] = 0;
|
||||
}
|
||||
|
||||
if(!gReceiveKey)
|
||||
{
|
||||
SetPackType(PACK_TYPEA);
|
||||
SetOutputData((uint8_t *)"NOKEY",5);
|
||||
ReportData(Communication_Id);
|
||||
} else {
|
||||
SetOutputData((uint8_t *)"KEY",3);
|
||||
SetOutputData((uint8_t *)dat, j);
|
||||
ReportData(Communication_Id);
|
||||
}
|
||||
// if(!gReceiveKey)
|
||||
// {
|
||||
// SetPackType(PACK_TYPEA);
|
||||
// SetOutputData((uint8_t *)"NOKEY",5);
|
||||
// ReportData(Communication_Id);
|
||||
// } else {
|
||||
// SetOutputData((uint8_t *)"KEY",3);
|
||||
// SetOutputData((uint8_t *)dat, j);
|
||||
// ReportData(Communication_Id);
|
||||
// }
|
||||
|
||||
// SetOutputData((uint8_t *)"KEY",3);
|
||||
SetOutputData((uint8_t *)dat, j);
|
||||
SetOutputData((uint8_t *)"\r",2);
|
||||
ReportData(Communication_Id);
|
||||
}
|
||||
|
||||
|
||||
@ -109,6 +109,7 @@ void Key_Init(void);
|
||||
void Key_Event(void);
|
||||
void Key_SendData(void);
|
||||
void Key_Wait(void);
|
||||
uint8_t startShowDevicemod(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ void AppUSBSendData(u8* buf, u32 len)
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
if(g_bUsbDevType == USBDEVTYPE_HIDPOS)
|
||||
{
|
||||
//check if suspend
|
||||
@ -146,8 +146,8 @@ void AppUSBSendData(u8* buf, u32 len)
|
||||
{
|
||||
usbVspSendChars(buf, len);
|
||||
}
|
||||
*/
|
||||
usbVspSendChars(buf, len);
|
||||
|
||||
// usbVspSendChars(buf, len);
|
||||
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ void AppUSBSendData(u8* buf, u32 len)
|
||||
u32 AppUSBReceiveData(u8 *buf, u32 bufSize)
|
||||
{
|
||||
u32 len = 0;
|
||||
/*
|
||||
|
||||
if(g_bUsbDevType == USBDEVTYPE_HIDPOS)
|
||||
{
|
||||
len = usbHidPosRecvChars(buf, bufSize);
|
||||
@ -176,8 +176,8 @@ u32 AppUSBReceiveData(u8 *buf, u32 bufSize)
|
||||
{
|
||||
len = usbVspRecvChars(buf, bufSize);
|
||||
}
|
||||
*/
|
||||
len = usbVspRecvChars(buf, bufSize);
|
||||
|
||||
// len = usbVspRecvChars(buf, bufSize);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ CfgSetting const DefaultCfg =
|
||||
CFG_EXIST_FLAG,
|
||||
0x00, //SN
|
||||
ON, //设置码是否开启
|
||||
USBDEVTYPE_VSP, //0:uart 1:HIDKBD 2:VSP 3:HIDPOS
|
||||
USBDEVTYPE_HIDKBD, //0:uart 1:HIDKBD 2:VSP 3:HIDPOS
|
||||
BAUDRATE_115200, //支持9600,14400,38400,56000,57600,115200,128000,256000等
|
||||
|
||||
VOICE_FINISH_DINGDONG, //0:叮咚;1:扫码完成,开始打印;2:扫码成功
|
||||
@ -111,7 +111,7 @@ CfgSetting const DefaultCfg =
|
||||
0xFF, //支持的输入码制类型:0:GBK 2:UTF8 FF:自动识别
|
||||
0x00, //支持的输出码制类型:0:GBK 1:UNICODE 2:UTF8
|
||||
0x01, //是否支持发票模式 0:不支持 1:支持
|
||||
0x00, //结束符 0:无 1:换行回车 2:回车 3:TAB键 4:换行
|
||||
0x02, //结束符 0:无 1:换行回车 2:回车 3:TAB键 4:换行
|
||||
0x00, //扫码成功后在数据前添加数据的长度
|
||||
0x00, //扫码成功后在数据后添加数据的长度
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, //扫码成功后在数据前添加的数据
|
||||
|
||||
Loading…
Reference in New Issue
Block a user