mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-20 08:42:11 +08:00
e0ab166ed3
f1e69a6cf Fix wrong message size in Chrysler 54482cfb0 Fix GM message signal sizes 4e796e06d Fix wrong message sizes in Nissan fb6c1ee2b Better GEAR signal tracking the gear stick rather than the gear box (#257) d7a2efbbd Raw angle signal data for easy checksum calc, and one less gear bit (#254) 7456061a7 add checksum check to can parser for subaru 7f3b1774d Chrysler: calculate checksum in can packer/parser (#255) 0c0215516 Rename BYTE_ to SET_ME_X (#253) 1efe437cf Add values for a static 0xe5 (honda bosch) (#250) 7dffe0bd9 Create DBC for HRV (#248) b69398525 Add LFAHDA message to hyundai a57e7ddbd CANPacker: Subaru checksum support (#241) 36c471e59 Fixed signals order and added new signals for subaru global (#221) 7b5a1fcc1 BMW 2008-2013 (#230) cc09af763 Add RPM signal (#216) 47db9238f Add SWA_01 message detail and CRC support for VW MQB (#236) c98fe2ab9 Fixed signal unknown1 overlapping the button bits (#239) 572261ee3 Rear Cross Traffic Alert 044730aeb Speed limit signs 87b1a21fb Pedals/gear, gas pedal scale value ce78044d8 Tracking the steer angle with LKAS signal 7f19ab415 Introduce the new mazda 3 2019/2020 dbc e58520619 traffic sign speed limit 00bad5ee7 Speed Auto High Beam Traffic signs 9d080ea42 Nissan leaf (#238) 50fbbe739 nissan x trail cleanup (#237) git-subtree-dir: opendbc git-subtree-split: f1e69a6cf91cdaf1b8008d73f6fbb6634fbbeb42
86 lines
2.5 KiB
C++
86 lines
2.5 KiB
C++
#include "common_dbc.h"
|
|
|
|
namespace {
|
|
|
|
{% for address, msg_name, msg_size, sigs in msgs %}
|
|
const Signal sigs_{{address}}[] = {
|
|
{% for sig in sigs %}
|
|
{
|
|
{% if sig.is_little_endian %}
|
|
{% set b1 = sig.start_bit %}
|
|
{% else %}
|
|
{% set b1 = (sig.start_bit//8)*8 + (-sig.start_bit-1) % 8 %}
|
|
{% endif %}
|
|
.name = "{{sig.name}}",
|
|
.b1 = {{b1}},
|
|
.b2 = {{sig.size}},
|
|
.bo = {{64 - (b1 + sig.size)}},
|
|
.is_signed = {{"true" if sig.is_signed else "false"}},
|
|
.factor = {{sig.factor}},
|
|
.offset = {{sig.offset}},
|
|
.is_little_endian = {{"true" if sig.is_little_endian else "false"}},
|
|
{% if checksum_type == "honda" and sig.name == "CHECKSUM" %}
|
|
.type = SignalType::HONDA_CHECKSUM,
|
|
{% elif checksum_type == "honda" and sig.name == "COUNTER" %}
|
|
.type = SignalType::HONDA_COUNTER,
|
|
{% elif checksum_type == "toyota" and sig.name == "CHECKSUM" %}
|
|
.type = SignalType::TOYOTA_CHECKSUM,
|
|
{% elif checksum_type == "volkswagen" and sig.name == "CHECKSUM" %}
|
|
.type = SignalType::VOLKSWAGEN_CHECKSUM,
|
|
{% elif checksum_type == "volkswagen" and sig.name == "COUNTER" %}
|
|
.type = SignalType::VOLKSWAGEN_COUNTER,
|
|
{% elif checksum_type == "subaru" and sig.name == "CHECKSUM" %}
|
|
.type = SignalType::SUBARU_CHECKSUM,
|
|
{% elif checksum_type == "chrysler" and sig.name == "CHECKSUM" %}
|
|
.type = SignalType::CHRYSLER_CHECKSUM,
|
|
{% elif address in [512, 513] and sig.name == "CHECKSUM_PEDAL" %}
|
|
.type = SignalType::PEDAL_CHECKSUM,
|
|
{% elif address in [512, 513] and sig.name == "COUNTER_PEDAL" %}
|
|
.type = SignalType::PEDAL_COUNTER,
|
|
{% else %}
|
|
.type = SignalType::DEFAULT,
|
|
{% endif %}
|
|
},
|
|
{% endfor %}
|
|
};
|
|
{% endfor %}
|
|
|
|
const Msg msgs[] = {
|
|
{% for address, msg_name, msg_size, sigs in msgs %}
|
|
{% set address_hex = "0x%X" % address %}
|
|
{
|
|
.name = "{{msg_name}}",
|
|
.address = {{address_hex}},
|
|
.size = {{msg_size}},
|
|
.num_sigs = ARRAYSIZE(sigs_{{address}}),
|
|
.sigs = sigs_{{address}},
|
|
},
|
|
{% endfor %}
|
|
};
|
|
|
|
const Val vals[] = {
|
|
{% for address, sig in def_vals %}
|
|
{% for sg_name, def_val in sig %}
|
|
{% set address_hex = "0x%X" % address %}
|
|
{
|
|
.name = "{{sg_name}}",
|
|
.address = {{address_hex}},
|
|
.def_val = {{def_val}},
|
|
.sigs = sigs_{{address}},
|
|
},
|
|
{% endfor %}
|
|
{% endfor %}
|
|
};
|
|
|
|
}
|
|
|
|
const DBC {{dbc.name}} = {
|
|
.name = "{{dbc.name}}",
|
|
.num_msgs = ARRAYSIZE(msgs),
|
|
.msgs = msgs,
|
|
.vals = vals,
|
|
.num_vals = ARRAYSIZE(vals),
|
|
};
|
|
|
|
dbc_init({{dbc.name}})
|