Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4d0d2b0

Browse files
committed
Added support for CAN FD 64 byte payload length
1 parent1918702 commit4d0d2b0

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

‎docs/RELEASES.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
##[Unreleased]
88

9+
###Added
10+
11+
- CAN FD frames with max DLC (64 bytes) are supported
12+
913
##[v3.0] - 2023-10-09
1014

1115
###Added

‎src/codegen/c-sigprinter.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include<memory>
33
#include"c-sigprinter.h"
44
#include"helpers/formatter.h"
5+
#include"conf-and-limits.h"
56

67
// work buffer for all snprintf operations
78
staticconstsize_t WBUFF_LEN =2048;
@@ -190,9 +191,9 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec
190191
uint16_t startb = (uint16_t)((sig->Order == BitLayout::kIntel) ?
191192
(sig->StartBit + (sig->LengthBit -1)) : (sig->StartBit));
192193

193-
if (startb >63)
194+
if (startb >CONF_LIMIT_HIGHEST_BIT_POSITION)
194195
{
195-
startb =63;
196+
startb =CONF_LIMIT_HIGHEST_BIT_POSITION;
196197
}
197198

198199
uint32_t bn = (startb /8);

‎src/codegen/version.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
#include<stdint.h>
44

55
#defineCODEGEN_LIB_VERSION_MAJ (3)
6-
#defineCODEGEN_LIB_VERSION_MIN (0)
6+
#defineCODEGEN_LIB_VERSION_MIN (1)

‎src/conf-and-limits.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#pragma once
2+
3+
#include<stdint.h>
4+
5+
//! Maximum length of CAN frame payload in bytes
6+
#defineCONF_LIMIT_MAX_DLC 64u
7+
8+
//! The highest possible bit position based on MAX Data size
9+
#defineCONF_LIMIT_HIGHEST_BIT_POSITION (CONF_LIMIT_MAX_DLC * 8u) - 1u

‎src/parser/dbclineparser.cpp‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
#include"dbclineparser.h"
2-
#include<helpers/formatter.h>
31
#include<stdlib.h>
42
#include<clocale>
53
#include<regex>
64
#include<math.h>
75
#include<limits.h>
6+
#include"helpers/formatter.h"
7+
#include"dbclineparser.h"
8+
#include"conf-and-limits.h"
89

910
/// @brief Minimal possible value for Factor/Offset
1011
constexprdouble MIN_FAC_OFF =0.000000001;
@@ -136,7 +137,7 @@ bool DbcLineParser::ParseMessageLine(MessageDescriptor_t* msg, const std::string
136137

137138
msg->DLC =atoi(items[4].c_str());
138139

139-
if ((msg->MsgID &0x60000000) !=0 || msg->DLC ==0 || msg->DLC >8)
140+
if ((msg->MsgID &0x60000000) !=0 || msg->DLC ==0 || msg->DLC >CONF_LIMIT_MAX_DLC)
140141
{
141142
returnfalse;
142143
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp