Multiple write if countWritten has not reached buffer size
Signed-off-by: Lorenz Aebi <git@xca.ch>
This commit is contained in:
parent
6ef8956ff9
commit
1f1b3beca5
1 changed files with 6 additions and 3 deletions
|
|
@ -465,13 +465,16 @@ validateAndWriteToOD(CO_SDOserver_t* SDO, CO_SDO_abortCode_t* abortCode, uint8_t
|
|||
/* may be unused */
|
||||
(void)crcOperation;
|
||||
(void)crcClient;
|
||||
(void)bufOffsetWrOrig;
|
||||
|
||||
/* write data */
|
||||
OD_size_t countWritten = 0;
|
||||
|
||||
OD_size_t sumCountWritten = 0;
|
||||
ODR_t odRet;
|
||||
CO_LOCK_OD(SDO->CANdevTx);
|
||||
ODR_t odRet = SDO->OD_IO.write(&SDO->OD_IO.stream, SDO->buf, SDO->bufOffsetWr, &countWritten);
|
||||
do {
|
||||
odRet = SDO->OD_IO.write(&SDO->OD_IO.stream, SDO->buf, SDO->bufOffsetWr, &countWritten);
|
||||
sumCountWritten += countWritten;
|
||||
} while ((odRet == ODR_PARTIAL) && (SDO->buf > sumCountWritten));
|
||||
CO_UNLOCK_OD(SDO->CANdevTx);
|
||||
|
||||
SDO->bufOffsetWr = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue