          can_sends.append(spam_cancel_button(self.packer))
  
        if (frame % 3) == 0:
  
          curvature = self.vehicle_model.calc_curvature(actuators.steerAngle*3.1415/180., CS.v_ego)
  
          # The use of the toggle below is handy for trying out the various LKAS modes
          if TOGGLE_DEBUG:
            self.lkas_action += int(CS.generic_toggle and not self.generic_toggle_last)
            self.lkas_action &= 0xf
 
</s> remove           self.lkas_action += int(CS.generic_toggle and not self.generic_toggle_last)
 </s> add           self.lkas_action += int(CS.out.genericToggle and not self.generic_toggle_last) </s> remove                                               CS.lkas_state, CS.angle_steers, curvature, self.lkas_action))
        self.generic_toggle_last = CS.generic_toggle
 </s> add                                               CS.lkas_state, CS.out.steeringAngle, curvature, self.lkas_action))
        self.generic_toggle_last = CS.out.genericToggle </s> remove         can_sends.append(create_lkas_ui(self.packer, CS.main_on, enabled, steer_alert))
 </s> add         can_sends.append(create_lkas_ui(self.packer, CS.out.cruiseState.available, enabled, steer_alert)) </s> remove       if (frame % 100) == 0 or (self.enabled_last != enabled) or (self.main_on_last != CS.main_on) or \
 </s> add       if (frame % 100) == 0 or (self.enabled_last != enabled) or (self.main_on_last != CS.out.cruiseState.available) or \ </s> remove     self.user_gas = cp.vl["EngineData_14"]['ApedPosScal_Pc_Actl']
    self.brake_pressed = bool(cp.vl["Cruise_Status"]["Brake_Drv_Appl"])
    self.brake_lights = bool(cp.vl["BCM_to_HS_Body"]["Brake_Lights"])
    self.generic_toggle = bool(cp.vl["Steering_Buttons"]["Dist_Incr"])
 </s> add     return ret
        curvature = self.vehicle_model.calc_curvature(actuators.steerAngle*3.1415/180., CS.out.vEgo)
          can_sends.append(spam_cancel_button(self.packer))
  
        if (frame % 3) == 0:
  
        curvature = self.vehicle_model.calc_curvature(actuators.steerAngle*3.1415/180., CS.out.vEgo)
  
          # The use of the toggle below is handy for trying out the various LKAS modes
          if TOGGLE_DEBUG:
            self.lkas_action += int(CS.generic_toggle and not self.generic_toggle_last)
            self.lkas_action &= 0xf
keep keep keep keep replace keep keep keep keep keep
 Ford: have carstate update returning capnp struct directly (#1113)

* Before abstraction, adding speed init from VW as well

* strting to abstract carstate class

* fix bug and update lock?

* revert pipfile change

* another bug

* fix linter

* bug fix

* remove a bunch of diplicated kf code

* better to not have class vars. will abstract __init__ anyway later

* abstract common instance vars in carstate init and a generic gear parser static method

* abstract gear parser for chrysler

* abstract gm gear parser too

* remove unnecessary random vars

* Chrysler: carstate returns capnp struct directly

* revert ref commit

* test ref

* WIP

* more WIP

* ops, missed this conflict

* ford as well

* not sure why this got deleted

* no need to copy

* remove copy

* remove copy import

* remove unnecessary intermediate variable

* remove obsolete comments

Co-authored-by: Willem Melching <willem.melching@gmail.com> 
selfdrive/car/ford/carcontroller.py