Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 6, 2023
1 parent 4f01153 commit 9e50cba
Show file tree
Hide file tree
Showing 50 changed files with 6,832 additions and 7,156 deletions.
638 changes: 282 additions & 356 deletions checker/cl-tidy/xcp.c

Large diffs are not rendered by default.

257 changes: 128 additions & 129 deletions checker/cl-tidy/xcp_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,181 +29,180 @@
/*
** General Options.
*/
#define XCP_GET_ID_0 "BlueParrot XCP tests"
#define XCP_GET_ID_1 "Example_Project"
#define XCP_GET_ID_0 "BlueParrot XCP tests"
#define XCP_GET_ID_1 "Example_Project"

//#define XCP_BUILD_TYPE XCP_DEBUG_BUILD //
// XCP_RELEASE_BUILD
#define XCP_BUILD_TYPE XCP_RELEASE_BUILD
// #define XCP_BUILD_TYPE XCP_DEBUG_BUILD //
// XCP_RELEASE_BUILD
#define XCP_BUILD_TYPE XCP_RELEASE_BUILD

#define XCP_ENABLE_EXTERN_C_GUARDS XCP_OFF
#define XCP_ENABLE_EXTERN_C_GUARDS XCP_OFF

#define XCP_ENABLE_SLAVE_BLOCKMODE XCP_OFF
#define XCP_ENABLE_MASTER_BLOCKMODE XCP_OFF
#define XCP_ENABLE_SLAVE_BLOCKMODE XCP_OFF
#define XCP_ENABLE_MASTER_BLOCKMODE XCP_OFF

#define XCP_ENABLE_STIM XCP_OFF
#define XCP_ENABLE_STIM XCP_OFF

#define XCP_CHECKSUM_METHOD XCP_CHECKSUM_METHOD_XCP_CRC_16_CITT
#define XCP_CHECKSUM_CHUNKED_CALCULATION XCP_ON
#define XCP_CHECKSUM_CHUNK_SIZE (64)
#define XCP_CHECKSUM_MAXIMUM_BLOCK_SIZE (0) /* 0 ==> unlimited */
#define XCP_CHECKSUM_METHOD XCP_CHECKSUM_METHOD_XCP_CRC_16_CITT
#define XCP_CHECKSUM_CHUNKED_CALCULATION XCP_ON
#define XCP_CHECKSUM_CHUNK_SIZE (64)
#define XCP_CHECKSUM_MAXIMUM_BLOCK_SIZE (0) /* 0 ==> unlimited */

#define XCP_BYTE_ORDER XCP_BYTE_ORDER_INTEL
#define XCP_ADDRESS_GRANULARITY XCP_ADDRESS_GRANULARITY_BYTE
#define XCP_BYTE_ORDER XCP_BYTE_ORDER_INTEL
#define XCP_ADDRESS_GRANULARITY XCP_ADDRESS_GRANULARITY_BYTE

#define XCP_ENABLE_STATISTICS XCP_ON
#define XCP_ENABLE_STATISTICS XCP_ON

#define XCP_MAX_BS (0)
#define XCP_MIN_ST (0)
#define XCP_QUEUE_SIZE (0)
#define XCP_MAX_BS (0)
#define XCP_MIN_ST (0)
#define XCP_QUEUE_SIZE (0)

/*
** Resource Protection.
*/
#define XCP_PROTECT_CAL XCP_ON
#define XCP_PROTECT_PAG XCP_ON
#define XCP_PROTECT_DAQ XCP_OFF
#define XCP_PROTECT_STIM XCP_ON
#define XCP_PROTECT_PGM XCP_OFF
#define XCP_PROTECT_CAL XCP_ON
#define XCP_PROTECT_PAG XCP_ON
#define XCP_PROTECT_DAQ XCP_OFF
#define XCP_PROTECT_STIM XCP_ON
#define XCP_PROTECT_PGM XCP_OFF

