Merge branch 'temi54c1l8-fix_srdo_three_part'
This commit is contained in:
commit
61ff70e997
1 changed files with 36 additions and 0 deletions
|
|
@ -36,6 +36,10 @@
|
|||
#error CO_CONFIG_CRC16_ENABLE must be enabled.
|
||||
#endif
|
||||
|
||||
#ifdef CO_CONFORMANCE_TEST_TOOL_ADAPTATION
|
||||
#warning CO_CONFORMANCE_TEST_TOOL_ADAPTATION may be used only for conformance testing (because of CTT limitations)
|
||||
#endif
|
||||
|
||||
/* values for informationDirection and configurationValid */
|
||||
#define CO_SRDO_INVALID (0U)
|
||||
#define CO_SRDO_TX (1U)
|
||||
|
|
@ -137,6 +141,26 @@ OD_read_dummy(OD_stream_t *stream, void *buf, OD_size_t count, OD_size_t *countR
|
|||
return ODR_OK;
|
||||
}
|
||||
|
||||
#ifdef CO_CONFORMANCE_TEST_TOOL_ADAPTATION
|
||||
bool_t
|
||||
OD_not_write_same_value(OD_stream_t *stream, const void *buf, OD_size_t count) {
|
||||
// The conformance test tool does not recognize CANopen Safety and on all object dictionaty tries to read and write the same value
|
||||
OD_size_t countRead = 0;
|
||||
uint8_t bufRead[6] = { 0 };
|
||||
if( count > 6 ) {
|
||||
return false;
|
||||
}
|
||||
ODR_t returnCode = OD_readOriginal(stream, bufRead, count, &countRead);
|
||||
if ( returnCode != ODR_OK ){
|
||||
return false;
|
||||
}
|
||||
if ( memcmp(buf,bufRead,count) == 0 ){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
static ODR_t
|
||||
OD_read_SRDO_communicationParam(OD_stream_t* stream, void* buf, OD_size_t count, OD_size_t* countRead) {
|
||||
ODR_t returnCode = OD_readOriginal(stream, buf, count, countRead);
|
||||
|
|
@ -165,6 +189,12 @@ OD_write_SRDO_communicationParam(OD_stream_t* stream, const void* buf, OD_size_t
|
|||
return ODR_DEV_INCOMPAT;
|
||||
}
|
||||
|
||||
#ifdef CO_CONFORMANCE_TEST_TOOL_ADAPTATION
|
||||
if( OD_not_write_same_value(stream, buf, count) ) {
|
||||
return ODR_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
CO_SRDO_t* SRDO = stream->object;
|
||||
CO_SRDOGuard_t* SRDOGuard = SRDO->SRDOGuard;
|
||||
uint8_t bufCopy[4];
|
||||
|
|
@ -229,6 +259,12 @@ OD_write_SRDO_mappingParam(OD_stream_t* stream, const void* buf, OD_size_t count
|
|||
return ODR_DEV_INCOMPAT;
|
||||
}
|
||||
|
||||
#ifdef CO_CONFORMANCE_TEST_TOOL_ADAPTATION
|
||||
if( OD_not_write_same_value(stream, buf, count) ) {
|
||||
return ODR_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
CO_SRDO_t* SRDO = stream->object;
|
||||
CO_SRDOGuard_t* SRDOGuard = SRDO->SRDOGuard;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue