mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-10-10 08:14:03 +08:00
mazda 2023 can
This commit is contained in:
@@ -197,10 +197,9 @@ void can_set_forwarding(uint8_t from, uint8_t to) {
|
||||
|
||||
void ignition_can_hook(CANPacket_t *to_push) {
|
||||
int bus = GET_BUS(to_push);
|
||||
int addr = GET_ADDR(to_push);
|
||||
int len = GET_LEN(to_push);
|
||||
if (bus == 0) {
|
||||
int addr = GET_ADDR(to_push);
|
||||
int len = GET_LEN(to_push);
|
||||
|
||||
// GM exception
|
||||
if ((addr == 0x1F1) && (len == 8)) {
|
||||
// SystemPowerMode (2=Run, 3=Crank Request)
|
||||
@@ -226,9 +225,13 @@ void ignition_can_hook(CANPacket_t *to_push) {
|
||||
ignition_can_cnt = 0U;
|
||||
}
|
||||
|
||||
} else if (bus == 1) {
|
||||
// Mazda 2019 exception
|
||||
if ((addr == 0x274) && (len == 8)) {
|
||||
ignition_can = (GET_BYTE(to_push, 5) & 0x4U) != 0U;
|
||||
ignition_can_cnt = 0U;
|
||||
}
|
||||
} else if (bus == 2) {
|
||||
int addr = GET_ADDR(to_push);
|
||||
int len = GET_LEN(to_push);
|
||||
// GM exception, SDGM cars have this message on bus 2
|
||||
if ((addr == 0x1F1) && (len == 8)) {
|
||||
// SystemPowerMode (2=Run, 3=Crank Request)
|
||||
|
||||
@@ -387,11 +387,16 @@ class CarState(CarStateBase):
|
||||
("GEAR", 40),
|
||||
]
|
||||
|
||||
if CP.flags & MazdaFlags.GEN3:
|
||||
if CP.flags & MazdaFlags.MANUAL_TRANSMISSION:
|
||||
messages += [
|
||||
("MANUAL_GEAR", 50),
|
||||
]
|
||||
messages += [
|
||||
# sig_address, frequency
|
||||
("CRZ_BTNS", 10)
|
||||
("BLINK_INFO", 10),
|
||||
("STEER", 67),
|
||||
("STEER_RATE", 83),
|
||||
("STEER_TORQUE", 83),
|
||||
("WHEEL_SPEEDS", 100),
|
||||
("SYSTEM_SETTINGS", 2),
|
||||
]
|
||||
|
||||
return CANParser(DBC[CP.carFingerprint]["pt"], messages, 2)
|
||||
|
||||
@@ -399,7 +404,9 @@ class CarState(CarStateBase):
|
||||
def get_body_can_parser(CP):
|
||||
messages = CarState.get_ti_messages(CP)
|
||||
if CP.flags & MazdaFlags.GEN3:
|
||||
messages += [
|
||||
("SYSTEM_SETTINGS", 2),
|
||||
]
|
||||
if CP.flags & MazdaFlags.MANUAL_TRANSMISSION:
|
||||
messages += [
|
||||
("MANUAL_GEAR", 50),
|
||||
]
|
||||
|
||||
return CANParser(DBC[CP.carFingerprint]["pt"], messages, 1)
|
||||
|
||||
Reference in New Issue
Block a user