/*
** DAQ Settings.
*/
#define XCP_DAQ_CONFIG_TYPE XCP_DAQ_CONFIG_TYPE_NONE
#define XCP_DAQ_DTO_BUFFER_SIZE (40)
#define XCP_DAQ_ENABLE_PREDEFINED_LISTS XCP_ON
#define XCP_DAQ_TIMESTAMP_UNIT (XCP_DAQ_TIMESTAMP_UNIT_10US)
#define XCP_DAQ_TIMESTAMP_SIZE (XCP_DAQ_TIMESTAMP_SIZE_4)
#define XCP_DAQ_ENABLE_PRESCALER XCP_OFF
#define XCP_DAQ_ENABLE_ADDR_EXT XCP_OFF
#define XCP_DAQ_ENABLE_BIT_OFFSET XCP_OFF
#define XCP_DAQ_ENABLE_PRIORITIZATION XCP_OFF
#define XCP_DAQ_ENABLE_ALTERNATING XCP_OFF
#define XCP_DAQ_ENABLE_CLOCK_ACCESS_ALWAYS XCP_ON

#define XCP_DAQ_ENABLE_DTO_PADDING XCP_OFF

#define XCP_DAQ_MAX_DYNAMIC_ENTITIES (100)
#define XCP_DAQ_MAX_EVENT_CHANNEL (3)
#define XCP_DAQ_CONFIG_TYPE XCP_DAQ_CONFIG_TYPE_NONE
#define XCP_DAQ_DTO_BUFFER_SIZE (40)
#define XCP_DAQ_ENABLE_PREDEFINED_LISTS XCP_ON
#define XCP_DAQ_TIMESTAMP_UNIT (XCP_DAQ_TIMESTAMP_UNIT_10US)
#define XCP_DAQ_TIMESTAMP_SIZE (XCP_DAQ_TIMESTAMP_SIZE_4)
#define XCP_DAQ_ENABLE_PRESCALER XCP_OFF
#define XCP_DAQ_ENABLE_ADDR_EXT XCP_OFF
#define XCP_DAQ_ENABLE_BIT_OFFSET XCP_OFF
#define XCP_DAQ_ENABLE_PRIORITIZATION XCP_OFF
#define XCP_DAQ_ENABLE_ALTERNATING XCP_OFF
#define XCP_DAQ_ENABLE_CLOCK_ACCESS_ALWAYS XCP_ON

#define XCP_DAQ_ENABLE_DTO_PADDING XCP_OFF

#define XCP_DAQ_MAX_DYNAMIC_ENTITIES (100)
#define XCP_DAQ_MAX_EVENT_CHANNEL (3)
#define XCP_DAQ_ENABLE_MULTIPLE_DAQ_LISTS_PER_EVENT XCP_OFF

#define XCP_DAQ_LIST_TYPE uint8_t
#define XCP_DAQ_ODT_TYPE uint8_t
#define XCP_DAQ_ODT_ENTRY_TYPE uint8_t
#define XCP_DAQ_LIST_TYPE uint8_t
#define XCP_DAQ_ODT_TYPE uint8_t
#define XCP_DAQ_ODT_ENTRY_TYPE uint8_t

/*
** PGM Settings.
*/
#define XCP_MAX_BS_PGM (0)
#define XCP_MIN_ST_PGM (0)
#define XCP_MAX_BS_PGM (0)
#define XCP_MIN_ST_PGM (0)

#define XCP_MAX_SECTOR_PGM UINT8(32)
#define XCP_PGM_PROPERIES XCP_PGM_ABSOLUTE_MODE
#define XCP_MAX_SECTOR_PGM UINT8(32)
#define XCP_PGM_PROPERIES XCP_PGM_ABSOLUTE_MODE

