Skip to content

Commit

Permalink
Cleanup process config type annotations (commaai#33782)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrogAi authored and cydia2020 committed Oct 14, 2024
1 parent eba1f28 commit 638997e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions system/manager/process_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,41 @@ def notcar(started: bool, params: Params, CP: car.CarParams) -> bool:
def iscar(started: bool, params: Params, CP: car.CarParams) -> bool:
return started and not CP.notCar

def logging(started, params: Params, CP: car.CarParams) -> bool:
def logging(started: bool, params: Params, CP: car.CarParams) -> bool:
run = (not CP.notCar) or not params.get_bool("DisableLogging")
return started and run

def ublox_available() -> bool:
return os.path.exists('/dev/ttyHS0') and not os.path.exists('/persist/comma/use-quectel-gps')

def ublox(started, params: Params, CP: car.CarParams) -> bool:
def ublox(started: bool, params: Params, CP: car.CarParams) -> bool:
use_ublox = ublox_available()
if use_ublox != params.get_bool("UbloxAvailable"):
params.put_bool("UbloxAvailable", use_ublox)
return started and use_ublox

def joystick(started: bool, params, CP: car.CarParams) -> bool:
def joystick(started: bool, params: Params, CP: car.CarParams) -> bool:
return started and params.get_bool("JoystickDebugMode")

def not_joystick(started: bool, params, CP: car.CarParams) -> bool:
def not_joystick(started: bool, params: Params, CP: car.CarParams) -> bool:
return started and not params.get_bool("JoystickDebugMode")

def long_maneuver(started: bool, params, CP: car.CarParams) -> bool:
def long_maneuver(started: bool, params: Params, CP: car.CarParams) -> bool:
return started and params.get_bool("LongitudinalManeuverMode")

def not_long_maneuver(started: bool, params, CP: car.CarParams) -> bool:
def not_long_maneuver(started: bool, params: Params, CP: car.CarParams) -> bool:
return started and not params.get_bool("LongitudinalManeuverMode")

def qcomgps(started, params, CP: car.CarParams) -> bool:
def qcomgps(started: bool, params: Params, CP: car.CarParams) -> bool:
return started and not ublox_available()

def always_run(started, params: Params, CP: car.CarParams) -> bool:
def always_run(started: bool, params: Params, CP: car.CarParams) -> bool:
return True

def only_onroad(started: bool, params: Params, CP: car.CarParams) -> bool:
return started

def only_offroad(started, params: Params, CP: car.CarParams) -> bool:
def only_offroad(started: bool, params: Params, CP: car.CarParams) -> bool:
return not started

# don't run soundd if disabled
Expand Down

0 comments on commit 638997e

Please sign in to comment.