  #!/usr/bin/env python3
  from enum import Enum
  from selfdrive.car.toyota.values import MIN_ACC_SPEED, PEDAL_HYST_GAP
  
  
  class LongTunes(Enum):
    PEDAL = 0
    TSS2 = 1
 
</s> remove                                         MIN_ACC_SPEED, PEDAL_HYST_GAP, PEDAL_SCALE, CarControllerParams
 </s> add                                         MIN_ACC_SPEED, PEDAL_TRANSITION, CarControllerParams </s> remove def accel_hysteresis(accel, accel_steady, enabled):

  # for small accel oscillations within ACCEL_HYST_GAP, don't change the accel command
  if not enabled:
    # send 0 when disabled, otherwise acc faults
    accel_steady = 0.
  elif accel > accel_steady + CarControllerParams.ACCEL_HYST_GAP:
    accel_steady = accel - CarControllerParams.ACCEL_HYST_GAP
  elif accel < accel_steady - CarControllerParams.ACCEL_HYST_GAP:
    accel_steady = accel + CarControllerParams.ACCEL_HYST_GAP
  accel = accel_steady

  return accel, accel_steady


 </s> add  </s> remove PEDAL_HYST_GAP = 3. * CV.MPH_TO_MS
PEDAL_SCALE = 3.0
 </s> add  </s> remove     self.accel_steady = 0.
 </s> add  </s> remove   if name == LongTunes.PEDAL:
    tune.deadzoneBP = [0.]
    tune.deadzoneV = [0.]
    tune.kpBP = [0., 5., MIN_ACC_SPEED, MIN_ACC_SPEED + PEDAL_HYST_GAP, 35.]
    tune.kpV = [1.2, 0.8, 0.765, 2.255, 1.5]
    tune.kiBP = [0., MIN_ACC_SPEED, MIN_ACC_SPEED + PEDAL_HYST_GAP, 35.]
    tune.kiV = [0.18, 0.165, 0.489, 0.36]
 </s> add 
  #!/usr/bin/env python3
  from enum import Enum

  
  
  class LongTunes(Enum):
    PEDAL = 0
    TSS2 = 1
keep keep replace keep keep keep keep keep
 Toyota pedal rewrite (#23067)

* pedal redo

* add offset to compensate for creep and windbrake

* offset in standard units

* wrong size

* better creep values

* update ref 
selfdrive/car/toyota/tunes.py