|
|
@ -10,7 +10,15 @@ def create_steering_control(packer, bus, apply_steer, lkas_enabled): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_lka_hud_control(packer, bus, ldw_stock_values, enabled, steering_pressed, hud_alert, hud_control): |
|
|
|
def create_lka_hud_control(packer, bus, ldw_stock_values, enabled, steering_pressed, hud_alert, hud_control): |
|
|
|
values = ldw_stock_values.copy() |
|
|
|
values = {} |
|
|
|
|
|
|
|
if len(ldw_stock_values): |
|
|
|
|
|
|
|
values = {s: ldw_stock_values[s] for s in [ |
|
|
|
|
|
|
|
"LDW_SW_Warnung_links", # Blind spot in warning mode on left side due to lane departure |
|
|
|
|
|
|
|
"LDW_SW_Warnung_rechts", # Blind spot in warning mode on right side due to lane departure |
|
|
|
|
|
|
|
"LDW_Seite_DLCTLC", # Direction of most likely lane departure (left or right) |
|
|
|
|
|
|
|
"LDW_DLC", # Lane departure, distance to line crossing |
|
|
|
|
|
|
|
"LDW_TLC", # Lane departure, time to line crossing |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
|
|
|
|
values.update({ |
|
|
|
values.update({ |
|
|
|
"LDW_Lampe_gelb": 1 if enabled and steering_pressed else 0, |
|
|
|
"LDW_Lampe_gelb": 1 if enabled and steering_pressed else 0, |
|
|
@ -23,11 +31,24 @@ def create_lka_hud_control(packer, bus, ldw_stock_values, enabled, steering_pres |
|
|
|
return packer.make_can_msg("LDW_Status", bus, values) |
|
|
|
return packer.make_can_msg("LDW_Status", bus, values) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_acc_buttons_control(packer, bus, gra_stock_values, counter, cancel=False, resume=False): |
|
|
|
def create_acc_buttons_control(packer, bus, gra_stock_values, cancel=False, resume=False): |
|
|
|
values = gra_stock_values.copy() |
|
|
|
values = {s: gra_stock_values[s] for s in [ |
|
|
|
|
|
|
|
"GRA_Hauptschalt", # ACC button, on/off |
|
|
|
|
|
|
|
"GRA_Typ_Hauptschalt", # ACC button, momentary vs latching |
|
|
|
|
|
|
|
"GRA_Kodierinfo", # ACC button, configuration |
|
|
|
|
|
|
|
"GRA_Abbrechen", # ACC button, cancel |
|
|
|
|
|
|
|
"GRA_Neu_Setzen", # ACC button, set |
|
|
|
|
|
|
|
"GRA_Up_lang", # ACC button, increase or accel, long press |
|
|
|
|
|
|
|
"GRA_Down_lang", # ACC button, decrease or decel, long press |
|
|
|
|
|
|
|
"GRA_Up_kurz", # ACC button, increase or accel, short press |
|
|
|
|
|
|
|
"GRA_Down_kurz", # ACC button, decrease or decel, short press |
|
|
|
|
|
|
|
"GRA_Recall", # ACC button, resume |
|
|
|
|
|
|
|
"GRA_Zeitluecke", # ACC button, time gap adj |
|
|
|
|
|
|
|
"GRA_Sender", # ACC button, CAN message originator |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
|
|
|
|
values.update({ |
|
|
|
values.update({ |
|
|
|
"COUNTER": counter, |
|
|
|
"COUNTER": (gra_stock_values["COUNTER"] + 1) % 16, |
|
|
|
"GRA_Abbrechen": cancel, |
|
|
|
"GRA_Abbrechen": cancel, |
|
|
|
"GRA_Recall": resume, |
|
|
|
"GRA_Recall": resume, |
|
|
|
}) |
|
|
|
}) |
|
|
|