Use a monotonic clock source for power monitoring (#1861)

pull/1870/head
Adeeb Shihadeh 5 years ago committed by GitHub
parent 7b2789aa3a
commit 897ee6bd2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      selfdrive/thermald/power_monitoring.py

@ -5,6 +5,7 @@ import time
from statistics import mean
from cereal import log
from common.realtime import sec_since_boot
from selfdrive.swaglog import cloudlog
PANDA_OUTPUT_VOLTAGE = 5.28
@ -67,7 +68,7 @@ class PowerMonitoring:
# Calculation tick
def calculate(self, health):
try:
now = time.time()
now = sec_since_boot()
# Check that time is valid
if datetime.datetime.fromtimestamp(now).year < 2019:

Loading…
Cancel
Save