@@ -19,6 +19,7 @@ def __init__(self, CP):
19
19
self .shifter_values = can_define .dv ["PowertrainData_10" ]["TrnRng_D_Rq" ]
20
20
21
21
self .distance_button = 0
22
+ self .lc_button = 0
22
23
23
24
def update (self , can_parsers ) -> structs .CarState :
24
25
cp = can_parsers [Bus .pt ]
@@ -91,7 +92,9 @@ def update(self, can_parsers) -> structs.CarState:
91
92
# TODO: block this going to the camera otherwise it will enable stock TJA
92
93
ret .genericToggle = bool (cp .vl ["Steering_Data_FD1" ]["TjaButtnOnOffPress" ])
93
94
prev_distance_button = self .distance_button
95
+ prev_lc_button = self .lc_button
94
96
self .distance_button = cp .vl ["Steering_Data_FD1" ]["AccButtnGapTogglePress" ]
97
+ self .lc_button = bool (cp .vl ["Steering_Data_FD1" ]["TjaButtnOnOffPress" ])
95
98
96
99
# lock info
97
100
ret .doorOpen = any ([cp .vl ["BodyInfo_3_FD1" ]["DrStatDrv_B_Actl" ], cp .vl ["BodyInfo_3_FD1" ]["DrStatPsngr_B_Actl" ],
@@ -110,7 +113,10 @@ def update(self, can_parsers) -> structs.CarState:
110
113
self .acc_tja_status_stock_values = cp_cam .vl ["ACCDATA_3" ]
111
114
self .lkas_status_stock_values = cp_cam .vl ["IPMA_Data" ]
112
115
113
- ret .buttonEvents = create_button_events (self .distance_button , prev_distance_button , {1 : ButtonType .gapAdjustCruise })
116
+ ret .buttonEvents = [
117
+ * create_button_events (self .distance_button , prev_distance_button , {1 : ButtonType .gapAdjustCruise }),
118
+ * create_button_events (self .lc_button , prev_lc_button , {1 : ButtonType .lkas }),
119
+ ]
114
120
115
121
return ret
116
122
0 commit comments