Skip to content

Commit

Permalink
Fixes for various merge and refactoring fallout, typo fixes. (commaai…
Browse files Browse the repository at this point in the history
…#878)

* Fixes for various merge and refactoring fallout, typo fixes.

* Tab->Spaces
  • Loading branch information
jyoung8607 authored and rbiasini committed Nov 13, 2019
1 parent 50eae23 commit 75618d6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
4 changes: 3 additions & 1 deletion selfdrive/can/common.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ cdef extern from "common.h":
HONDA_COUNTER,
TOYOTA_CHECKSUM,
PEDAL_CHECKSUM,
PEDAL_COUNTER
PEDAL_COUNTER,
VOLKSWAGEN_CHECKSUM,
VOLKSWAGEN_COUNTER

cdef struct Signal:
const char* name
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/can/dbc_template.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Signal sigs_{{address}}[] = {
.type = SignalType::HONDA_COUNTER,
{% elif checksum_type == "toyota" and sig.name == "CHECKSUM" %}
.type = SignalType::TOYOTA_CHECKSUM,
{% elif checksum_type == "volkswagen" and sig.name == "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,
Expand Down
7 changes: 3 additions & 4 deletions selfdrive/can/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ bool MessageState::parse(uint64_t sec, uint16_t ts_, uint8_t * dat) {
}
} else if (sig.type == SignalType::VOLKSWAGEN_COUNTER) {
if (!update_counter_generic(tmp, sig.b2)) {
INFO("0x%X CHECKSUM FAIL\n", address);
return false;
}
} else if (sig.type == SignalType::PEDAL_CHECKSUM) {
Expand Down Expand Up @@ -84,7 +83,7 @@ bool MessageState::update_counter_generic(int64_t v, int cnt_size) {
if (((old_counter+1) & ((1 << cnt_size) -1)) != v) {
counter_fail += 1;
if (counter_fail > 1) {
INFO("%X COUNTER FAIL %d -- %d vs %d\n", address, counter_fail, old_counter, (int)v);
INFO("0x%X COUNTER FAIL %d -- %d vs %d\n", address, counter_fail, old_counter, (int)v);
}
if (counter_fail >= MAX_BAD_COUNTER) {
return false;
Expand Down Expand Up @@ -125,7 +124,7 @@ CANParser::CANParser(int abus, const std::string& dbc_name,
}
}
if (!msg) {
fprintf(stderr, "CANParser: could not find message 0x%X in dnc %s\n", op.address, dbc_name.c_str());
fprintf(stderr, "CANParser: could not find message 0x%X in DBC %s\n", op.address, dbc_name.c_str());
assert(false);
}

Expand Down Expand Up @@ -193,7 +192,7 @@ void CANParser::UpdateValid(uint64_t sec) {
const auto& state = kv.second;
if (state.check_threshold > 0 && (sec - state.seen) > state.check_threshold) {
if (state.seen > 0) {
DEBUG("%X TIMEOUT\n", state.address);
DEBUG("0x%X TIMEOUT\n", state.address);
}
can_valid = false;
}
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/volkswagen/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def update(self, enabled, CS, frame, actuators, visual_alert, audible_alert, lef
idx = (CS.graMsgBusCounter + 1) % 16
can_sends.append(volkswagencan.create_mqb_acc_buttons_control(self.packer_gw, canbus.extended, self.graButtonStatesToSend, CS, idx))
self.graMsgSentCount += 1
if self.graMsgSentCount >= 16:
if self.graMsgSentCount >= P.GRA_VBP_COUNT:
self.graButtonStatesToSend = None
self.graMsgSentCount = 0

Expand Down
7 changes: 0 additions & 7 deletions selfdrive/car/volkswagen/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ class CAR:
}],
}

class ECU:
CAM = 0

ECU_FINGERPRINT = {
ECU.CAM: [294, 919], # HCA_01 Heading Control Assist, LDW_02 Lane Departure Warning
}

DBC = {
CAR.GOLF: dbc_dict('vw_mqb_2010', None),
}

0 comments on commit 75618d6

Please sign in to comment.