/*
** Optional Services.
*/
#define XCP_ENABLE_GET_COMM_MODE_INFO XCP_ON
#define XCP_ENABLE_GET_ID XCP_ON
#define XCP_ENABLE_SET_REQUEST XCP_OFF
#define XCP_ENABLE_GET_SEED XCP_ON
#define XCP_ENABLE_UNLOCK XCP_ON
#define XCP_ENABLE_SET_MTA XCP_ON
#define XCP_ENABLE_UPLOAD XCP_ON
#define XCP_ENABLE_SHORT_UPLOAD XCP_ON
#define XCP_ENABLE_BUILD_CHECKSUM XCP_ON
#define XCP_ENABLE_TRANSPORT_LAYER_CMD \
XCP_OFF /* TODO: TL dependend include file! */
#define XCP_ENABLE_USER_CMD XCP_OFF

#define XCP_ENABLE_CAL_COMMANDS XCP_ON

#define XCP_ENABLE_DOWNLOAD_NEXT XCP_OFF
#define XCP_ENABLE_DOWNLOAD_MAX XCP_OFF
#define XCP_ENABLE_SHORT_DOWNLOAD XCP_ON
#define XCP_ENABLE_MODIFY_BITS XCP_ON

#define XCP_ENABLE_PAG_COMMANDS XCP_OFF

#define XCP_ENABLE_GET_PAG_PROCESSOR_INFO XCP_OFF
#define XCP_ENABLE_GET_SEGMENT_INFO XCP_OFF
#define XCP_ENABLE_GET_PAGE_INFO XCP_OFF
#define XCP_ENABLE_SET_SEGMENT_MODE XCP_OFF
#define XCP_ENABLE_GET_SEGMENT_MODE XCP_OFF
#define XCP_ENABLE_COPY_CAL_PAGE XCP_OFF

#define XCP_ENABLE_DAQ_COMMANDS XCP_ON

#define XCP_ENABLE_GET_DAQ_CLOCK XCP_ON
#define XCP_ENABLE_READ_DAQ XCP_OFF
#define XCP_ENABLE_GET_DAQ_PROCESSOR_INFO XCP_ON
#define XCP_ENABLE_GET_DAQ_RESOLUTION_INFO XCP_ON
#define XCP_ENABLE_GET_DAQ_LIST_INFO XCP_ON
#define XCP_ENABLE_GET_DAQ_EVENT_INFO XCP_ON
#define XCP_ENABLE_FREE_DAQ XCP_ON
#define XCP_ENABLE_ALLOC_DAQ XCP_ON
#define XCP_ENABLE_ALLOC_ODT XCP_ON
#define XCP_ENABLE_ALLOC_ODT_ENTRY XCP_ON
#define XCP_ENABLE_WRITE_DAQ_MULTIPLE XCP_OFF

#define XCP_ENABLE_PGM_COMMANDS XCP_ON

#define XCP_ENABLE_GET_PGM_PROCESSOR_INFO XCP_ON
#define XCP_ENABLE_GET_SECTOR_INFO XCP_ON
#define XCP_ENABLE_PROGRAM_PREPARE XCP_ON
#define XCP_ENABLE_PROGRAM_FORMAT XCP_OFF
#define XCP_ENABLE_PROGRAM_NEXT XCP_OFF
#define XCP_ENABLE_PROGRAM_MAX XCP_OFF
#define XCP_ENABLE_PROGRAM_VERIFY XCP_OFF

#define XCP_ENABLE_EVENT_PACKET_API XCP_OFF
#define XCP_ENABLE_SERVICE_REQUEST_API XCP_OFF
#define XCP_ENABLE_GET_COMM_MODE_INFO XCP_ON
#define XCP_ENABLE_GET_ID XCP_ON
#define XCP_ENABLE_SET_REQUEST XCP_OFF
#define XCP_ENABLE_GET_SEED XCP_ON
#define XCP_ENABLE_UNLOCK XCP_ON
#define XCP_ENABLE_SET_MTA XCP_ON
#define XCP_ENABLE_UPLOAD XCP_ON
#define XCP_ENABLE_SHORT_UPLOAD XCP_ON
#define XCP_ENABLE_BUILD_CHECKSUM XCP_ON
#define XCP_ENABLE_TRANSPORT_LAYER_CMD XCP_OFF /* TODO: TL dependend include file! */
#define XCP_ENABLE_USER_CMD XCP_OFF

