From 3b7ea57494d091e044704ae53b10d7e3687ee501 Mon Sep 17 00:00:00 2001 From: cfif Date: Wed, 5 Nov 2025 17:34:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inc/CanSerialPortFrameXCP.h | 16 +++++++++++----- Src/CanSerialPortFrameXCP.c | 3 +++ 2 files changed, 14 insertions(+), 5 deletions(-) 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; }