equal
deleted
inserted
replaced
53 |
53 |
54 UNS8 prp_j = 0x00; |
54 UNS8 prp_j = 0x00; |
55 UNS32 offset = 0x00000000; |
55 UNS32 offset = 0x00000000; |
56 const UNS8 *pMappingCount = (UNS8 *) TPDO_map->pSubindex[0].pObject; |
56 const UNS8 *pMappingCount = (UNS8 *) TPDO_map->pSubindex[0].pObject; |
57 |
57 |
58 pdo->cob_id = UNS16_LE(*(UNS32*)TPDO_com->pSubindex[1].pObject & 0x7FF); |
58 pdo->cob_id = (UNS16) UNS16_LE(*(UNS32*)TPDO_com->pSubindex[1].pObject & 0x7FF); |
59 pdo->rtr = NOT_A_REQUEST; |
59 pdo->rtr = NOT_A_REQUEST; |
60 |
60 |
61 MSG_WAR (0x3009, " PDO CobId is : ", |
61 MSG_WAR (0x3009, " PDO CobId is : ", |
62 *(UNS32 *) TPDO_com->pSubindex[1].pObject); |
62 *(UNS32 *) TPDO_com->pSubindex[1].pObject); |
63 MSG_WAR (0x300D, " Number of objects mapped : ", *pMappingCount); |
63 MSG_WAR (0x300D, " Number of objects mapped : ", *pMappingCount); |
508 /* Calls _sendPDOevent specifying it is not a sync event */ |
508 /* Calls _sendPDOevent specifying it is not a sync event */ |
509 return _sendPDOevent (d, 0); |
509 return _sendPDOevent (d, 0); |
510 } |
510 } |
511 |
511 |
512 UNS8 |
512 UNS8 |
513 sendOnePDOevent (CO_Data * d, UNS32 pdoNum) |
513 sendOnePDOevent (CO_Data * d, UNS8 pdoNum) |
514 { |
514 { |
515 UNS16 offsetObjdict; |
515 UNS16 offsetObjdict; |
516 Message pdo; |
516 Message pdo; |
517 if (!d->CurrentCommunicationState.csPDO || |
517 if (!d->CurrentCommunicationState.csPDO || |
518 (d->PDO_status[pdoNum].transmit_type_parameter & PDO_INHIBITED)) |
518 (d->PDO_status[pdoNum].transmit_type_parameter & PDO_INHIBITED)) |
519 { |
519 { |
520 return 0; |
520 return 0; |
521 } |
521 } |
522 |
522 |
523 offsetObjdict = d->firstIndex->PDO_TRS + pdoNum; |
523 offsetObjdict = (UNS16) (d->firstIndex->PDO_TRS + pdoNum); |
524 MSG_WAR (0x3968, " PDO is on EVENT. Trans type : ", |
524 MSG_WAR (0x3968, " PDO is on EVENT. Trans type : ", |
525 *pTransmissionType); |
525 *pTransmissionType); |
526 |
526 |
527 memset(&pdo, 0, sizeof(pdo)); |
527 memset(&pdo, 0, sizeof(pdo)); |
528 if (buildPDO (d, pdoNum, &pdo)) |
528 if (buildPDO (d, pdoNum, &pdo)) |
588 { |
588 { |
589 /* This is needed to avoid deletion of re-attribuated timer */ |
589 /* This is needed to avoid deletion of re-attribuated timer */ |
590 d->PDO_status[pdoNum].event_timer = TIMER_NONE; |
590 d->PDO_status[pdoNum].event_timer = TIMER_NONE; |
591 /* force emission of PDO by artificially changing last emitted */ |
591 /* force emission of PDO by artificially changing last emitted */ |
592 d->PDO_status[pdoNum].last_message.cob_id = 0; |
592 d->PDO_status[pdoNum].last_message.cob_id = 0; |
593 sendOnePDOevent (d, pdoNum); |
593 sendOnePDOevent (d, (UNS8) pdoNum); |
594 } |
594 } |
595 |
595 |
596 void |
596 void |
597 PDOInhibitTimerAlarm (CO_Data * d, UNS32 pdoNum) |
597 PDOInhibitTimerAlarm (CO_Data * d, UNS32 pdoNum) |
598 { |
598 { |
599 /* This is needed to avoid deletion of re-attribuated timer */ |
599 /* This is needed to avoid deletion of re-attribuated timer */ |
600 d->PDO_status[pdoNum].inhibit_timer = TIMER_NONE; |
600 d->PDO_status[pdoNum].inhibit_timer = TIMER_NONE; |
601 /* Remove inhibit flag */ |
601 /* Remove inhibit flag */ |
602 d->PDO_status[pdoNum].transmit_type_parameter &= ~PDO_INHIBITED; |
602 d->PDO_status[pdoNum].transmit_type_parameter &= ~PDO_INHIBITED; |
603 sendOnePDOevent (d, pdoNum); |
603 sendOnePDOevent (d, (UNS8) pdoNum); |
604 } |
604 } |
605 |
605 |
606 /*! |
606 /*! |
607 ** |
607 ** |
608 ** |
608 ** |
760 case 2: /* Changed transmition type */ |
760 case 2: /* Changed transmition type */ |
761 case 3: /* Changed inhibit time */ |
761 case 3: /* Changed inhibit time */ |
762 case 5: /* Changed event time */ |
762 case 5: /* Changed event time */ |
763 { |
763 { |
764 const indextable *TPDO_com = d->objdict + d->firstIndex->PDO_TRS; |
764 const indextable *TPDO_com = d->objdict + d->firstIndex->PDO_TRS; |
765 UNS8 numPdo = OD_entry - TPDO_com; /* number of the actual processed pdo-nr. */ |
765 UNS8 numPdo = (UNS8) (OD_entry - TPDO_com); /* number of the actual processed pdo-nr. */ |
766 |
766 |
767 /* Zap all timers and inhibit flag */ |
767 /* Zap all timers and inhibit flag */ |
768 d->PDO_status[numPdo].event_timer = |
768 d->PDO_status[numPdo].event_timer = |
769 DelAlarm (d->PDO_status[numPdo].event_timer); |
769 DelAlarm (d->PDO_status[numPdo].event_timer); |
770 d->PDO_status[numPdo].inhibit_timer = |
770 d->PDO_status[numPdo].inhibit_timer = |