#define XCP_ENABLE_CAL_COMMANDS XCP_ON

#define XCP_ENABLE_DOWNLOAD_NEXT XCP_OFF
#define XCP_ENABLE_DOWNLOAD_MAX XCP_OFF
#define XCP_ENABLE_SHORT_DOWNLOAD XCP_ON
#define XCP_ENABLE_MODIFY_BITS XCP_ON

#define XCP_ENABLE_PAG_COMMANDS XCP_OFF

#define XCP_ENABLE_GET_PAG_PROCESSOR_INFO XCP_OFF
#define XCP_ENABLE_GET_SEGMENT_INFO XCP_OFF
#define XCP_ENABLE_GET_PAGE_INFO XCP_OFF
#define XCP_ENABLE_SET_SEGMENT_MODE XCP_OFF
#define XCP_ENABLE_GET_SEGMENT_MODE XCP_OFF
#define XCP_ENABLE_COPY_CAL_PAGE XCP_OFF

#define XCP_ENABLE_DAQ_COMMANDS XCP_ON

#define XCP_ENABLE_GET_DAQ_CLOCK XCP_ON
#define XCP_ENABLE_READ_DAQ XCP_OFF
#define XCP_ENABLE_GET_DAQ_PROCESSOR_INFO XCP_ON
#define XCP_ENABLE_GET_DAQ_RESOLUTION_INFO XCP_ON
#define XCP_ENABLE_GET_DAQ_LIST_INFO XCP_ON
#define XCP_ENABLE_GET_DAQ_EVENT_INFO XCP_ON
#define XCP_ENABLE_FREE_DAQ XCP_ON
#define XCP_ENABLE_ALLOC_DAQ XCP_ON
#define XCP_ENABLE_ALLOC_ODT XCP_ON
#define XCP_ENABLE_ALLOC_ODT_ENTRY XCP_ON
#define XCP_ENABLE_WRITE_DAQ_MULTIPLE XCP_OFF

#define XCP_ENABLE_PGM_COMMANDS XCP_ON

#define XCP_ENABLE_GET_PGM_PROCESSOR_INFO XCP_ON
#define XCP_ENABLE_GET_SECTOR_INFO XCP_ON
#define XCP_ENABLE_PROGRAM_PREPARE XCP_ON
#define XCP_ENABLE_PROGRAM_FORMAT XCP_OFF
#define XCP_ENABLE_PROGRAM_NEXT XCP_OFF
#define XCP_ENABLE_PROGRAM_MAX XCP_OFF
#define XCP_ENABLE_PROGRAM_VERIFY XCP_OFF

#define XCP_ENABLE_EVENT_PACKET_API XCP_OFF
#define XCP_ENABLE_SERVICE_REQUEST_API XCP_OFF

/*
** Transport-Layer specific Options (may not apply to every Transport).
*/
#if defined(KVASER_CAN)
#define XCP_TRANSPORT_LAYER XCP_ON_CAN
#define XCP_TRANSPORT_LAYER XCP_ON_CAN

#define XCP_ON_CAN_INBOUND_IDENTIFIER (0x102)
#define XCP_ON_CAN_OUTBOUND_IDENTIFIER (0x101)
#define XCP_ON_CAN_MAX_DLC_REQUIRED XCP_OFF
#define XCP_ON_CAN_INBOUND_IDENTIFIER (0x102)
#define XCP_ON_CAN_OUTBOUND_IDENTIFIER (0x101)
#define XCP_ON_CAN_MAX_DLC_REQUIRED XCP_OFF
#define XCP_ON_CAN_BROADCAST_IDENTIFIER (0x103)
#define XCP_ON_CAN_FREQ (canBITRATE_250K)
#define XCP_ON_CAN_BTQ (16)
#define XCP_ON_CAN_TSEG1 (14)
#define XCP_ON_CAN_TSEG2 (2)
#define XCP_ON_CAN_SJW (2)
#define XCP_ON_CAN_NOSAMP (1)
#define XCP_ON_CAN_FREQ (canBITRATE_250K)
#define XCP_ON_CAN_BTQ (16)
#define XCP_ON_CAN_TSEG1 (14)
#define XCP_ON_CAN_TSEG2 (2)
#define XCP_ON_CAN_SJW (2)
#define XCP_ON_CAN_NOSAMP (1)
#else
#define XCP_TRANSPORT_LAYER XCP_ON_ETHERNET
#define XCP_TRANSPORT_LAYER XCP_ON_ETHERNET

