MCPcopy Create free account
hub / github.com/CANopenNode/CANopenNode / CO_delete

Function CO_delete

CANopen.c:672–760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670}
671
672void
673CO_delete(CO_t* co) {
674 if (co == NULL) {
675 return;
676 }
677
678 CO_CANmodule_disable(co->CANmodule);
679
680 /* CANmodule */
681 CO_free(co->CANtx);
682 CO_free(co->CANrx);
683 CO_free(co->CANmodule);
684
685#if (CO_CONFIG_TRACE) & CO_CONFIG_TRACE_ENABLE
686 CO_free(co->trace);
687#endif
688
689#if ((CO_CONFIG_GTW)&CO_CONFIG_GTW_ASCII) != 0
690 CO_free(co->gtwa);
691#endif
692
693#if ((CO_CONFIG_LSS)&CO_CONFIG_LSS_MASTER) != 0
694 CO_free(co->LSSmaster);
695#endif
696
697#if ((CO_CONFIG_LSS)&CO_CONFIG_LSS_SLAVE) != 0
698 CO_free(co->LSSslave);
699#endif
700
701#if ((CO_CONFIG_SRDO)&CO_CONFIG_SRDO_ENABLE) != 0
702 CO_free(co->SRDO);
703 CO_free(co->SRDOGuard);
704#endif
705
706#if ((CO_CONFIG_GFC)&CO_CONFIG_GFC_ENABLE) != 0
707 CO_free(co->GFC);
708#endif
709
710#if ((CO_CONFIG_LEDS)&CO_CONFIG_LEDS_ENABLE) != 0
711 CO_free(co->LEDs);
712#endif
713
714#if ((CO_CONFIG_PDO)&CO_CONFIG_TPDO_ENABLE) != 0
715 CO_free(co->TPDO);
716#endif
717
718#if ((CO_CONFIG_PDO)&CO_CONFIG_RPDO_ENABLE) != 0
719 CO_free(co->RPDO);
720#endif
721
722#if ((CO_CONFIG_SYNC)&CO_CONFIG_SYNC_ENABLE) != 0
723 CO_free(co->SYNC);
724#endif
725
726#if ((CO_CONFIG_TIME)&CO_CONFIG_TIME_ENABLE) != 0
727 CO_free(co->TIME);
728#endif
729

Callers 2

CO_newFunction · 0.85
mainFunction · 0.85

Calls 1

CO_CANmodule_disableFunction · 0.85

Tested by

no test coverage detected