diff --git a/selfdrive/camerad/cameras/camera_common.cc b/selfdrive/camerad/cameras/camera_common.cc index 50eafc3b59..1fd311d42d 100644 --- a/selfdrive/camerad/cameras/camera_common.cc +++ b/selfdrive/camerad/cameras/camera_common.cc @@ -232,7 +232,7 @@ void fill_frame_image(cereal::FrameData::Builder &framed, const CameraBuf *b) { memcpy(&resized_dat[(r*new_width+c)*3], &dat[goff+r*b->rgb_stride*scale+c*3*scale], 3*sizeof(uint8_t)); } } - framed.setImage(kj::arrayPtr((const uint8_t*)resized_dat, new_width*new_height*3)); + framed.setImage(kj::arrayPtr((const uint8_t*)resized_dat, (size_t)new_width*new_height*3)); delete[] resized_dat; } diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 72acc1de75..83866297d7 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -276,7 +276,6 @@ def thermald_thread(): # If device is offroad we want to cool down before going onroad # since going onroad increases load and can make temps go over 107 # We only do this if there is a relay that prevents the car from faulting - thermal_status = ThermalStatus.green # default to good condition is_offroad_for_5_min = (started_ts is None) and ((not started_seen) or (off_ts is None) or (sec_since_boot() - off_ts > 60 * 5)) if max_cpu_temp > 107. or bat_temp >= 63. or (is_offroad_for_5_min and max_cpu_temp > 70.0): # onroad not allowed @@ -293,6 +292,8 @@ def thermald_thread(): elif max_cpu_temp > 75.0: # hysteresis between uploader not allowed and all good thermal_status = clip(thermal_status, ThermalStatus.green, ThermalStatus.yellow) + else: + thermal_status = ThermalStatus.green # default to good condition # **** starting logic **** diff --git a/tools/nui/FileReader.cpp b/tools/nui/FileReader.cpp index fe360da98b..13b7f78078 100644 --- a/tools/nui/FileReader.cpp +++ b/tools/nui/FileReader.cpp @@ -74,6 +74,10 @@ LogReader::LogReader(const QString& file, Events *events_, QReadWriteLock* event }); } +LogReader::~LogReader() { + delete parser; +} + void LogReader::mergeEvents(int dled) { auto amsg = kj::arrayPtr((const capnp::word*)(raw.data() + event_offset), (dled-event_offset)/sizeof(capnp::word)); Events events_local; diff --git a/tools/nui/FileReader.hpp b/tools/nui/FileReader.hpp index 6d53bdee8e..514758e10f 100644 --- a/tools/nui/FileReader.hpp +++ b/tools/nui/FileReader.hpp @@ -1,5 +1,4 @@ -#ifndef FILEREADER_HPP -#define FILEREADER_HPP +#pragma once #include #include @@ -20,7 +19,8 @@ #include "channel.hpp" class FileReader : public QObject { -Q_OBJECT + Q_OBJECT + public: FileReader(const QString& file_); void startRequest(const QUrl &url); @@ -28,10 +28,13 @@ public: virtual void readyRead(); void httpFinished(); virtual void done() {}; + public slots: void process(); + protected: QNetworkReply *reply; + private: QNetworkAccessManager *qnam; QElapsedTimer timer; @@ -44,9 +47,12 @@ class LogReader : public FileReader { Q_OBJECT public: LogReader(const QString& file, Events *, QReadWriteLock* events_lock_, QMap > *eidx_); + ~LogReader(); + void readyRead(); void done() { is_done = true; }; bool is_done = false; + private: bz_stream bStream; @@ -63,6 +69,3 @@ private: QReadWriteLock* events_lock; QMap > *eidx; }; - -#endif -