1. 不开hex也记录fpga发送次数
This commit is contained in:
parent
76dcf52325
commit
3bee353d86
17
src/HDLog.c
17
src/HDLog.c
@ -221,6 +221,11 @@ static uint8_t HDLogFpgaError(const uint8_t *data, int len, uint8_t isWrite, uin
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (HBitGet(sLogItem, kLogLevelHex) == 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
const char *opt = isWrite ? "write" : "read";
|
const char *opt = isWrite ? "write" : "read";
|
||||||
printf("%s fpga error, len[%d]\r\n", opt, len);
|
printf("%s fpga error, len[%d]\r\n", opt, len);
|
||||||
HDLogHex((const uint8_t *)(data), len, 1, NULL);
|
HDLogHex((const uint8_t *)(data), len, 1, NULL);
|
||||||
@ -230,13 +235,10 @@ static uint8_t HDLogFpgaError(const uint8_t *data, int len, uint8_t isWrite, uin
|
|||||||
|
|
||||||
uint8_t HDLogPrintFpgaHeader(const uint8_t *data, int len, uint8_t isWrite, uint8_t checkFpga)
|
uint8_t HDLogPrintFpgaHeader(const uint8_t *data, int len, uint8_t isWrite, uint8_t checkFpga)
|
||||||
{
|
{
|
||||||
if (HBitGet(sLogItem, kLogLevelHex) == 0)
|
const HBitType isPrint = HBitGet(sLogItem, kLogLevelHex);
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 记录打印时间
|
// 记录打印时间
|
||||||
if (sGetTime)
|
if (isPrint && sGetTime)
|
||||||
{
|
{
|
||||||
uint32_t ms = sGetTime();
|
uint32_t ms = sGetTime();
|
||||||
printf("[%d:%02d:%02d.%03d]\r\n", ms / 1000 / 60 / 60, ms / 1000 / 60 % 60, ms / 1000 % 60, ms % 1000);
|
printf("[%d:%02d:%02d.%03d]\r\n", ms / 1000 / 60 / 60, ms / 1000 / 60 % 60, ms / 1000 % 60, ms % 1000);
|
||||||
@ -294,6 +296,11 @@ uint8_t HDLogPrintFpgaHeader(const uint8_t *data, int len, uint8_t isWrite, uint
|
|||||||
typeCount = *GetFpgaType(type, isWrite);
|
typeCount = *GetFpgaType(type, isWrite);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (isPrint == 0)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
const char *opt = isWrite ? "write" : "read";
|
const char *opt = isWrite ? "write" : "read";
|
||||||
printf("%s[%u], typeCount[%u] - type[%02X], sendCard[%d], netPort[%d], cardNumber[%d], subFunc[%04X], group[%04X], effectLen[%d]\r\n", opt, count, typeCount, type, sendCard, port, recvCardNumber, subFunc, group, effectLen);
|
printf("%s[%u], typeCount[%u] - type[%02X], sendCard[%d], netPort[%d], cardNumber[%d], subFunc[%04X], group[%04X], effectLen[%d]\r\n", opt, count, typeCount, type, sendCard, port, recvCardNumber, subFunc, group, effectLen);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user