Skip to content

Commit 3148733

Browse files
committed
Bugfix. Set proper part length
1 parent 70fe6fa commit 3148733

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hal/transport/CAN/MyTransportCAN.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ bool transportSend(const uint8_t to, const void* data, const uint8_t len, const
159159
canId=canId << 8;
160160
canId += _nodeId;
161161
uint8_t partLen;
162-
if (i * 8 <= len && noOfFrames!=1) {
162+
if (len<=8){
163+
partLen=len;
164+
} else if (i * 8 <= len) {
163165
partLen = 8;
164166
} else {
165167
partLen = len % 8;

0 commit comments

Comments
 (0)