From 34b85671d1e48194fffc02cbc981fac891fdd2ba Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Fri, 30 Aug 2019 15:17:45 +1000 Subject: [PATCH] =?UTF-8?q?Revert=20"=E5=8A=A0=E5=85=A5=E9=9B=BB=E6=B1=A0?= =?UTF-8?q?=E5=85=85=E9=9B=BB=E4=BF=9D=E8=AD=B7"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4151d152 --- common/params.py | 1 - selfdrive/dragonpilot/dragonconf/__init__.py | 1 - selfdrive/thermald.py | 10 ---------- 3 files changed, 12 deletions(-) diff --git a/common/params.py b/common/params.py index a6dd855eb..776e3b337 100755 --- a/common/params.py +++ b/common/params.py @@ -118,7 +118,6 @@ keys = { "DragonSteeringMonitorTimer": [TxType.PERSISTENT], "DragonCameraOffset": [TxType.PERSISTENT], "DragonUIVolumeBoost": [TxType.PERSISTENT], - "DragonChargingCtrl": [TxType.PERSISTENT], } diff --git a/selfdrive/dragonpilot/dragonconf/__init__.py b/selfdrive/dragonpilot/dragonconf/__init__.py index 81d72095e..b8efbd4a2 100644 --- a/selfdrive/dragonpilot/dragonconf/__init__.py +++ b/selfdrive/dragonpilot/dragonconf/__init__.py @@ -38,7 +38,6 @@ default_conf = { 'DragonSteeringMonitorTimer': '3', 'DragonCameraOffset': '6', 'DragonUIVolumeBoost': '0', - 'DragonChargingCtrl': '0', } deprecated_conf = { diff --git a/selfdrive/thermald.py b/selfdrive/thermald.py index 78bef3118..a087d670f 100755 --- a/selfdrive/thermald.py +++ b/selfdrive/thermald.py @@ -257,8 +257,6 @@ def thermald_thread(): os.system('LD_LIBRARY_PATH="" svc power shutdown') #charging_disabled = check_car_battery_voltage(should_start, health, charging_disabled) - if count % 3 == 0 and params.get('DragonChargingCtrl') == "1": - charging_disabled = charging_ctrl(msg.thermal.batteryPercent, charging_disabled) msg.thermal.chargingDisabled = charging_disabled msg.thermal.chargingError = current_filter.x > 0. and msg.thermal.batteryPercent < 90 # if current is positive, then battery is being discharged @@ -279,14 +277,6 @@ def thermald_thread(): count += 1 -def charging_ctrl(battery_percent, charging_disabled): - if not charging_disabled and battery_percent >= 80: - os.system('echo "0" > /sys/class/power_supply/battery/charging_enabled') - return True - elif charging_disabled and battery_percent <= 60: - os.system('echo "1" > /sys/class/power_supply/battery/charging_enabled') - return False - def main(gctx=None): thermald_thread()