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

Function CO_CANsend

example/CO_driver_blank.c:148–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148CO_ReturnError_t
149CO_CANsend(CO_CANmodule_t* CANmodule, CO_CANtx_t* buffer) {
150 CO_ReturnError_t err = CO_ERROR_NO;
151
152 /* Verify overflow */
153 if (buffer->bufferFull) {
154 if (!CANmodule->firstCANtxMessage) {
155 /* don't set error, if bootup message is still on buffers */
156 CANmodule->CANerrorStatus |= CO_CAN_ERRTX_OVERFLOW;
157 }
158 err = CO_ERROR_TX_OVERFLOW;
159 }
160
161 CO_LOCK_CAN_SEND(CANmodule);
162 /* if CAN TX buffer is free, copy message to it */
163 if (1 && CANmodule->CANtxCount == 0) {
164 CANmodule->bufferInhibitFlag = buffer->syncFlag;
165 /* copy message and txRequest */
166 }
167 /* if no buffer is free, message will be sent by interrupt */
168 else {
169 buffer->bufferFull = true;
170 CANmodule->CANtxCount++;
171 }
172 CO_UNLOCK_CAN_SEND(CANmodule);
173
174 return err;
175}
176
177void
178CO_CANclearPendingSyncPDOs(CO_CANmodule_t* CANmodule) {

Callers 15

CO_SRDO_processFunction · 0.85
CO_GFCsendFunction · 0.85
CO_LSSslave_receiveFunction · 0.85
CO_LSSslave_processFunction · 0.85
CO_LSSmaster_ActivateBitFunction · 0.85
CO_LSSmaster_FsSendMsgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected