diff --git a/Inc/CanSerialPortFrameXCP.h b/Inc/CanSerialPortFrameXCP.h index c5c4dae..abe1bc0 100644 --- a/Inc/CanSerialPortFrameXCP.h +++ b/Inc/CanSerialPortFrameXCP.h @@ -72,6 +72,12 @@ typedef enum { } eXcpTypeCommand; +typedef enum { + XCP_STOP = 0, + XCP_START = 1, + XCP_SELECT = 2 + +} eXcpDAQ_Mode; typedef enum { XCP_STANDBY = 0 @@ -209,8 +215,8 @@ typedef struct __attribute__ ((packed)) { uint8_t ODT_ENTRY_NUMBER; } eXcpCommand_SET_DAQ_PTR; -#define MAX_DAO 1 -#define MAX_ODT 60 +#define MAX_DAO 6 +#define MAX_ODT 10 #define MAX_ODT_ENTRIES_SIZE 16 typedef struct { @@ -230,8 +236,8 @@ typedef struct { uint8_t TRANSMISSION_RATE_PRESCALER; uint8_t DAQ_LIST_PRIORITY; + eXcpDAQ_Mode MODE; uint8_t ODT_COUNT; - tXCP_ODT_ENTRIES ODT_NUMBER[MAX_ODT]; } tXCP_DAQ; @@ -288,8 +294,8 @@ typedef struct __attribute__ ((packed)) { typedef struct __attribute__ ((packed)) { eXcpTypeCommand COM; - uint8_t MODE; - uint8_t DAQ_LIST_NUMBER; + eXcpDAQ_Mode MODE; + uint16_t DAQ_LIST_NUMBER; } eXcpCommand_START_STOP_DAQ_LIST; typedef struct __attribute__ ((packed)) { diff --git a/Src/CanSerialPortFrameXCP.c b/Src/CanSerialPortFrameXCP.c index d45a04e..8517656 100644 --- a/Src/CanSerialPortFrameXCP.c +++ b/Src/CanSerialPortFrameXCP.c @@ -310,6 +310,8 @@ uint8_t XCP_FREE_DAQ_214(tCanSerialPortFrameXCP *env) { env->DAQ_COUNT = 0; for (uint16_t i = 0; i < MAX_DAO; ++i) { + + env->DAQ[i].MODE = XCP_STOP; env->DAQ[i].ODT_COUNT = 0; for (uint8_t j = 0; j < MAX_ODT; ++j) { @@ -417,6 +419,7 @@ uint8_t XCP_START_STOP_DAQ_LIST_222(tCanSerialPortFrameXCP *env) { return 2; } + env->DAQ[request->DAQ_LIST_NUMBER].MODE = request->MODE; return 0; }