#define XCP_MAX_CTO (64) // (16)
#define XCP_MAX_DTO (64)
#define XCP_MAX_CTO (64) // (16)
#define XCP_MAX_DTO (64)

#define XCP_TRANSPORT_LAYER_LENGTH_SIZE (2)
#define XCP_TRANSPORT_LAYER_COUNTER_SIZE (2)
#define XCP_TRANSPORT_LAYER_LENGTH_SIZE (2)
#define XCP_TRANSPORT_LAYER_COUNTER_SIZE (2)
#define XCP_TRANSPORT_LAYER_CHECKSUM_SIZE (0)
#endif // KVASER_CAN

/*
** Customization Options.
*/
#define XCP_ENABLE_ADDRESS_MAPPER XCP_ON
#define XCP_ENABLE_ADDRESS_MAPPER XCP_ON
#define XCP_ENABLE_CHECK_MEMORY_ACCESS XCP_ON
#define XCP_REPLACE_STD_COPY_MEMORY XCP_OFF
#define XCP_REPLACE_STD_COPY_MEMORY XCP_OFF

#define XCP_ENABLE_GET_ID_HOOK XCP_OFF
#define XCP_ENABLE_GET_ID_HOOK XCP_OFF

/*
** Platform Specific Options.
*/
#define XCP_ENTER_CRITICAL() XcpHw_AcquireLock(XCP_HW_LOCK_XCP)
#define XCP_LEAVE_CRITICAL() XcpHw_ReleaseLock(XCP_HW_LOCK_XCP)
#define XCP_TL_ENTER_CRITICAL() XcpHw_AcquireLock(XCP_HW_LOCK_TL)
#define XCP_TL_LEAVE_CRITICAL() XcpHw_ReleaseLock(XCP_HW_LOCK_TL)
#define XCP_DAQ_ENTER_CRITICAL() XcpHw_AcquireLock(XCP_HW_LOCK_DAQ)
#define XCP_DAQ_LEAVE_CRITICAL() XcpHw_ReleaseLock(XCP_HW_LOCK_DAQ)
#define XCP_ENTER_CRITICAL() XcpHw_AcquireLock(XCP_HW_LOCK_XCP)
#define XCP_LEAVE_CRITICAL() XcpHw_ReleaseLock(XCP_HW_LOCK_XCP)
#define XCP_TL_ENTER_CRITICAL() XcpHw_AcquireLock(XCP_HW_LOCK_TL)
#define XCP_TL_LEAVE_CRITICAL() XcpHw_ReleaseLock(XCP_HW_LOCK_TL)
#define XCP_DAQ_ENTER_CRITICAL() XcpHw_AcquireLock(XCP_HW_LOCK_DAQ)
#define XCP_DAQ_LEAVE_CRITICAL() XcpHw_ReleaseLock(XCP_HW_LOCK_DAQ)
#define XCP_STIM_ENTER_CRITICAL()
#define XCP_STIM_LEAVE_CRITICAL()
#define XCP_PGM_ENTER_CRITICAL()
Expand All @@ -216,9 +215,9 @@
/*
** Application Settings.
*/
#define XCP_APP_TIMEBASE \
(10) /* Applications gets called every 'n' milliseconds, \
** 0 ==> free running. \
#define XCP_APP_TIMEBASE \
(10) /* Applications gets called every 'n' milliseconds, \
** 0 ==> free running. \
*/

#endif /* __XCP_CONFIG_H */
Loading

0 comments on commit 9e50cba

Please sign in to comment.