Skip to content

Commit

Permalink
Implement DAQ queue handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Apr 25, 2021
1 parent ceef9a0 commit 5e15f12
Show file tree
Hide file tree
Showing 11 changed files with 280 additions and 164 deletions.
28 changes: 15 additions & 13 deletions examples/simwin/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,20 @@ void memimnfo(void * ptr)
#define NUM_THREADS (3)

HANDLE threads[NUM_THREADS];

HANDLE quit_event;

HANDLE userTimer;
Xcp_OptionsType Xcp_Options;

typedef struct {
uint8_t value;
bool down;
uint32_t dummy;
} triangle_type;

triangle_type triangle = {0};
uint16_t randomValue;
float sine_wave = 1.0;

Xcp_OptionsType Xcp_Options;

int main(int argc, char **argv)
{
Expand Down Expand Up @@ -202,35 +209,30 @@ bool Xcp_HookFunction_GetId(uint8_t idType)
}
#endif // 0

typedef struct {
uint8_t value;
bool down;
uint32_t dummy;
} triangle_type;

triangle_type triangle = {0};
uint16_t randomValue;

/////////////////////////
/////////////////////////
/////////////////////////

const XcpDaq_ODTEntryType XcpDaq_PredefinedOdtEntries[] = {
XCP_DAQ_DEFINE_ODT_ENTRY(triangle),
XCP_DAQ_DEFINE_ODT_ENTRY(triangle.value),
XCP_DAQ_DEFINE_ODT_ENTRY(randomValue),
XCP_DAQ_DEFINE_ODT_ENTRY(sine_wave),
};


const XcpDaq_ODTType XcpDaq_PredefinedOdts[] = {
{
2, 0
}, {
1, 2,
}
};


const XcpDaq_ListConfigurationType XcpDaq_PredefinedLists[] = {
{
1, 0
2, 0
}
};

Expand Down
4 changes: 2 additions & 2 deletions examples/simwin/xcp_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
/*
** DAQ Settings.
*/
#define XCP_DAQ_CONFIG_TYPE XCP_DAQ_CONFIG_TYPE_DYNAMIC
#define XCP_DAQ_CONFIG_TYPE XCP_DAQ_CONFIG_TYPE_STATIC
#define XCP_DAQ_DTO_BUFFER_SIZE (40)
#define XCP_DAQ_ENABLE_PREDEFINED_LISTS XCP_OFF
#define XCP_DAQ_ENABLE_PREDEFINED_LISTS XCP_ON
#define XCP_DAQ_TIMESTAMP_UNIT (XCP_DAQ_TIMESTAMP_UNIT_1US)
#define XCP_DAQ_TIMESTAMP_SIZE (XCP_DAQ_TIMESTAMP_SIZE_4)
#define XCP_DAQ_ENABLE_PRESCALER XCP_OFF
Expand Down
8 changes: 0 additions & 8 deletions inc/xcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -847,14 +847,6 @@ typedef struct tagXcpDaq_EventType {
} XcpDaq_EventType;


typedef struct tagXcpDaq_DtoBufferStateType {
uint16_t numEntries;
uint16_t front;
uint16_t back;
uint16_t allocated;
} XcpDaq_DtoBufferStateType;


typedef struct tagXcpDaq_MessageType {
uint8_t dlc;
uint8_t const * data;
Expand Down

0 comments on commit 5e15f12

Please sign in to comment.