Example: CO_CANsend should not increase CANtxCount if buffer is full already
See https://github.com/CANopenNode/CanOpenSTM32/pull/85
This commit is contained in:
parent
ac2140717c
commit
542b0ca20f
1 changed files with 5 additions and 2 deletions
|
|
@ -166,8 +166,11 @@ CO_CANsend(CO_CANmodule_t* CANmodule, CO_CANtx_t* buffer) {
|
|||
}
|
||||
/* if no buffer is free, message will be sent by interrupt */
|
||||
else {
|
||||
buffer->bufferFull = true;
|
||||
CANmodule->CANtxCount++;
|
||||
/* Only increment count if buffer wasn't already full */
|
||||
if (!buffer->bufferFull) {
|
||||
buffer->bufferFull = true;
|
||||
CANmodule->CANtxCount++;
|
||||
}
|
||||
}
|
||||
CO_UNLOCK_CAN_SEND(CANmodule);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue