diff --git a/include/co_api.h b/include/co_api.h index 4c5f773..b41e13c 100644 --- a/include/co_api.h +++ b/include/co_api.h @@ -236,7 +236,7 @@ typedef uint32_t (*co_access_fn) ( const struct co_obj * obj, /**< object descriptor */ const struct co_entry * entry, /**< entry descriptor */ uint8_t subindex, /**< subindex */ - uint32_t * value /**< value to set or get */ + uint64_t * value /**< value to set or get */ ); /** Entry descriptor. Describes a subindex, or a series of subindexes diff --git a/include/co_obj.h b/include/co_obj.h index b4ba68f..c41d8e6 100644 --- a/include/co_obj.h +++ b/include/co_obj.h @@ -109,7 +109,7 @@ CO_EXPORT uint32_t co_od1001_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Pre-defined error field object (1003h) @@ -129,7 +129,7 @@ CO_EXPORT uint32_t co_od1003_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for COB-ID SYNC message object (1005h) @@ -149,7 +149,7 @@ CO_EXPORT uint32_t co_od1005_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Commmunication cycle object (1006h) @@ -169,7 +169,7 @@ CO_EXPORT uint32_t co_od1006_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Synchronous window length object (1007h) @@ -189,7 +189,7 @@ CO_EXPORT uint32_t co_od1007_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Guard time object (100Ch) @@ -209,7 +209,7 @@ CO_EXPORT uint32_t co_od100C_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Life time factor object (100Dh) @@ -229,7 +229,7 @@ CO_EXPORT uint32_t co_od100D_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Store Parameters object (1010h) @@ -249,7 +249,7 @@ CO_EXPORT uint32_t co_od1010_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Restore Default Parameters object (1011h) @@ -269,7 +269,7 @@ CO_EXPORT uint32_t co_od1011_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for COB-ID EMCY object (1014h) @@ -289,7 +289,7 @@ CO_EXPORT uint32_t co_od1014_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Inhibit time EMCY object (1015h) @@ -309,7 +309,7 @@ CO_EXPORT uint32_t co_od1015_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Consumer heartbeat time object (1016h) @@ -329,7 +329,7 @@ CO_EXPORT uint32_t co_od1016_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Producer heartbeat time object (1017h) @@ -349,7 +349,7 @@ CO_EXPORT uint32_t co_od1017_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Synchronous counter overflow value object (1019h) @@ -369,7 +369,7 @@ CO_EXPORT uint32_t co_od1019_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Verify Configuration object (1020h) @@ -389,7 +389,7 @@ CO_EXPORT uint32_t co_od1020_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Emergency consumer object (1028h) @@ -409,7 +409,7 @@ CO_EXPORT uint32_t co_od1028_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for Error behavior object (1029h) @@ -429,7 +429,7 @@ CO_EXPORT uint32_t co_od1029_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for RPDO communication parameter object (1400h - 15FFh) @@ -449,7 +449,7 @@ CO_EXPORT uint32_t co_od1400_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for RPDO mapping parameter object (1600h - 17FFh) @@ -469,7 +469,7 @@ CO_EXPORT uint32_t co_od1600_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for TPDO communication parameter object (1800h - 19FFh) @@ -489,7 +489,7 @@ CO_EXPORT uint32_t co_od1800_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); /** * Access function for RPDO mapping parameter object (1A00h - 1BFFh) @@ -509,7 +509,7 @@ CO_EXPORT uint32_t co_od1A00_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); #ifdef __cplusplus } diff --git a/src/co_emcy.c b/src/co_emcy.c index 01584ed..982e5ac 100644 --- a/src/co_emcy.c +++ b/src/co_emcy.c @@ -23,6 +23,7 @@ #include "co_nmt.h" #include "co_sdo.h" #include "co_util.h" +#include "co_obj.h" #include @@ -84,7 +85,7 @@ uint32_t co_od1001_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { if (event == OD_EVENT_READ) *value = co_emcy_error_register_get (net); @@ -97,14 +98,20 @@ uint32_t co_od1003_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { + uint32_t retval; + uint32_t v; switch (event) { case OD_EVENT_READ: - return co_emcy_error_get (net, subindex, value); + retval = co_emcy_error_get (net, subindex, &v); + if (retval == 0) + *value = v; + return retval; case OD_EVENT_WRITE: - return co_emcy_error_set (net, subindex, value); + v = *value; + return co_emcy_error_set (net, subindex, &v); case OD_EVENT_RESTORE: net->number_of_errors = 0; return 0; @@ -119,7 +126,7 @@ uint32_t co_od1014_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { switch (event) { @@ -145,7 +152,7 @@ uint32_t co_od1015_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { switch (event) { @@ -169,7 +176,7 @@ uint32_t co_od1028_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { uint32_t cobid; @@ -204,7 +211,7 @@ uint32_t co_od1029_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { switch (event) { diff --git a/src/co_heartbeat.c b/src/co_heartbeat.c index e265431..3c0aac7 100644 --- a/src/co_heartbeat.c +++ b/src/co_heartbeat.c @@ -23,6 +23,7 @@ #include "co_sdo.h" #include "co_emcy.h" #include "co_util.h" +#include "co_obj.h" #include @@ -32,7 +33,7 @@ uint32_t co_od1017_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { switch (event) { @@ -56,7 +57,7 @@ uint32_t co_od1016_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { co_heartbeat_t * heartbeat = &net->heartbeat[subindex - 1]; diff --git a/src/co_node_guard.c b/src/co_node_guard.c index 56b4f51..84a5e97 100644 --- a/src/co_node_guard.c +++ b/src/co_node_guard.c @@ -23,6 +23,7 @@ #include "co_sdo.h" #include "co_emcy.h" #include "co_util.h" +#include "co_obj.h" uint32_t co_od100C_fn ( co_net_t * net, @@ -30,7 +31,7 @@ uint32_t co_od100C_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { switch (event) { @@ -54,7 +55,7 @@ uint32_t co_od100D_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { switch (event) { diff --git a/src/co_od.c b/src/co_od.c index 3eb18da..8da29be 100644 --- a/src/co_od.c +++ b/src/co_od.c @@ -19,6 +19,7 @@ #include "co_od.h" #include "co_sdo.h" #include "co_util.h" +#include "co_obj.h" #include #include @@ -139,15 +140,12 @@ uint32_t co_od_get_value ( if (obj->access) { - uint32_t v; - /* Call object access function. For subindex 0, function may return BAD_SUBINDEX to indicate that it did not handle the access. */ - abort = obj->access (net, OD_EVENT_READ, obj, entry, subindex, &v); + abort = obj->access (net, OD_EVENT_READ, obj, entry, subindex, value); if (!(subindex == 0 && abort == CO_SDO_ABORT_BAD_SUBINDEX)) { - *value = v; return abort; } } @@ -178,12 +176,32 @@ uint32_t co_od_get_value ( *value = co_atomic_get_uint16 (data); break; + case DTYPE_UNSIGNED24: + case DTYPE_INTEGER24: + *value = co_atomic_get_uint32 (data) & 0xFFFFFF; + break; + case DTYPE_REAL32: case DTYPE_UNSIGNED32: case DTYPE_INTEGER32: *value = co_atomic_get_uint32 (data); break; + case DTYPE_UNSIGNED40: + case DTYPE_INTEGER40: + *value = co_atomic_get_uint64 (data) & 0xFFFFFFFFFF; + break; + + case DTYPE_UNSIGNED48: + case DTYPE_INTEGER48: + *value = co_atomic_get_uint64 (data) & 0xFFFFFFFFFFFF; + break; + + case DTYPE_UNSIGNED56: + case DTYPE_INTEGER56: + *value = co_atomic_get_uint64 (data) & 0xFFFFFFFFFFFFFF; + break; + case DTYPE_REAL64: case DTYPE_UNSIGNED64: case DTYPE_INTEGER64: @@ -218,9 +236,8 @@ uint32_t co_od_set_value ( if (obj->access) { uint32_t result; - uint32_t v = value; - result = obj->access (net, OD_EVENT_WRITE, obj, entry, subindex, &v); + result = obj->access (net, OD_EVENT_WRITE, obj, entry, subindex, &value); co_od_notify (net, obj, entry, subindex); return result; } @@ -246,12 +263,32 @@ uint32_t co_od_set_value ( co_atomic_set_uint16 (data, value & UINT16_MAX); break; + case DTYPE_UNSIGNED24: + case DTYPE_INTEGER24: + co_atomic_set_uint32 (data, value & 0xFFFFFF); + break; + case DTYPE_REAL32: case DTYPE_UNSIGNED32: case DTYPE_INTEGER32: co_atomic_set_uint32 (data, value & UINT32_MAX); break; + case DTYPE_UNSIGNED40: + case DTYPE_INTEGER40: + co_atomic_set_uint64 (data, value & 0xFFFFFFFFFF); + break; + + case DTYPE_UNSIGNED48: + case DTYPE_INTEGER48: + co_atomic_set_uint64 (data, value & 0xFFFFFFFFFFFF); + break; + + case DTYPE_UNSIGNED56: + case DTYPE_INTEGER56: + co_atomic_set_uint64 (data, value & 0xFFFFFFFFFFFFFF); + break; + case DTYPE_REAL64: case DTYPE_UNSIGNED64: case DTYPE_INTEGER64: @@ -586,7 +623,7 @@ uint32_t co_od1010_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { uint32_t abort; @@ -647,7 +684,7 @@ uint32_t co_od1011_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { uint32_t abort; @@ -707,7 +744,7 @@ uint32_t co_od1020_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { if (subindex == 0 || subindex > obj->max_subindex) return CO_SDO_ABORT_BAD_SUBINDEX; diff --git a/src/co_pdo.c b/src/co_pdo.c index debf9d9..436a64a 100644 --- a/src/co_pdo.c +++ b/src/co_pdo.c @@ -26,6 +26,7 @@ #include "co_util.h" #include "co_sdo.h" #include "co_emcy.h" +#include "co_obj.h" #include @@ -355,7 +356,7 @@ uint32_t co_od1007_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { switch (event) { @@ -409,18 +410,24 @@ uint32_t co_od1400_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { + uint32_t retval; + uint32_t v; co_pdo_t * pdo = co_pdo_find (net, obj->index); CC_ASSERT (pdo != NULL); switch (event) { case OD_EVENT_READ: - return co_pdo_comm_get (net, pdo, subindex, value); + retval = co_pdo_comm_get (net, pdo, subindex, &v); + if (retval == 0) + *value = v; + return retval; case OD_EVENT_WRITE: - return co_pdo_comm_set (net, pdo, subindex, value, true); + v = *value; + return co_pdo_comm_set (net, pdo, subindex, &v, true); case OD_EVENT_RESTORE: pdo->cobid = @@ -443,18 +450,24 @@ uint32_t co_od1600_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { + uint32_t retval; + uint32_t v; co_pdo_t * pdo = co_pdo_find (net, obj->index); CC_ASSERT (pdo != NULL); switch (event) { case OD_EVENT_READ: - return co_pdo_map_get (net, pdo, subindex, value); + retval = co_pdo_map_get (net, pdo, subindex, &v); + if (retval == 0) + *value = v; + return retval; case OD_EVENT_WRITE: - return co_pdo_map_set (net, pdo, subindex, value, true); + v = *value; + return co_pdo_map_set (net, pdo, subindex, &v, true); case OD_EVENT_RESTORE: pdo->number_of_mappings = MAX_PDO_ENTRIES; @@ -472,18 +485,24 @@ uint32_t co_od1800_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { + uint32_t retval; + uint32_t v; co_pdo_t * pdo = co_pdo_find (net, obj->index); CC_ASSERT (pdo != NULL); switch (event) { case OD_EVENT_READ: - return co_pdo_comm_get (net, pdo, subindex, value); + retval = co_pdo_comm_get (net, pdo, subindex, &v); + if (retval == 0) + *value = v; + return retval; case OD_EVENT_WRITE: - return co_pdo_comm_set (net, pdo, subindex, value, false); + v = *value; + return co_pdo_comm_set (net, pdo, subindex, &v, false); case OD_EVENT_RESTORE: pdo->cobid = @@ -506,18 +525,24 @@ uint32_t co_od1A00_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { + uint32_t retval; + uint32_t v; co_pdo_t * pdo = co_pdo_find (net, obj->index); CC_ASSERT (pdo != NULL); switch (event) { case OD_EVENT_READ: - return co_pdo_map_get (net, pdo, subindex, value); + retval = co_pdo_map_get (net, pdo, subindex, &v); + if (retval == 0) + *value = v; + return retval; case OD_EVENT_WRITE: - return co_pdo_map_set (net, pdo, subindex, value, false); + v = *value; + return co_pdo_map_set (net, pdo, subindex, &v, false); case OD_EVENT_RESTORE: pdo->number_of_mappings = MAX_PDO_ENTRIES; diff --git a/src/co_sync.c b/src/co_sync.c index 96b8af4..8e75f8f 100644 --- a/src/co_sync.c +++ b/src/co_sync.c @@ -21,6 +21,7 @@ #include "co_pdo.h" #include "co_sdo.h" #include "co_util.h" +#include "co_obj.h" uint32_t co_od1005_fn ( co_net_t * net, @@ -28,7 +29,7 @@ uint32_t co_od1005_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { co_sync_t * sync = &net->sync; @@ -67,7 +68,7 @@ uint32_t co_od1006_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { co_sync_t * sync = &net->sync; @@ -98,7 +99,7 @@ uint32_t co_od1019_fn ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { co_sync_t * sync = &net->sync; diff --git a/test/test_emcy.cpp b/test/test_emcy.cpp index 7766d80..3420acb 100644 --- a/test/test_emcy.cpp +++ b/test/test_emcy.cpp @@ -47,7 +47,7 @@ TEST_F (EmcyTest, MsgFormat) TEST_F (EmcyTest, AddError) { - uint32_t value; + uint64_t value; uint32_t result; // Test insertion at head of error list @@ -108,7 +108,7 @@ TEST_F (EmcyTest, MaxErrors) TEST_F (EmcyTest, ClearErrors) { uint32_t result; - uint32_t value; + uint64_t value; // Fill error list for (uint16_t ix = 0; ix < MAX_ERRORS; ix++) @@ -139,7 +139,7 @@ TEST_F (EmcyTest, ClearErrors) TEST_F (EmcyTest, EmcyCobId) { uint32_t result; - uint32_t value; + uint64_t value; // Write invalid value value = 0x601; @@ -165,7 +165,7 @@ TEST_F (EmcyTest, EmcyConsumer) uint8_t emcy[8] = {0x30, 0x81, 0x03, 0x05, 0x04, 0x03, 0x02, 0x01}; uint8_t msef[5] = {0x05, 0x04, 0x03, 0x02, 0x01}; uint32_t result; - uint32_t value; + uint64_t value; net.emcy.cobids[0] = CO_COBID_INVALID; @@ -197,7 +197,7 @@ TEST_F (EmcyTest, NMTErrorBehavior) { const co_obj_t * obj1029 = find_obj (0x1029); uint32_t result; - uint32_t value; + uint64_t value; net.state = STATE_INIT; value = 0; @@ -297,7 +297,7 @@ TEST_F (EmcyTest, NMTErrorBehavior) TEST_F (EmcyTest, EmcyOverrun) { - uint32_t error_register; + uint64_t error_register; uint8_t expected[][8] = { {0x10, 0x81, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, @@ -335,7 +335,7 @@ TEST_F (EmcyTest, EmcyOverrun) TEST_F (EmcyTest, EmcyErrorPassive) { - uint32_t error_register; + uint64_t error_register; uint8_t expected[][8] = { {0x20, 0x81, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, @@ -373,7 +373,7 @@ TEST_F (EmcyTest, EmcyErrorPassive) TEST_F (EmcyTest, EmcyBusOff) { - uint32_t error_register; + uint64_t error_register; uint8_t expected[][8] = { {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, }; diff --git a/test/test_heartbeat.cpp b/test/test_heartbeat.cpp index a4e94c1..eca797f 100644 --- a/test/test_heartbeat.cpp +++ b/test/test_heartbeat.cpp @@ -26,7 +26,7 @@ class HeartbeatTest : public TestBase TEST_F (HeartbeatTest, OD1017) { - uint32_t value; + uint64_t value; uint32_t result; value = 1000; @@ -44,7 +44,7 @@ TEST_F (HeartbeatTest, OD1017) TEST_F (HeartbeatTest, OD1016) { - uint32_t value; + uint64_t value; uint32_t result; // Monitor node 1 diff --git a/test/test_node_guard.cpp b/test/test_node_guard.cpp index f7f643f..6b269ca 100644 --- a/test/test_node_guard.cpp +++ b/test/test_node_guard.cpp @@ -29,7 +29,7 @@ class NodeGuardTest : public TestBase TEST_F (NodeGuardTest, od100c_fn) { uint32_t result; - uint32_t value; + uint64_t value; net.node_guard.guard_time = 1000; @@ -50,7 +50,7 @@ TEST_F (NodeGuardTest, od100c_fn) TEST_F (NodeGuardTest, od100d_fn) { uint32_t result; - uint32_t value; + uint64_t value; net.node_guard.life_time_factor = 10; diff --git a/test/test_od.cpp b/test/test_od.cpp index 278b4e2..b41fdd7 100644 --- a/test/test_od.cpp +++ b/test/test_od.cpp @@ -31,7 +31,7 @@ extern "C" uint32_t cb2001 ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value) + uint64_t * value) { cb2001_calls++; @@ -217,7 +217,7 @@ TEST_F (OdTest, DefaultValues) TEST_F (OdTest, StoreThenLoadOD) { const co_obj_t * obj1020 = find_obj (0x1020); - uint32_t value; + uint64_t value; uint32_t result; // Store configuration date/time @@ -293,7 +293,7 @@ TEST_F (OdTest, StoreThenLoadNewOD) TEST_F (OdTest, OD1010) { const co_obj_t * obj1010 = find_obj (0x1010); - uint32_t value; + uint64_t value; uint32_t result; // Saves on command only @@ -332,7 +332,7 @@ TEST_F (OdTest, OD1010) TEST_F (OdTest, OD1011) { const co_obj_t * obj1011 = find_obj (0x1011); - uint32_t value; + uint64_t value; uint32_t result; // Device restores parameters diff --git a/test/test_pdo.cpp b/test/test_pdo.cpp index e7696a4..90aaf4b 100644 --- a/test/test_pdo.cpp +++ b/test/test_pdo.cpp @@ -240,7 +240,7 @@ TEST_F (PdoTest, CommParamsSet) { const co_obj_t * obj1400 = find_obj (0x1400); const co_obj_t * obj1800 = find_obj (0x1800); - uint32_t value; + uint64_t value; uint32_t result; // Bad COB ID @@ -312,7 +312,7 @@ TEST_F (PdoTest, CommParamsSet) TEST_F (PdoTest, CommParamsGet) { const co_obj_t * obj1400 = find_obj (0x1400); - uint32_t value; + uint64_t value; uint32_t result; net.pdo_rx[0].cobid = 0x207; @@ -354,7 +354,7 @@ TEST_F (PdoTest, CommParamsGet) TEST_F (PdoTest, CobId) { const co_obj_t * obj1800 = find_obj (0x1800); - uint32_t value; + uint64_t value; uint32_t result; // Invalidate (disable) cob-id, should succeed @@ -376,8 +376,8 @@ TEST_F (PdoTest, CobId) TEST_F (PdoTest, AddMapping) { const co_obj_t * obj1A00 = find_obj (0x1A00); - uint32_t mapping = 0x60000020; - uint32_t entries; + uint64_t mapping = 0x60000020; + uint64_t entries; uint32_t result; mock_co_obj_find_result = find_obj (0x6000); @@ -421,7 +421,7 @@ TEST_F (PdoTest, AddMapping) TEST_F (PdoTest, MappingGet) { const co_obj_t * obj1A00 = find_obj (0x1A00); - uint32_t value; + uint64_t value; uint32_t result; net.pdo_tx[0].cobid = CO_COBID_INVALID | 0x181; @@ -449,7 +449,7 @@ TEST_F (PdoTest, MappingGet) TEST_F (PdoTest, SyncWindowGetSet) { - uint32_t value; + uint64_t value; uint32_t result; value = 400; @@ -775,7 +775,7 @@ TEST_F (PdoTest, SparsePdo) const co_obj_t * obj1733 = find_obj (0x1733); const co_obj_t * obj1899 = find_obj (0x1899); const co_obj_t * obj1A99 = find_obj (0x1A99); - uint32_t value; + uint64_t value; uint32_t result; // Check PDO number mapping diff --git a/test/test_sync.cpp b/test/test_sync.cpp index 4dd3a5d..73c9d1b 100644 --- a/test/test_sync.cpp +++ b/test/test_sync.cpp @@ -26,7 +26,7 @@ class SyncTest : public TestBase TEST_F (SyncTest, CobIdSyncMessageConfiguration) { - uint32_t value; + uint64_t value; uint32_t result; value = 0x40000000; @@ -61,7 +61,7 @@ TEST_F (SyncTest, CobIdSyncMessageConfiguration) TEST_F (SyncTest, OD1006) { - uint32_t value; + uint64_t value; uint32_t result; value = 1000; @@ -77,7 +77,7 @@ TEST_F (SyncTest, OD1006) TEST_F (SyncTest, OD1019) { - uint32_t value; + uint64_t value; uint32_t result; value = 240; diff --git a/test/test_util.h b/test/test_util.h index 6625e03..2ad2ee3 100644 --- a/test/test_util.h +++ b/test/test_util.h @@ -30,7 +30,7 @@ extern "C" uint32_t cb2001 ( const co_obj_t * obj, const co_entry_t * entry, uint8_t subindex, - uint32_t * value); + uint64_t * value); class TestBase : public ::testing::Test {