mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-04 04:52:09 +08:00
panda: fix len_to_dlc always return 1 if len > 24 (#22964)
old-commit-hash: 57db99700c0ec41764d8645cec34a99a5b237135
This commit is contained in:
@@ -357,9 +357,9 @@ uint8_t Panda::len_to_dlc(uint8_t len) {
|
||||
return len;
|
||||
}
|
||||
if (len <= 24) {
|
||||
return 8 + ((len - 8) / 4) + (len % 4) ? 1 : 0;
|
||||
return 8 + ((len - 8) / 4) + ((len % 4) ? 1 : 0);
|
||||
} else {
|
||||
return 11 + (len / 16) + (len % 16) ? 1 : 0;
|
||||
return 11 + (len / 16) + ((len % 16) ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user