This commit is contained in:
andreika-git 2023-10-16 23:05:10 +03:00 committed by rusefillc
parent 293cb53c53
commit 55feb0f2df
1 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,9 @@ extern fifo_buffer<CANTxFrame, 1024> txCanBuffer;
#define DEFAULT_SIM_RPM 1200 #define DEFAULT_SIM_RPM 1200
#define DEFAULT_SNIFFER_THR 2500 #define DEFAULT_SNIFFER_THR 2500
//!!!
#define DEBUG_BENCH TRUE
extern WaveChart waveChart; extern WaveChart waveChart;
int getRemainingStack(thread_t*) { int getRemainingStack(thread_t*) {
@ -262,10 +265,18 @@ void handleWrapCan(TsChannelBase* tsChannel, char *data, int incomingPacketSize)
txCanBuffer.clear(); txCanBuffer.clear();
} }
#ifdef DEBUG_BENCH
printf("------ numPackets=%d\n", numPackets);
#endif
for (int i = 0; i < numPackets && incomingPacketSize >= (int)sizeof(CANRxFrame); i++) { for (int i = 0; i < numPackets && incomingPacketSize >= (int)sizeof(CANRxFrame); i++) {
CANRxFrame rxFrame; CANRxFrame rxFrame;
memcpy(&rxFrame, data, sizeof(rxFrame)); memcpy(&rxFrame, data, sizeof(rxFrame));
#ifdef DEBUG_BENCH
printf(" * EID=%08x\n", rxFrame.EID);
#endif
processCanRxMessage(0, rxFrame, getTimeNowNt()); processCanRxMessage(0, rxFrame, getTimeNowNt());
data += sizeof(rxFrame); data += sizeof(rxFrame);