add mazda info

This commit is contained in:
机械小鸽 2025-03-01 22:05:16 +08:00 committed by GitHub
parent 4483bb7a73
commit aacaef9a2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View File

@ -24,6 +24,7 @@ class CarState(CarStateBase):
self.prev_distance_button = 0
self.distance_button = 0
self.pcmCruiseGap = 0 # copy from Hyundai
def update(self, can_parsers) -> structs.CarState:
cp = can_parsers[Bus.pt]
@ -61,6 +62,9 @@ class CarState(CarStateBase):
can_gear = int(cp.vl["GEAR"]["GEAR"])
ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(can_gear, None))
ret.gearStep = cp.vl["GEAR"]["GEAR_BOX"]
ret.engineRpm = cp.vl["ENGINE_DATA"]["RPM"] # for mazda RPM
ret.pcmCruiseGap = cp.vl["CRZ_CTRL"]["DISTANCE_SETTING"] # copy from Hyundai
ret.genericToggle = bool(cp.vl["BLINK_INFO"]["HIGH_BEAMS"])
ret.leftBlindspot = cp.vl["BSM"]["LEFT_BS_STATUS"] != 0

View File

@ -490,7 +490,7 @@ def carinfo():
"Running Status": "Moving" if is_car_started else "Stopped",
"Cruise System": "Enabled" if is_car_engaged else "Disabled",
"Current Speed": f"{CS.vEgo * 3.6:.1f} km/h",
"Engine RPM": f"{CS.engineRPM:.0f} RPM" if hasattr(CS, 'engineRPM') and CS.engineRPM > 0 else "Unknown",
"Engine RPM": f"{CS.engineRpm:.0f} RPM" if hasattr(CS, 'engineRpm') and CS.engineRpm > 0 else "Unknown", # Rpm, not RPM
"Gear Position": str(CS.gearShifter) if hasattr(CS, 'gearShifter') else "Unknown"
},
"Basic Information": {