Skip to content

Commit

Permalink
xcp_daq.c: Fix debug build
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Dec 2, 2021
1 parent b432007 commit 042f1e6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/xcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,8 @@ void Xcp_DispatchCommand(Xcp_PduType const * const pdu)
const uint8_t cmd = pdu->data[0];
DBG_TRACE1("<- ");
//#if 0
printf("[%02u] ", pdu->len);
XcpUtl_Hexdump(pdu->data, pdu->len);
// printf("[%02u] ", pdu->len);
// XcpUtl_Hexdump(pdu->data, pdu->len);
//#endif
if (Xcp_State.connected == (bool)XCP_TRUE) {
/*DBG_PRINT2("CMD: [%02X]\n\r", cmd); */
Expand Down
41 changes: 19 additions & 22 deletions src/xcp_daq.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,10 @@ XCP_STATIC const uint8_t XcpDaq_AllocTransitionTable[5][4] = {
** Local Variables.
*/

XCP_STATIC XcpDaq_EntityType XcpDaq_Entities[XCP_DAQ_MAX_DYNAMIC_ENTITIES];

#if XCP_DAQ_ENABLE_DYNAMIC_LISTS == XCP_ON
XCP_STATIC XcpDaq_AllocStateType XcpDaq_AllocState;
XCP_STATIC XcpDaq_EntityType XcpDaq_Entities[XCP_DAQ_MAX_DYNAMIC_ENTITIES];
XCP_STATIC XCP_DAQ_ENTITY_TYPE XcpDaq_EntityCount = (XCP_DAQ_ENTITY_TYPE)0;
XCP_STATIC XCP_DAQ_ENTITY_TYPE XcpDaq_ListCount = (XCP_DAQ_ENTITY_TYPE)0;
XCP_STATIC XCP_DAQ_ENTITY_TYPE XcpDaq_OdtCount = (XCP_DAQ_ENTITY_TYPE)0;

XCP_STATIC XcpDaq_ListStateType XcpDaq_ListState ;
XCP_STATIC XcpDaq_ListConfigurationType XcpDaq_ListConfiguration;
#endif /* XCP_DAQ_ENABLE_DYNAMIC_LISTS */
Expand All @@ -140,6 +136,12 @@ XCP_STATIC uint8_t XcpDaq_ListForEvent[XCP_DAQ_MAX_EVENT_CHANNEL];
#error XCP_DAQ_ENABLE_MULTIPLE_DAQ_LISTS_PER_EVENT option currently not supported
#endif /* XCP_DAQ_ENABLE_MULTIPLE_DAQ_LISTS_PER_EVENT */

#if XCP_BUILD_TYPE == XCP_DEBUG_BUILD
XCP_STATIC XCP_DAQ_ENTITY_TYPE XcpDaq_EntityCount = (XCP_DAQ_ENTITY_TYPE)0;
XCP_STATIC XCP_DAQ_ENTITY_TYPE XcpDaq_ListCount = (XCP_DAQ_ENTITY_TYPE)0;
XCP_STATIC XCP_DAQ_ENTITY_TYPE XcpDaq_OdtCount = (XCP_DAQ_ENTITY_TYPE)0;
#endif /* XCP_BUILD_TYPE */


/*
**
Expand Down Expand Up @@ -535,7 +537,7 @@ void XcpDaq_TriggerEvent(uint8_t eventChannelNumber)
}
pid++;
XcpDaq_QueueEnqueue(offset, data);
XcpUtl_Hexdump(data, offset);
// XcpUtl_Hexdump(data, offset);
}
XcpHw_TransmitDtos();
}
Expand Down Expand Up @@ -669,7 +671,7 @@ bool XcpDaq_GetFirstPid(XcpDaq_ListIntegerType daqListNumber, XcpDaq_ODTIntegerT
** Debugging / Testing interface.
*/
#if XCP_BUILD_TYPE == XCP_DEBUG_BUILD
#if XCP_DAQ_ENABLE_DYNAMIC_LISTS == XCP_ON

void XcpDaq_GetCounts(XCP_DAQ_ENTITY_TYPE * entityCount, XCP_DAQ_ENTITY_TYPE * listCount, XCP_DAQ_ENTITY_TYPE * odtCount)
{
*entityCount = XcpDaq_EntityCount;
Expand All @@ -691,9 +693,15 @@ XcpDaq_EntityType * XcpDaq_GetDynamicEntity(uint16_t num)
{
return &XcpDaq_Entities[num];
}
#endif /* XCP_DAQ_ENABLE_DYNAMIC_LISTS */

void XcpDaq_QueueGetVar(XcpDaq_QueueType * var)
{
XcpUtl_MemCopy(var, &XcpDaq_Queue, sizeof(XcpDaq_QueueType));
}

#endif /* XCP_BUILD_TYPE */

//#if XCP_DAQ_ENABLE_DYNAMIC_LISTS == XCP_ON

#if XCP_DAQ_ENABLE_QUEUING == XCP_ON
void XcpDaq_QueueInit(void)
Expand All @@ -712,7 +720,7 @@ XCP_STATIC bool XcpDaq_QueueFull(void)
return ((XcpDaq_Queue.head + UINT8(1)) % UINT8(XCP_DAQ_QUEUE_SIZE + 1)) == XcpDaq_Queue.tail;
}

XCP_STATIC bool XcpDaq_QueueEmpty(void)
bool XcpDaq_QueueEmpty(void)
{
return XcpDaq_Queue.head == XcpDaq_Queue.tail;
}
Expand All @@ -732,7 +740,7 @@ XCP_STATIC bool XcpDaq_QueueEnqueue(uint16_t len, uint8_t const * data)
return (bool)XCP_TRUE;
}

XCP_STATIC bool XcpDaq_QueueDequeue(uint16_t * len, uint8_t * data)
bool XcpDaq_QueueDequeue(uint16_t * len, uint8_t * data)
{
uint16_t dto_len;

Expand All @@ -746,16 +754,5 @@ XCP_STATIC bool XcpDaq_QueueDequeue(uint16_t * len, uint8_t * data)
XcpDaq_Queue.tail = (XcpDaq_Queue.tail + UINT8(1)) % UINT8(XCP_DAQ_QUEUE_SIZE + 1);
return (bool)XCP_TRUE;
}


/*
** Debugging / Testing interface.
*/
#if XCP_BUILD_TYPE == XCP_DEBUG_BUILD
void XcpDaq_QueueGetVar(XcpDaq_QueueType * var)
{
XcpUtl_MemCopy(var, &XcpDaq_Queue, sizeof(XcpDaq_QueueType));
}
#endif

//#endif /* XCP_DAQ_ENABLE_DYNAMIC_LISTS */
#endif /* XCP_DAQ_ENABLE_QUEUING */

0 comments on commit 042f1e6

Please sign in to comment.