1
0
Fork 0

Fix ODinterface, basic tests passed.

This commit is contained in:
Janez 2020-10-26 18:16:00 +01:00
parent 82eeec2d23
commit ace840fa6c
4 changed files with 18 additions and 14 deletions

View file

@ -130,10 +130,14 @@ CO_ReturnError_t CO_NMT_init(CO_NMT_t *NMT,
return CO_ERROR_OD_PARAMETERS;
}
NMT->HBproducerTime_us = (uint32_t)HBprodTime_ms * 1000;
OD_extensionIO_init(OD_1017_ProducerHbTime,
(void *) NMT,
OD_readOriginal,
OD_write_1017);
if (!OD_extensionIO_init(OD_1017_ProducerHbTime,
(void *) NMT,
OD_readOriginal,
OD_write_1017)
) {
CO_errinfo(HB_CANdevTx, OD_getIndex(OD_1017_ProducerHbTime));
return CO_ERROR_OD_PARAMETERS;
}
if (NMT->HBproducerTimer > NMT->HBproducerTime_us) {
NMT->HBproducerTimer = NMT->HBproducerTime_us;
}

View file

@ -255,7 +255,7 @@ ODR_t OD_getSub(const OD_entry_t *entry, uint8_t subIndex,
else if (odBasicType == ODT_REC) {
const OD_obj_record_t *odoArr = (const OD_obj_record_t *)odObjectOrig;
const OD_obj_record_t *odo = NULL;
for (int i; i< entry->subEntriesCount; i++) {
for (int i = 0; i< entry->subEntriesCount; i++) {
if (odoArr[i].subIndex == subIndex) {
odo = &odoArr[i];
break;

View file

@ -1320,6 +1320,14 @@ CO_NMT_reset_cmd_t CO_process(CO_t *co,
bool_t NMTisPreOrOperational = (NMTstate == CO_NMT_PRE_OPERATIONAL
|| NMTstate == CO_NMT_OPERATIONAL);
/* SDOserver */
for (uint8_t i = 0; i < CO_GET_CNT(SDO_SRV); i++) {
CO_SDOserver_process(co->SDOserver,
NMTisPreOrOperational,
timeDifference_us,
timerNext_us);
}
#if (CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_ENABLE
if (CO_GET_CNT(HB_CONS) == 1) {
CO_HBconsumer_process(co->HBcons,
@ -1337,14 +1345,6 @@ CO_NMT_reset_cmd_t CO_process(CO_t *co,
timerNext_us);
}
/* SDOserver */
for (uint8_t i = 0; i < CO_GET_CNT(SDO_SRV); i++) {
CO_SDOserver_process(co->SDOserver,
NMTisPreOrOperational,
timeDifference_us,
timerNext_us);
}
#if (CO_CONFIG_TIME) & CO_CONFIG_TIME_ENABLE
if (CO_GET_CNT(TIME) == 1) {
CO_TIME_process(co->TIME, timeDifference_us);

View file

@ -504,7 +504,7 @@ Other elements listed in the above XML example are required by the standard and
| 1014 | COB-ID EMCY | EM_PRODUCER, req | required | EM_PROD |
| 1015 | Inhibit time EMCY | EM_PROD_INHIBIT, opt | optional | |
| 1016 | Consumer heartbeat time | HB_CONS, req | optional | HB_CONS |
| 1017 | Producer heartbeat time | CANopen, NMT, req | optional | HB_PROD |
| 1017 | Producer heartbeat time | CANopen, NMT, req | required | HB_PROD |
| 1018 | Identity object | CANopen, LSS_SL, req | no | |
| 1019 | Synch. counter overflow value | SYNC, opt | no | |
| 1020 | Verify configuration | | | |