diff --git a/xcp_client/src/xcp_client.rs b/xcp_client/src/xcp_client.rs index ba0ad0c..a323224 100644 --- a/xcp_client/src/xcp_client.rs +++ b/xcp_client/src/xcp_client.rs @@ -122,7 +122,7 @@ impl std::fmt::Display for XcpError { write!(f, "{cmd:?}: XCP PRM ACTIVE") } CRC_CMD_UNKNOWN => { - write!(f, "XCP command ({} UNKNOWN", self.cmd) + write!(f, "Unknown XCP command: {cmd:?} ") } CRC_CMD_SYNTAX => { write!(f, "{cmd:?}: XCP command SYNTAX") diff --git a/xcp_lite.a2l b/xcp_lite.a2l index 57e52e6..ffcf564 100644 --- a/xcp_lite.a2l +++ b/xcp_lite.a2l @@ -165,7 +165,7 @@ /end IF_DATA -/begin MEASUREMENT array1 "" FLOAT64_IEEE NO_COMPU_METHOD 0 0 -1E15 1E15 PHYS_UNIT "" ECU_ADDRESS 0x4F74C ECU_ADDRESS_EXTENSION 2 MATRIX_DIM 256 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT array1 "" FLOAT64_IEEE NO_COMPU_METHOD 0 0 -1E15 1E15 PHYS_UNIT "" ECU_ADDRESS 0x4F7F4 ECU_ADDRESS_EXTENSION 2 MATRIX_DIM 256 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT /begin COMPU_METHOD channel.Conv "" LINEAR "%6.3" "Volt" COEFFS_LINEAR 1 0 /end COMPU_METHOD /begin MEASUREMENT channel "sine: f64" FLOAT64_IEEE channel.Conv 0 0 -1E15 1E15 PHYS_UNIT "Volt" ECU_ADDRESS 0xF0000 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 15 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT /begin COMPU_METHOD channel_1.Conv "" LINEAR "%6.3" "Volt" COEFFS_LINEAR 1 0 /end COMPU_METHOD @@ -188,21 +188,21 @@ /begin MEASUREMENT channel_8 "sine: f64" FLOAT64_IEEE channel_8.Conv 0 0 -1E15 1E15 PHYS_UNIT "Volt" ECU_ADDRESS 0xC0000 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 12 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT /begin COMPU_METHOD channel_9.Conv "" LINEAR "%6.3" "Volt" COEFFS_LINEAR 1 0 /end COMPU_METHOD /begin MEASUREMENT channel_9 "sine: f64" FLOAT64_IEEE channel_9.Conv 0 0 -1E15 1E15 PHYS_UNIT "Volt" ECU_ADDRESS 0xD0000 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 13 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter "" ULONG NO_COMPU_METHOD 0 0 0 4294967295 PHYS_UNIT "" ECU_ADDRESS 0x4FFF0 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter_i16 "wrapping counter: i16" SWORD NO_COMPU_METHOD 0 0 -32768 32767 PHYS_UNIT "" ECU_ADDRESS 0x4FFEE ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter_i32 "wrapping counter: i32" SLONG NO_COMPU_METHOD 0 0 -2147483648 2147483647 PHYS_UNIT "" ECU_ADDRESS 0x4FF74 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter_i64 "wrapping counter: i64" A_INT64 NO_COMPU_METHOD 0 0 -1E15 1E15 PHYS_UNIT "" ECU_ADDRESS 0x4FF54 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter_i8 "wrapping counter: i8" SBYTE NO_COMPU_METHOD 0 0 -128 127 PHYS_UNIT "" ECU_ADDRESS 0x4000A ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter_isize "wrapping counter: i64" A_INT64 NO_COMPU_METHOD 0 0 -1E15 1E15 PHYS_UNIT "" ECU_ADDRESS 0x4FF4C ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter_option_u16 "wrapping counter optional: u8" UWORD NO_COMPU_METHOD 0 0 0 65535 PHYS_UNIT "" ECU_ADDRESS 0x4FFEA ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter_u16 "wrapping counter: u16" UWORD NO_COMPU_METHOD 0 0 0 65535 PHYS_UNIT "" ECU_ADDRESS 0x40008 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter_u32 "wrapping counter: u32" ULONG NO_COMPU_METHOD 0 0 0 4294967295 PHYS_UNIT "" ECU_ADDRESS 0x4FF78 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter_u64 "wrapping counter: u64" A_UINT64 NO_COMPU_METHOD 0 0 0 1E15 PHYS_UNIT "" ECU_ADDRESS 0x4FF5C ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter_u8 "wrapping counter: u8" UBYTE NO_COMPU_METHOD 0 0 0 255 PHYS_UNIT "" ECU_ADDRESS 0x4000B ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT counter_usize "wrapping counter: u64" A_UINT64 NO_COMPU_METHOD 0 0 0 1E15 PHYS_UNIT "" ECU_ADDRESS 0x4FF64 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT mainloop_counter1 "" A_UINT64 NO_COMPU_METHOD 0 0 0 1E15 PHYS_UNIT "" ECU_ADDRESS 0x4 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 0 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT mainloop_local_var1 "" A_UINT64 NO_COMPU_METHOD 0 0 0 1E15 PHYS_UNIT "" ECU_ADDRESS 0x1FEDC ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 1 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT -/begin MEASUREMENT mainloop_local_var2 "" A_UINT64 NO_COMPU_METHOD 0 0 0 1E15 PHYS_UNIT "" ECU_ADDRESS 0x1FED4 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 1 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter "" ULONG NO_COMPU_METHOD 0 0 0 4294967295 PHYS_UNIT "" ECU_ADDRESS 0x4F7B8 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter_i16 "wrapping counter: i16" SWORD NO_COMPU_METHOD 0 0 -32768 32767 PHYS_UNIT "" ECU_ADDRESS 0x4F7C2 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter_i32 "wrapping counter: i32" SLONG NO_COMPU_METHOD 0 0 -2147483648 2147483647 PHYS_UNIT "" ECU_ADDRESS 0x4F7C8 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter_i64 "wrapping counter: i64" A_INT64 NO_COMPU_METHOD 0 0 -1E15 1E15 PHYS_UNIT "" ECU_ADDRESS 0x4F7D4 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter_i8 "wrapping counter: i8" SBYTE NO_COMPU_METHOD 0 0 -128 127 PHYS_UNIT "" ECU_ADDRESS 0x4F7BF ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter_isize "wrapping counter: i64" A_INT64 NO_COMPU_METHOD 0 0 -1E15 1E15 PHYS_UNIT "" ECU_ADDRESS 0x4F7E4 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter_option_u16 "wrapping counter optional: u8" UWORD NO_COMPU_METHOD 0 0 0 65535 PHYS_UNIT "" ECU_ADDRESS 0x4F7F0 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter_u16 "wrapping counter: u16" UWORD NO_COMPU_METHOD 0 0 0 65535 PHYS_UNIT "" ECU_ADDRESS 0x4F7C0 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter_u32 "wrapping counter: u32" ULONG NO_COMPU_METHOD 0 0 0 4294967295 PHYS_UNIT "" ECU_ADDRESS 0x4F7C4 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter_u64 "wrapping counter: u64" A_UINT64 NO_COMPU_METHOD 0 0 0 1E15 PHYS_UNIT "" ECU_ADDRESS 0x4F7CC ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter_u8 "wrapping counter: u8" UBYTE NO_COMPU_METHOD 0 0 0 255 PHYS_UNIT "" ECU_ADDRESS 0x4F7BE ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT counter_usize "wrapping counter: u64" A_UINT64 NO_COMPU_METHOD 0 0 0 1E15 PHYS_UNIT "" ECU_ADDRESS 0x4F7DC ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 4 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT mainloop_counter1 "" A_UINT64 NO_COMPU_METHOD 0 0 0 1E15 PHYS_UNIT "" ECU_ADDRESS 0xFFEC ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 0 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT mainloop_local_var1 "" A_UINT64 NO_COMPU_METHOD 0 0 0 1E15 PHYS_UNIT "" ECU_ADDRESS 0x1009C ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 1 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT +/begin MEASUREMENT mainloop_local_var2 "" A_UINT64 NO_COMPU_METHOD 0 0 0 1E15 PHYS_UNIT "" ECU_ADDRESS 0x100A4 ECU_ADDRESS_EXTENSION 2 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 1 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT /begin MEASUREMENT mainloop_map "2D map on heap" A_UINT64 NO_COMPU_METHOD 0 0 0 1E15 PHYS_UNIT "" ECU_ADDRESS 0x20000 ECU_ADDRESS_EXTENSION 2 MATRIX_DIM 16 16 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 2 /end DAQ_EVENT /end IF_DATA /end MEASUREMENT /begin GROUP mainloop_local "" ROOT /begin REF_MEASUREMENT mainloop_local_var1 mainloop_local_var2 /end REF_MEASUREMENT /end GROUP @@ -211,10 +211,10 @@ /begin GROUP task2_inst "" ROOT /begin REF_MEASUREMENT channel_1 channel_10 channel_2 channel_3 channel_4 channel_5 channel_6 channel_7 channel_8 channel_9 /end REF_MEASUREMENT /end GROUP -/begin CHARACTERISTIC static_cal_page.task1_cycle_time_us "task1 cycle time" VALUE 0x14502C U32 0 NO_COMPU_METHOD 0 4294967295 PHYS_UNIT "us" ECU_ADDRESS_EXTENSION 1 /end CHARACTERISTIC -/begin CHARACTERISTIC static_cal_page.task2_cycle_time_us "task2 cycle time" VALUE 0x145030 U32 0 NO_COMPU_METHOD 0 4294967295 PHYS_UNIT "us" ECU_ADDRESS_EXTENSION 1 /end CHARACTERISTIC -/begin CHARACTERISTIC static_vars.test_f64 "Test static f64" VALUE 0x145174 F32 0 NO_COMPU_METHOD -1000000000000 1000000000000 ECU_ADDRESS_EXTENSION 1 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 3 /end DAQ_EVENT /end IF_DATA /end CHARACTERISTIC -/begin CHARACTERISTIC static_vars.test_u32 "Test static u32" VALUE 0x145170 U32 0 NO_COMPU_METHOD 0 4294967295 ECU_ADDRESS_EXTENSION 1 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 3 /end DAQ_EVENT /end IF_DATA /end CHARACTERISTIC +/begin CHARACTERISTIC static_cal_page.task1_cycle_time_us "task1 cycle time" VALUE 0x13000C U32 0 NO_COMPU_METHOD 0 4294967295 PHYS_UNIT "us" ECU_ADDRESS_EXTENSION 1 /end CHARACTERISTIC +/begin CHARACTERISTIC static_cal_page.task2_cycle_time_us "task2 cycle time" VALUE 0x130010 U32 0 NO_COMPU_METHOD 0 4294967295 PHYS_UNIT "us" ECU_ADDRESS_EXTENSION 1 /end CHARACTERISTIC +/begin CHARACTERISTIC static_vars.test_f64 "Test static f64" VALUE 0x1303DC F32 0 NO_COMPU_METHOD -1000000000000 1000000000000 ECU_ADDRESS_EXTENSION 1 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 3 /end DAQ_EVENT /end IF_DATA /end CHARACTERISTIC +/begin CHARACTERISTIC static_vars.test_u32 "Test static u32" VALUE 0x1303D8 U32 0 NO_COMPU_METHOD 0 4294967295 ECU_ADDRESS_EXTENSION 1 /begin IF_DATA XCP /begin DAQ_EVENT FIXED_EVENT_LIST EVENT 3 /end DAQ_EVENT /end IF_DATA /end CHARACTERISTIC /begin CHARACTERISTIC CalPage.cycle_time_ms "main task cycle time" VALUE 0x80010000 U32 0 NO_COMPU_METHOD 0 4294967295 PHYS_UNIT "ms" /end CHARACTERISTIC /begin CHARACTERISTIC CalPage.run "" VALUE 0x80010004 U8 0 NO_COMPU_METHOD 0 1 PHYS_UNIT "bool" /end CHARACTERISTIC /begin CHARACTERISTIC CalPage.run1 "" VALUE 0x80010005 U8 0 NO_COMPU_METHOD 0 1 PHYS_UNIT "bool" /end CHARACTERISTIC diff --git a/xcplib/main_cfg.h b/xcplib/main_cfg.h index 876180a..12e54e2 100644 --- a/xcplib/main_cfg.h +++ b/xcplib/main_cfg.h @@ -12,7 +12,7 @@ // Logging #define OPTION_ENABLE_DBG_PRINTS Enable debug prints - #define OPTION_DEFAULT_DEBUG_LEVEL Default log level: 1 - Error, 2 - Warn, 3 - Info, 4 - Trace, 5 - Debug + #define OPTION_DEFAULT_DBG_LEVEL Default log level: 1 - Error, 2 - Warn, 3 - Info, 4 - Trace, 5 - Debug // Clock #define OPTION_CLOCK_EPOCH_ARB Arbitrary epoch or since 1.1.1970 @@ -26,30 +26,30 @@ #define OPTION_MTU UDP MTU #define OPTION_QUEUE_SIZE Size of the DAQ queue in XCP DTO/CRM packets (not messages as in V1.x) #define OPTION_DAQ_MEM_SIZE Size of memory for DAQ setup in bytes + #define OPTION_ENABLE_A2L_UPLOAD Enable GET_ID A2L upload */ // Application configuration: // More specific XCP configuration is in xcp_cfg.h (Protocol Layer) and xcptl_cfg.h (Transport Layer) -// Logging -#define OPTION_ENABLE_DBG_PRINTS -#define OPTION_DEFAULT_DBG_LEVEL 3 - // XCP options #define OPTION_ENABLE_TCP #define OPTION_ENABLE_UDP #define OPTION_MTU 1500 #define OPTION_QUEUE_SIZE 200 #define OPTION_DAQ_MEM_SIZE (3000*5) +#define OPTION_ENABLE_A2L_UPLOAD #if defined(_LINUX) && !defined(_MACOS) #define XCP_SERVER_FORCEFULL_TERMINATION // @@@@ #endif - // Platform options // Clock #define OPTION_CLOCK_EPOCH_ARB #define OPTION_CLOCK_TICKS_1NS - \ No newline at end of file + + // Logging +#define OPTION_ENABLE_DBG_PRINTS +#define OPTION_DEFAULT_DBG_LEVEL 3 diff --git a/xcplib/src/platform.c b/xcplib/src/platform.c index 6aee9b1..2fd6a03 100644 --- a/xcplib/src/platform.c +++ b/xcplib/src/platform.c @@ -193,7 +193,7 @@ void mutexDestroy(MUTEX* m) { // Sockets /**************************************************************************/ -#if defined(OPTION_ENABLE_TCP) || defined(OPTION_ENABLE_TCP) +#if defined(OPTION_ENABLE_TCP) || defined(OPTION_ENABLE_UDP) #ifdef _LINUX diff --git a/xcplib/src/platform.h b/xcplib/src/platform.h index 9897083..138823c 100644 --- a/xcplib/src/platform.h +++ b/xcplib/src/platform.h @@ -92,7 +92,7 @@ typedef pthread_t tXcpThread; //------------------------------------------------------------------------------- // Platform independant socket functions -#if defined(OPTION_ENABLE_TCP) || defined(OPTION_ENABLE_TCP) +#if defined(OPTION_ENABLE_TCP) || defined(OPTION_ENABLE_UDP) #ifdef _LINUX // Linux sockets diff --git a/xcplib/src/xcpLite.h b/xcplib/src/xcpLite.h index 795d144..45ed21e 100644 --- a/xcplib/src/xcpLite.h +++ b/xcplib/src/xcpLite.h @@ -31,8 +31,8 @@ #ifdef XCP_ENABLE_DAQ_EVENT_LIST #ifndef XCP_MAX_EVENT_COUNT - #define XCP_MAX_EVENT_COUNT 16 // 0-15, 0xFFFF is reserved for undefined event - #elif XCP_MAX_EVENT_COUNT >= 16 + #define XCP_MAX_EVENT_COUNT 16 + #elif XCP_MAX_EVENT_COUNT > 16 #warning "Memory consumption of event list is high, consider reducing XCP_MAX_EVENT_COUNT or XCP_MAX_EVENT_NAME" #endif #ifndef XCP_MAX_EVENT_NAME diff --git a/xcplib/xcp_cfg.h b/xcplib/src/xcp_cfg.h similarity index 91% rename from xcplib/xcp_cfg.h rename to xcplib/src/xcp_cfg.h index b0d5dfa..5da9efd 100644 --- a/xcplib/xcp_cfg.h +++ b/xcplib/src/xcp_cfg.h @@ -52,6 +52,12 @@ // Undefined address extension #define XCP_ADDR_EXT_UNDEFINED 0xFF // Undefined address extension +// Make XcpEvent thread safe for same CAL event coming from different threads +// Needed for xcp-lite, because CalSeg cal sync events may come from different threads +#ifdef XCP_ENABLE_DYN_ADDRESSING + #define XCP_ENABLE_MULTITHREAD_CAL_EVENTS +#endif + /*----------------------------------------------------------------------------*/ /* Protocol features */ @@ -65,14 +71,15 @@ // #define XCP_ENABLE_SEED_KEY // Enable seed/key command -#define XCP_ENABLE_SERV_TEXT +#define XCP_ENABLE_SERV_TEXT // Enable SERV_TEXT events /*----------------------------------------------------------------------------*/ /* GET_ID command */ -// Uses addr_ext=0xFF to indicate addr space to upload A2L +#ifdef OPTION_ENABLE_A2L_UPLOAD #define XCP_ENABLE_IDT_A2L_UPLOAD // Upload A2L via XCP enabled - +// Uses addr_ext=0xFF to indicate addr space to upload A2L +#endif /*----------------------------------------------------------------------------*/ /* User defined command */ @@ -101,12 +108,8 @@ // Enable checking for clock monotony (no decreasing timestamp), use for debugging only, performance and memory impact // #define XCP_ENABLE_TIMESTAMP_CHECK - #endif -// Make XcpEvent thread safe for same CAL event coming from different threads -// Needed for xcp-lite, because CalSeg cal sync events may come from different threads -#define XCP_ENABLE_MULTITHREAD_CAL_EVENTS // Overrun indication via PID // Not needed for Ethernet, client detects data loss via transport layer counters @@ -120,14 +123,13 @@ #ifdef OPTION_DAQ_MEM_SIZE #define XCP_DAQ_MEM_SIZE OPTION_DAQ_MEM_SIZE #else -#define XCP_DAQ_MEM_SIZE (1024*4) // Amount of memory for DAQ tables, each ODT entry (e.g. measurement variable or memory block) needs 5 bytes +#define XCP_DAQ_MEM_SIZE (1024*5) // Amount of memory for DAQ tables, each ODT entry (e.g. measurement variable or memory block) needs 5 bytes #endif // Maximum number of DAQ lists // Numbers smaller than 256 will switch to 2 byte transport layer header DAQ_HDR_ODT_DAQB #define XCP_MAX_DAQ_COUNT 1024 - // Clock resolution //#define XCP_DAQ_CLOCK_32BIT // Use 32 Bit time stamps #define XCP_DAQ_CLOCK_64BIT // Use 64 Bit time stamps @@ -140,6 +142,10 @@ #define XCP_TIMESTAMP_TICKS 1 // ticks per unit #endif +// Grandmaster clock (optional, use XcpSetGrandmasterClockInfo, implement ApplXcpGetClockInfoGrandmaster) +#define XCP_ENABLE_PTP +#define XCP_DAQ_CLOCK_UIID { 0xdc,0xa6,0x32,0xFF,0xFE,0x7e,0x66,0xdc } + // Enable GET_DAQ_CLOCK_MULTICAST // #define XCP_ENABLE_DAQ_CLOCK_MULTICAST #ifdef XCP_ENABLE_DAQ_CLOCK_MULTICAST @@ -151,6 +157,9 @@ //------------------------------------------------------------------------------- // Debug +// Enable logging +#define OPTION_ENABLE_DBG_PRINTS + // Enable extended error checks, performance penalty !!! #define XCP_ENABLE_TEST_CHECKS diff --git a/xcplib/xcptl_cfg.h b/xcplib/src/xcptl_cfg.h similarity index 100% rename from xcplib/xcptl_cfg.h rename to xcplib/src/xcptl_cfg.h