Compare commits
1
Commits
master
..
bd0bb9d5da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd0bb9d5da |
No files matched your search
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<class>AdaptiveBrightnessClass</class>
|
||||
<widget class="QMainWindow" name="AdaptiveBrightnessClass">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>450</width>
|
||||
<height>555</height>
|
||||
<width>406</width>
|
||||
<height>306</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -17,541 +17,48 @@
|
||||
<iconset resource="AdaptiveBrightness.qrc">
|
||||
<normaloff>:/AdaptiveBrightness/resources/system.ico</normaloff>:/AdaptiveBrightness/resources/system.ico</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="mainWidget">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="0" column="1">
|
||||
<widget class="QTabWidget" name="tabs">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Manual brightness control</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="monitorTab">
|
||||
<attribute name="title">
|
||||
<string>Monitors</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_12">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="monitorGroup">
|
||||
<property name="title">
|
||||
<string>Monitor</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_11">
|
||||
<item row="0" column="0">
|
||||
<widget class="QComboBox" name="monitorDropdown">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="monitorEnumerateButton">
|
||||
<property name="text">
|
||||
<string>Re-enumerate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="monitorLimitsGroup">
|
||||
<property name="title">
|
||||
<string>Limits</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_9">
|
||||
<item row="1" column="1">
|
||||
<widget class="QSlider" name="monitorMaxBrightnessSlider">
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="monitorMinBrightnessLabel">
|
||||
<property name="text">
|
||||
<string>Minimum</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSlider" name="monitorMinBrightnessSlider">
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="monitorMaxBrightnessLabel">
|
||||
<property name="text">
|
||||
<string>Maximum</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="monitorMinBrightnessValueLabel">
|
||||
<property name="text">
|
||||
<string>XXX%</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="monitorMaxBrightnessValueLabel">
|
||||
<property name="text">
|
||||
<string>XXX%</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="monitorBrightnessGroup">
|
||||
<property name="title">
|
||||
<string>Brightness</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QSlider" name="monitorBrightnessSlider">
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="monitorOverrideCheck">
|
||||
<property name="text">
|
||||
<string>Manual override</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="monitorBrightnessValueLabel">
|
||||
<property name="text">
|
||||
<string>XXX%</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="monitorOverallLimitsGroup">
|
||||
<property name="title">
|
||||
<string>Overall limits</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_10">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="monitorOverallMinBrightnessLabel">
|
||||
<property name="text">
|
||||
<string>Minimum</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSlider" name="monitorOverallMinBrightnessSlider">
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="monitorOverallMinBrightnessValueLabel">
|
||||
<property name="text">
|
||||
<string>XXX%</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="monitorOverallMaxBrightnessLabel">
|
||||
<property name="text">
|
||||
<string>Maximum</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSlider" name="monitorOverallMaxBrightnessSlider">
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="monitorOverallMaxBrightnessValueLabel">
|
||||
<property name="text">
|
||||
<string>XXX%</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<spacer name="monitorBottomSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>218</width>
|
||||
<height>35</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QPushButton" name="monitorResetButton">
|
||||
<property name="text">
|
||||
<string>Restore all monitors to defaults</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<spacer name="monitorResetSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="monitorOverallBrightnessGroup">
|
||||
<property name="title">
|
||||
<string>Overall brightness</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QSlider" name="monitorOverallBrightnessSlider">
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="monitorOverallBrightnessValueLabel">
|
||||
<property name="text">
|
||||
<string>XXX%</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="monitorOverallOverrideCheck">
|
||||
<property name="text">
|
||||
<string>Manual override</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<spacer name="monitorTopSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="sensorsTab">
|
||||
<attribute name="title">
|
||||
<string>Sensors</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="sensorGroup">
|
||||
<property name="title">
|
||||
<string>Sensor module</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="sensorEnumerateButton">
|
||||
<property name="text">
|
||||
<string>Re-enumerate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QComboBox" name="sensorDropdown">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="sensorReadoutGroup">
|
||||
<property name="title">
|
||||
<string>Readout</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTreeWidget" name="sensorReadoutValues">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="indentation">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Sensor</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Raw value</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Percentage</string>
|
||||
</property>
|
||||
</column>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>LDR1: Front</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>XXXX</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>XXX%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>LDR2: Bottom</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>XXXX</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>XXX%</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>LDR3: Top</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>XXXX</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>XXX%</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="sensorAggregationGroup">
|
||||
<property name="title">
|
||||
<string>Sensor aggregation</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="sensorAggregationFunctionLabel">
|
||||
<property name="text">
|
||||
<string>Function</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QComboBox" name="sensorAggregationFunctionDropdown">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="sensorAggregationResultLabel">
|
||||
<property name="text">
|
||||
<string>Module result:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="sensorAggregationValueLabel">
|
||||
<property name="text">
|
||||
<string>XXX%</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="sensorResetButton">
|
||||
<property name="text">
|
||||
<string>Restore all sensors to defaults</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<spacer name="sensorResetSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="sensorTotalAggregationGroup">
|
||||
<property name="title">
|
||||
<string>Total aggregation</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="sensorTotalAggregationFunctionLabel">
|
||||
<property name="text">
|
||||
<string>Function</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QComboBox" name="sensorTotalAggregationFunctionDropdown">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="sensorTotalAggregationResultLabel">
|
||||
<property name="text">
|
||||
<string>Result:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="sensorTotalAggregationValueLabel">
|
||||
<property name="text">
|
||||
<string>XXX%</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<spacer name="sensorTopSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<spacer name="sensorBottomSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QSlider" name="horizontalSlider">
|
||||
<property name="toolTip">
|
||||
<string>Brightness</string>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>406</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mainToolBar">
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
||||
@@ -1,50 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QFile>
|
||||
#include <QMessageLogger>
|
||||
#include <QString>
|
||||
#include <QTextStream>
|
||||
|
||||
static inline void rotateLog(const std::filesystem::path& logFileName, int numRotatingLogs)
|
||||
{
|
||||
const auto generateRotateNames = [&]() {
|
||||
std::vector<QString> rotateFileNames = {QString().fromStdString(logFileName.string())};
|
||||
|
||||
for(int i = 1; i < numRotatingLogs; ++i) {
|
||||
auto rotateName = logFileName.stem();
|
||||
rotateName += std::string(".") + std::to_string(i);
|
||||
rotateName += logFileName.extension();
|
||||
rotateFileNames.push_back(QString().fromStdString(rotateName.string()));
|
||||
}
|
||||
|
||||
return rotateFileNames;
|
||||
};
|
||||
|
||||
const auto rotateFileNames = generateRotateNames();
|
||||
|
||||
for(auto i = static_cast<int>(rotateFileNames.size()) - 2; i >= 0; --i) {
|
||||
QFile file(rotateFileNames[i]);
|
||||
QFile newFile(rotateFileNames[i + 1]);
|
||||
if(file.exists()) {
|
||||
newFile.remove();
|
||||
file.rename(rotateFileNames[i + 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void logToFile(QtMsgType msgType, [[maybe_unused]] const QMessageLogContext& msgContext, const QString& msg)
|
||||
{
|
||||
constexpr auto MAX_LOG_FILE_SIZE = 4 /*MiB*/ * 1024 * 1024;
|
||||
constexpr auto NUM_ROTATING_LOGS = 4;
|
||||
|
||||
const auto logFileName = std::filesystem::path{"AdaptiveBrightness.log"};
|
||||
constexpr auto LOG_FILE = "AdaptiveBrightness.log";
|
||||
|
||||
const auto dateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz");
|
||||
QString formattedMsg = QString("[%1] ").arg(dateTime);
|
||||
@@ -84,15 +48,9 @@ void logToFile(QtMsgType msgType, [[maybe_unused]] const QMessageLogContext& msg
|
||||
|
||||
formattedMsg += QString("%1").arg(msg);
|
||||
|
||||
QFile logFile(QString().fromStdString(logFileName.string()));
|
||||
QFile logFile(LOG_FILE);
|
||||
logFile.open(QIODevice::WriteOnly | QIODevice::Append);
|
||||
|
||||
if(logFile.size() > MAX_LOG_FILE_SIZE) {
|
||||
logFile.close();
|
||||
rotateLog(logFileName, NUM_ROTATING_LOGS);
|
||||
logFile.open(QIODevice::WriteOnly | QIODevice::Append);
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
constexpr auto qtEndl = Qt::endl;
|
||||
#else
|
||||
|
||||
@@ -5,12 +5,8 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <QAbstractButton>
|
||||
#include <QCloseEvent>
|
||||
#include <QGroupBox>
|
||||
#include <QSlider>
|
||||
#include <QTabWidget>
|
||||
#include <QWidget>
|
||||
#include <QtDebug>
|
||||
#include <QtGlobal>
|
||||
|
||||
@@ -19,21 +15,69 @@
|
||||
#include "sensor_driver.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), m_mtx(QMutex::RecursionMode::Recursive)
|
||||
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
|
||||
{
|
||||
qDebug(ltr("Creating main window"));
|
||||
|
||||
m_ui.setupUi(this);
|
||||
m_manualBrightnessSlider = m_ui.centralWidget->findChild<QGroupBox*>("groupBox")->findChild<QSlider*>("horizontalSlider");
|
||||
|
||||
enumSensors();
|
||||
enumMonitors();
|
||||
if(m_manualBrightnessSlider) {
|
||||
connect(m_manualBrightnessSlider, &QSlider::valueChanged, [this](int value) {
|
||||
const auto mappedBrightness = utils::map(value, 0, 100, 0.f, 1.f);
|
||||
const auto newBrightness = std::clamp(mappedBrightness, 0.f, 1.f);
|
||||
qDebug(ltr("Overriding brightness with %1").arg(newBrightness));
|
||||
m_brightness = newBrightness;
|
||||
});
|
||||
}
|
||||
|
||||
setupMonitorsTab();
|
||||
setupSensorsTab();
|
||||
loadIcons();
|
||||
|
||||
setupTrayIcon();
|
||||
if(!QSystemTrayIcon::isSystemTrayAvailable()) {
|
||||
qWarning(ltr("System tray is not available -> tray icon will be disabled"));
|
||||
}
|
||||
else {
|
||||
qDebug(ltr("System tray is available"));
|
||||
|
||||
setupCallbackTimer();
|
||||
m_trayIconMenu = new QMenu(this);
|
||||
m_showHideAction = m_trayIconMenu->addAction(tr("Show"), [this]() {
|
||||
if(m_visibility) {
|
||||
m_showHideAction->setText(tr("Show"));
|
||||
hide();
|
||||
}
|
||||
else {
|
||||
m_showHideAction->setText(tr("Hide"));
|
||||
show();
|
||||
}
|
||||
m_visibility = !m_visibility;
|
||||
});
|
||||
m_trayIconMenu->addSeparator();
|
||||
m_trayIconMenu->addAction(tr("Quit"), this, &QCoreApplication::quit);
|
||||
|
||||
qDebug(ltr("Tray icon context menu initialized"));
|
||||
|
||||
m_trayIcon = new QSystemTrayIcon(this);
|
||||
m_trayIcon->setIcon(*m_errorIcon);
|
||||
m_trayIcon->setContextMenu(m_trayIconMenu);
|
||||
m_trayIcon->show();
|
||||
m_trayIcon->setToolTip(tr("AdaptiveBrightness"));
|
||||
connect(m_trayIcon, &QSystemTrayIcon::activated, this, &MainWindow::trayIconClicked);
|
||||
|
||||
qDebug(ltr("Tray icon initialized"));
|
||||
}
|
||||
|
||||
m_timerThread = new QThread(this);
|
||||
m_timer = new QTimer(nullptr);
|
||||
m_timer->setInterval(1000);
|
||||
m_timer->moveToThread(m_timerThread);
|
||||
m_timerThread->connect(m_timer, &QTimer::timeout, this, &MainWindow::updateState, Qt::DirectConnection);
|
||||
m_timer->connect(m_timerThread, SIGNAL(started()), SLOT(start()));
|
||||
m_timerThread->start();
|
||||
|
||||
qDebug(ltr("Tray icon update timer started"));
|
||||
|
||||
m_sensors = enumerateSensors();
|
||||
m_monitors = enumerateMonitors();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
@@ -52,35 +96,6 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
||||
event->ignore();
|
||||
}
|
||||
|
||||
void MainWindow::enumSensors()
|
||||
{
|
||||
m_sensors.clear();
|
||||
|
||||
auto sensors = enumerateSensors();
|
||||
|
||||
for(auto& sensor: sensors) {
|
||||
m_sensors.push_back({std::move(sensor)});
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::enumMonitors()
|
||||
{
|
||||
m_mtx.lock();
|
||||
|
||||
m_ui.monitorDropdown->clear();
|
||||
m_monitors.clear();
|
||||
|
||||
auto monitors = enumerateMonitors();
|
||||
|
||||
for(auto& monitor: monitors) {
|
||||
const auto currentBrightness = monitor.getBrightness();
|
||||
m_monitors.push_back({std::move(monitor), 0.f, 1.f, currentBrightness, false});
|
||||
m_ui.monitorDropdown->addItem(m_monitors.back().driver.getName());
|
||||
}
|
||||
|
||||
m_mtx.unlock();
|
||||
}
|
||||
|
||||
void MainWindow::loadIcons()
|
||||
{
|
||||
qDebug(ltr("Loading icons"));
|
||||
@@ -116,194 +131,13 @@ void MainWindow::loadIcons()
|
||||
qDebug(ltr("Icons loaded"));
|
||||
}
|
||||
|
||||
void MainWindow::setupMonitorsTab()
|
||||
{
|
||||
connect(m_ui.monitorDropdown, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MainWindow::updateCurrentMonitorGUI);
|
||||
connect(m_ui.monitorEnumerateButton, &QAbstractButton::clicked, [this](bool) { enumMonitors(); });
|
||||
connect(m_ui.monitorResetButton, &QAbstractButton::clicked, [this](bool) { resetAllMonitorSettings(); });
|
||||
|
||||
setupLimitsSlider();
|
||||
setupOverallLimitsSlider();
|
||||
|
||||
setupBrightness();
|
||||
setupOverallBrightness();
|
||||
|
||||
resetAllMonitorSettings();
|
||||
}
|
||||
|
||||
void MainWindow::setupLimitsSlider()
|
||||
{
|
||||
connect(m_ui.monitorMinBrightnessSlider, &QSlider::valueChanged, [this](int value) {
|
||||
m_ui.monitorMinBrightnessValueLabel->setText(tr("%1%").arg(value, 3));
|
||||
if(value > m_ui.monitorMaxBrightnessSlider->value()) {
|
||||
m_ui.monitorMaxBrightnessSlider->setValue(value);
|
||||
}
|
||||
const auto curIdx = m_ui.monitorDropdown->currentIndex();
|
||||
m_monitors[curIdx].minBrightness = utils::map(value, 0, 100, 0.f, 1.f);
|
||||
});
|
||||
connect(m_ui.monitorMaxBrightnessSlider, &QSlider::valueChanged, [this](int value) {
|
||||
m_ui.monitorMaxBrightnessValueLabel->setText(tr("%1%").arg(value, 3));
|
||||
if(value < m_ui.monitorMinBrightnessSlider->value()) {
|
||||
m_ui.monitorMinBrightnessSlider->setValue(value);
|
||||
}
|
||||
const auto curIdx = m_ui.monitorDropdown->currentIndex();
|
||||
m_monitors[curIdx].maxBrightness = utils::map(value, 0, 100, 0.f, 1.f);
|
||||
});
|
||||
}
|
||||
|
||||
void MainWindow::setupOverallLimitsSlider()
|
||||
{
|
||||
connect(m_ui.monitorOverallMinBrightnessSlider, &QSlider::valueChanged, [this](int value) {
|
||||
m_ui.monitorOverallMinBrightnessValueLabel->setText(tr("%1%").arg(value, 3));
|
||||
if(value > m_ui.monitorOverallMaxBrightnessSlider->value()) {
|
||||
m_ui.monitorOverallMaxBrightnessSlider->setValue(value);
|
||||
}
|
||||
for(auto& monitor: m_monitors) {
|
||||
monitor.minBrightness = utils::map(value, 0, 100, 0.f, 1.f);
|
||||
}
|
||||
updateCurrentMonitorGUI(m_ui.monitorDropdown->currentIndex());
|
||||
});
|
||||
connect(m_ui.monitorOverallMaxBrightnessSlider, &QSlider::valueChanged, [this](int value) {
|
||||
m_ui.monitorOverallMaxBrightnessValueLabel->setText(tr("%1%").arg(value, 3));
|
||||
if(value < m_ui.monitorOverallMinBrightnessSlider->value()) {
|
||||
m_ui.monitorOverallMinBrightnessSlider->setValue(value);
|
||||
}
|
||||
for(auto& monitor: m_monitors) {
|
||||
monitor.maxBrightness = utils::map(value, 0, 100, 0.f, 1.f);
|
||||
}
|
||||
updateCurrentMonitorGUI(m_ui.monitorDropdown->currentIndex());
|
||||
});
|
||||
}
|
||||
|
||||
void MainWindow::setupBrightness()
|
||||
{
|
||||
m_ui.monitorBrightnessSlider->setDisabled(true);
|
||||
|
||||
connect(m_ui.monitorBrightnessSlider, &QSlider::valueChanged, [this](int value) {
|
||||
m_ui.monitorBrightnessValueLabel->setText(tr("%1%").arg(value, 3));
|
||||
const auto newBrightness = utils::map(value, 0, 100, 0.f, 1.f);
|
||||
qDebug(ltr("Overriding brightness with %1").arg(newBrightness));
|
||||
const auto curIdx = m_ui.monitorDropdown->currentIndex();
|
||||
m_monitors[curIdx].brightness = newBrightness;
|
||||
});
|
||||
|
||||
m_ui.monitorOverrideCheck->setChecked(false);
|
||||
connect(m_ui.monitorOverrideCheck, &QCheckBox::stateChanged, [this](int state) {
|
||||
m_ui.monitorBrightnessSlider->setEnabled(state == Qt::CheckState::Checked);
|
||||
const auto curIdx = m_ui.monitorDropdown->currentIndex();
|
||||
m_monitors[curIdx].manualOverride = state == Qt::CheckState::Checked;
|
||||
});
|
||||
}
|
||||
|
||||
void MainWindow::setupOverallBrightness()
|
||||
{
|
||||
m_ui.monitorOverallBrightnessSlider->setDisabled(true);
|
||||
|
||||
connect(m_ui.monitorOverallBrightnessSlider, &QSlider::valueChanged, [this](int value) {
|
||||
m_ui.monitorOverallBrightnessValueLabel->setText(tr("%1%").arg(value, 3));
|
||||
const auto newBrightness = utils::map(value, 0, 100, 0.f, 1.f);
|
||||
qDebug(ltr("Overriding overall brightness with %1").arg(newBrightness));
|
||||
for(auto& monitor: m_monitors) {
|
||||
if(monitor.manualOverride) {
|
||||
monitor.brightness = newBrightness;
|
||||
}
|
||||
}
|
||||
updateCurrentMonitorGUI(m_ui.monitorDropdown->currentIndex());
|
||||
});
|
||||
|
||||
m_ui.monitorOverallOverrideCheck->setChecked(false);
|
||||
connect(m_ui.monitorOverallOverrideCheck, &QCheckBox::stateChanged, [this](int state) {
|
||||
m_ui.monitorOverallBrightnessSlider->setEnabled(state == Qt::CheckState::Checked);
|
||||
for(auto& monitor: m_monitors) {
|
||||
monitor.manualOverride = state == Qt::CheckState::Checked;
|
||||
}
|
||||
updateCurrentMonitorGUI(m_ui.monitorDropdown->currentIndex());
|
||||
});
|
||||
}
|
||||
|
||||
void MainWindow::setupSensorsTab()
|
||||
{
|
||||
m_ui.tabs->removeTab(1);
|
||||
}
|
||||
|
||||
void MainWindow::setupTrayIcon()
|
||||
{
|
||||
loadIcons();
|
||||
|
||||
if(!QSystemTrayIcon::isSystemTrayAvailable()) {
|
||||
qWarning(ltr("System tray is not available -> tray icon will be disabled"));
|
||||
}
|
||||
else {
|
||||
qDebug(ltr("System tray is available"));
|
||||
|
||||
m_trayIconMenu = new QMenu(this);
|
||||
m_showHideAction = m_trayIconMenu->addAction(tr("Show"), [this]() {
|
||||
if(m_visibility) {
|
||||
m_showHideAction->setText(tr("Show"));
|
||||
hide();
|
||||
}
|
||||
else {
|
||||
m_showHideAction->setText(tr("Hide"));
|
||||
show();
|
||||
}
|
||||
m_visibility = !m_visibility;
|
||||
});
|
||||
m_trayIconMenu->addSeparator();
|
||||
m_trayIconMenu->addAction(tr("Quit"), this, &QCoreApplication::quit);
|
||||
|
||||
qDebug(ltr("Tray icon context menu initialized"));
|
||||
|
||||
m_trayIcon = new QSystemTrayIcon(this);
|
||||
m_trayIcon->setIcon(*m_errorIcon);
|
||||
m_trayIcon->setContextMenu(m_trayIconMenu);
|
||||
m_trayIcon->show();
|
||||
m_trayIcon->setToolTip(tr("AdaptiveBrightness"));
|
||||
connect(m_trayIcon, &QSystemTrayIcon::activated, this, &MainWindow::trayIconClicked);
|
||||
|
||||
qDebug(ltr("Tray icon initialized"));
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setupCallbackTimer()
|
||||
{
|
||||
m_timerThread = new QThread(this);
|
||||
m_timer = new QTimer(nullptr);
|
||||
m_timer->setInterval(1000);
|
||||
m_timer->moveToThread(m_timerThread);
|
||||
m_timerThread->connect(m_timer, &QTimer::timeout, this, &MainWindow::updateState, Qt::DirectConnection);
|
||||
m_timer->connect(m_timerThread, SIGNAL(started()), SLOT(start()));
|
||||
m_timerThread->start();
|
||||
|
||||
qDebug(ltr("Callback timer started"));
|
||||
}
|
||||
|
||||
void MainWindow::resetAllMonitorSettings()
|
||||
{
|
||||
m_ui.monitorOverallMinBrightnessSlider->setValue(0);
|
||||
m_ui.monitorOverallMaxBrightnessSlider->setValue(100);
|
||||
m_ui.monitorOverallOverrideCheck->setCheckState(Qt::CheckState::Unchecked);
|
||||
}
|
||||
|
||||
void MainWindow::updateCurrentMonitorGUI(int index)
|
||||
{
|
||||
if(index == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_ui.monitorMinBrightnessSlider->setValue(utils::map(m_monitors[index].minBrightness, 0.f, 1.f, 0, 100));
|
||||
m_ui.monitorMaxBrightnessSlider->setValue(utils::map(m_monitors[index].maxBrightness, 0.f, 1.f, 0, 100));
|
||||
m_ui.monitorBrightnessSlider->setValue(utils::map(m_monitors[index].brightness, 0.f, 1.f, 0, 100));
|
||||
m_ui.monitorOverrideCheck->setChecked(m_monitors[index].manualOverride);
|
||||
}
|
||||
|
||||
void MainWindow::updateState()
|
||||
{
|
||||
m_mtx.lock();
|
||||
|
||||
qDebug(ltr("Updating state"));
|
||||
|
||||
bool sensorError = false;
|
||||
bool monitorError = false;
|
||||
size_t iconBrightness = 0;
|
||||
|
||||
const auto getAverageSensorValue = [this](float& brightness) {
|
||||
if(m_sensors.empty()) {
|
||||
@@ -313,8 +147,8 @@ void MainWindow::updateState()
|
||||
std::vector<float> values;
|
||||
|
||||
for(auto& sensor: m_sensors) {
|
||||
const auto sensorValues = sensor.driver.readValues();
|
||||
if(!sensor.driver) {
|
||||
const auto sensorValues = sensor.readValues();
|
||||
if(!sensor) {
|
||||
return false;
|
||||
}
|
||||
values.insert(values.end(), sensorValues.begin(), sensorValues.end());
|
||||
@@ -324,22 +158,35 @@ void MainWindow::updateState()
|
||||
return true;
|
||||
};
|
||||
|
||||
auto brightness = NAN;
|
||||
const auto setAllMonitorsBrightness = [this](float& brightness) {
|
||||
if(m_monitors.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!getAverageSensorValue(brightness)) {
|
||||
enumSensors();
|
||||
bool errorOccurred = false;
|
||||
for(auto& monitor: m_monitors) {
|
||||
if(!monitor.setBrightness(brightness)) {
|
||||
errorOccurred = true;
|
||||
}
|
||||
}
|
||||
return !errorOccurred;
|
||||
};
|
||||
|
||||
if(!getAverageSensorValue(m_brightness)) {
|
||||
m_sensors = enumerateSensors();
|
||||
qInfo(ltr("At least one sensor became invalid, re-enumerating sensors found %1 valid sensor(s)").arg(m_sensors.size()));
|
||||
sensorError = true;
|
||||
}
|
||||
|
||||
if(!setMonitorBrightness(brightness)) {
|
||||
enumMonitors();
|
||||
const auto roundedBrightness = std::round(utils::map(m_brightness, 0.f, 1.f, 0, 8));
|
||||
iconBrightness = std::clamp<size_t>(roundedBrightness, 0, 8);
|
||||
|
||||
if(!setAllMonitorsBrightness(m_brightness)) {
|
||||
m_monitors = enumerateMonitors();
|
||||
qInfo(ltr("At least one monitor became invalid, re-enumerating monitors found %1 valid monitor(s)").arg(m_monitors.size()));
|
||||
monitorError = true;
|
||||
}
|
||||
|
||||
const auto iconBrightness = utils::map(brightness, 0.f, 1.f, size_t{0}, size_t{8});
|
||||
|
||||
if(!sensorError && !monitorError && m_trayIcon) {
|
||||
m_trayIcon->setIcon(*m_sensorStateIcons[iconBrightness]);
|
||||
}
|
||||
@@ -351,80 +198,12 @@ void MainWindow::updateState()
|
||||
}
|
||||
|
||||
if(m_trayIcon) {
|
||||
m_trayIcon->setToolTip(tr("AdaptiveBrightness - %1%").arg(brightness * 100, 0, 'f', 0));
|
||||
m_trayIcon->setToolTip(tr("AdaptiveBrightness - %1%").arg(m_brightness * 100, 0, 'f', 0));
|
||||
}
|
||||
|
||||
m_mtx.unlock();
|
||||
}
|
||||
|
||||
bool MainWindow::setMonitorBrightness(float& brightness)
|
||||
{
|
||||
constexpr auto hysteresis = [](const auto& lowThreshold, const auto& highThreshold, const auto& currentValue, const auto& newValue) {
|
||||
if(newValue > highThreshold || newValue < lowThreshold)
|
||||
return newValue;
|
||||
return currentValue;
|
||||
};
|
||||
|
||||
if(m_monitors.empty()) {
|
||||
return false;
|
||||
if(m_manualBrightnessSlider) {
|
||||
m_manualBrightnessSlider->setValue(utils::map(m_brightness, 0.f, 1.f, 0, 100));
|
||||
}
|
||||
|
||||
bool errorOccurred = false;
|
||||
bool allMonitorsSameBrightness = true;
|
||||
|
||||
for(size_t i = 0; i < m_monitors.size(); ++i) {
|
||||
const auto updateMonitorBrightness = [&] {
|
||||
const auto brightnessRange = m_monitors[i].maxBrightness - m_monitors[i].minBrightness;
|
||||
const auto hysteresisDelta = m_monitors[i].manualOverride ? 0.f : m_monitors[i].HYSTERESIS_THRESHOLD * brightnessRange;
|
||||
const auto lowThreshold = std::clamp(m_monitors[i].prevBrightness - hysteresisDelta, m_monitors[i].minBrightness, m_monitors[i].maxBrightness);
|
||||
const auto highThreshold = std::clamp(m_monitors[i].prevBrightness + hysteresisDelta, m_monitors[i].minBrightness, m_monitors[i].maxBrightness);
|
||||
if(hysteresis(lowThreshold, highThreshold, m_monitors[i].prevBrightness, m_monitors[i].brightness) != m_monitors[i].prevBrightness) {
|
||||
qDebug(ltr("Setting monitor %1 brightness from %2 to %3")
|
||||
.arg(i)
|
||||
.arg(m_monitors[i].prevBrightness, 0, 'f', 2)
|
||||
.arg(m_monitors[i].brightness, 0, 'f', 2));
|
||||
m_monitors[i].prevBrightness = m_monitors[i].brightness;
|
||||
return m_monitors[i].driver.setBrightness(m_monitors[i].brightness);
|
||||
}
|
||||
else {
|
||||
qDebug(ltr("Hysteresis prevented setting monitor %1 brightness from %2 to %3")
|
||||
.arg(i)
|
||||
.arg(m_monitors[i].prevBrightness, 0, 'f', 2)
|
||||
.arg(m_monitors[i].brightness, 0, 'f', 2));
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
if(!std::isnan(brightness) && !m_monitors[i].manualOverride) {
|
||||
m_monitors[i].brightness = brightness;
|
||||
}
|
||||
|
||||
m_monitors[i].brightness = std::clamp(m_monitors[i].brightness, m_monitors[i].minBrightness, m_monitors[i].maxBrightness);
|
||||
|
||||
if(i > 0 && m_monitors[i - 1].brightness != m_monitors[i].brightness) {
|
||||
allMonitorsSameBrightness = false;
|
||||
}
|
||||
|
||||
if(!updateMonitorBrightness()) {
|
||||
errorOccurred = true;
|
||||
}
|
||||
else if(m_ui.monitorDropdown->currentIndex() == static_cast<int>(i)) {
|
||||
updateCurrentMonitorGUI(static_cast<int>(i));
|
||||
}
|
||||
}
|
||||
|
||||
if(!errorOccurred) {
|
||||
auto avgBrightness = 0.f;
|
||||
std::for_each(m_monitors.begin(), m_monitors.end(), [&avgBrightness](const auto& mon) { avgBrightness += mon.brightness; });
|
||||
avgBrightness /= m_monitors.size();
|
||||
brightness = avgBrightness;
|
||||
}
|
||||
|
||||
if(allMonitorsSameBrightness) {
|
||||
m_ui.monitorOverallBrightnessSlider->setValue(utils::map(brightness, 0.f, 1.f, 0, 100));
|
||||
}
|
||||
|
||||
return !errorOccurred;
|
||||
}
|
||||
|
||||
void MainWindow::trayIconClicked(QSystemTrayIcon::ActivationReason reason)
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <QIcon>
|
||||
#include <QMainWindow>
|
||||
#include <QMenu>
|
||||
#include <QMutex>
|
||||
#include <QSlider>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QThread>
|
||||
@@ -29,33 +28,13 @@ class MainWindow : public QMainWindow {
|
||||
private:
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
||||
void enumSensors();
|
||||
void enumMonitors();
|
||||
|
||||
void loadIcons();
|
||||
|
||||
void setupMonitorsTab();
|
||||
void setupLimitsSlider();
|
||||
void setupOverallLimitsSlider();
|
||||
void setupBrightness();
|
||||
void setupOverallBrightness();
|
||||
|
||||
void setupSensorsTab();
|
||||
|
||||
void setupTrayIcon();
|
||||
void setupCallbackTimer();
|
||||
|
||||
void resetAllMonitorSettings();
|
||||
|
||||
void updateCurrentMonitorGUI(int index);
|
||||
|
||||
void updateState();
|
||||
|
||||
bool setMonitorBrightness(float& brightness);
|
||||
|
||||
void trayIconClicked(QSystemTrayIcon::ActivationReason reason);
|
||||
|
||||
Ui::MainWindow m_ui;
|
||||
Ui::AdaptiveBrightnessClass m_ui;
|
||||
|
||||
std::array<std::unique_ptr<QIcon>, 9> m_noSensorStateIcons;
|
||||
std::array<std::unique_ptr<QIcon>, 9> m_sensorStateIcons;
|
||||
@@ -68,23 +47,11 @@ class MainWindow : public QMainWindow {
|
||||
|
||||
QThread* m_timerThread = nullptr;
|
||||
QTimer* m_timer = nullptr;
|
||||
QMutex m_mtx;
|
||||
|
||||
struct SensorData {
|
||||
Sensor driver;
|
||||
};
|
||||
QSlider* m_manualBrightnessSlider = nullptr;
|
||||
|
||||
struct MonitorData {
|
||||
static constexpr auto HYSTERESIS_THRESHOLD = 0.05f;
|
||||
float m_brightness = 0.5f;
|
||||
|
||||
Monitor driver;
|
||||
float minBrightness;
|
||||
float maxBrightness;
|
||||
float brightness;
|
||||
float prevBrightness;
|
||||
bool manualOverride;
|
||||
};
|
||||
|
||||
std::vector<SensorData> m_sensors;
|
||||
std::vector<MonitorData> m_monitors;
|
||||
std::vector<Sensor> m_sensors;
|
||||
std::vector<Monitor> m_monitors;
|
||||
};
|
||||
@@ -10,8 +10,6 @@
|
||||
#include <physicalmonitorenumerationapi.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace detail {
|
||||
|
||||
extern BOOL enumMonitorsCallback(HMONITOR, HDC, LPRECT, LPARAM);
|
||||
@@ -28,8 +26,6 @@ class Monitor {
|
||||
bool setBrightness(float percentage);
|
||||
float getBrightness();
|
||||
|
||||
QString getName() const;
|
||||
|
||||
operator bool() const;
|
||||
|
||||
private:
|
||||
@@ -57,8 +53,6 @@ class Monitor {
|
||||
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
|
||||
#include <QString>
|
||||
|
||||
class Monitor {
|
||||
public:
|
||||
Monitor();
|
||||
@@ -66,8 +60,6 @@ class Monitor {
|
||||
bool setBrightness(float);
|
||||
float getBrightness();
|
||||
|
||||
QString getName() const;
|
||||
|
||||
operator bool() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -26,12 +26,6 @@ float Monitor::getBrightness()
|
||||
return NAN;
|
||||
}
|
||||
|
||||
QString Monitor::getName() const
|
||||
{
|
||||
qWarning(ltr("Getting monitor name not implemented"));
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
Monitor::operator bool() const
|
||||
{
|
||||
qWarning(ltr("Checking monitor validity not implemented"));
|
||||
|
||||
@@ -24,8 +24,6 @@ Monitor::Monitor(Monitor&& other) noexcept
|
||||
other.m_hMonitor = 0;
|
||||
other.m_physicalMonitor.name.clear();
|
||||
other.m_physicalMonitor.handle = 0;
|
||||
other.m_brightnessRange.reset();
|
||||
other.m_errorOccurred = false;
|
||||
}
|
||||
|
||||
Monitor::~Monitor()
|
||||
@@ -64,7 +62,8 @@ bool Monitor::setBrightness(float percentage)
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto newBrightness = utils::map(percentage, 0.f, 1.f, m_brightnessRange->first, m_brightnessRange->second);
|
||||
const auto mappedBrightness = utils::map(percentage, 0.f, 1.f, m_brightnessRange->first, m_brightnessRange->second);
|
||||
const auto newBrightness = std::clamp<DWORD>(std::round(mappedBrightness), m_brightnessRange->first, m_brightnessRange->second);
|
||||
|
||||
if(!SetMonitorBrightness(m_physicalMonitor.handle, newBrightness)) {
|
||||
qCritical(ltr("Failed to set brightness of monitor '%1' with handle '0x%2' and physical handle '0x%3', error: %4")
|
||||
@@ -109,15 +108,7 @@ float Monitor::getBrightness()
|
||||
m_brightnessRange = std::pair{minBrightness, maxBrightness};
|
||||
m_errorOccurred = false;
|
||||
|
||||
return utils::map(brightness, minBrightness, maxBrightness, 0.f, 1.f);
|
||||
}
|
||||
|
||||
QString Monitor::getName() const
|
||||
{
|
||||
return QString("%1 (0x%2:0x%3)")
|
||||
.arg(m_physicalMonitor.name)
|
||||
.arg(reinterpret_cast<qulonglong>(m_hMonitor), 0, 16)
|
||||
.arg(reinterpret_cast<qulonglong>(m_physicalMonitor.handle), 0, 16);
|
||||
return std::clamp(utils::map(brightness, minBrightness, maxBrightness, 0.f, 1.f), 0.f, 1.f);
|
||||
}
|
||||
|
||||
Monitor::operator bool() const
|
||||
|
||||
@@ -15,13 +15,6 @@ Sensor::~Sensor()
|
||||
qDebug(ltr("Destroying sensor on serial port %1").arg(m_serialPortName));
|
||||
}
|
||||
|
||||
Sensor::Sensor(Sensor&& other) noexcept : m_serialPortName(other.m_serialPortName), m_errorOccurred(other.m_errorOccurred), m_range(other.m_range)
|
||||
{
|
||||
other.m_serialPortName.clear();
|
||||
other.m_errorOccurred = false;
|
||||
other.m_range.reset();
|
||||
}
|
||||
|
||||
std::vector<float> Sensor::readValues()
|
||||
{
|
||||
qDebug(ltr("Reading values of sensor on port %1").arg(m_serialPortName));
|
||||
@@ -47,7 +40,8 @@ std::vector<float> Sensor::readValues()
|
||||
std::vector<float> normalizedValues;
|
||||
|
||||
for(const auto& value: values) {
|
||||
normalizedValues.push_back(utils::map(value, m_range->first, m_range->second, 0.f, 1.f));
|
||||
const auto mappedValue = utils::map(value, m_range->first, m_range->second, 0.f, 1.f);
|
||||
normalizedValues.push_back(std::clamp(mappedValue, 0.f, 1.f));
|
||||
}
|
||||
|
||||
return normalizedValues;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
|
||||
class Sensor {
|
||||
public:
|
||||
Sensor(const Sensor&) = delete;
|
||||
Sensor(Sensor&& other) noexcept;
|
||||
~Sensor();
|
||||
|
||||
std::vector<float> readValues();
|
||||
@@ -28,7 +26,7 @@ class Sensor {
|
||||
|
||||
static constexpr auto SUPPORTED_FIRMWARE = std::string_view{"AdaptiveBrightness v1.2"};
|
||||
|
||||
QString m_serialPortName;
|
||||
const QString m_serialPortName;
|
||||
bool m_errorOccurred = false;
|
||||
|
||||
std::optional<std::pair<int, int>> m_range;
|
||||
|
||||
@@ -21,7 +21,7 @@ std::vector<Sensor> enumerateSensors()
|
||||
auto sensor = Sensor(portInfo.portName());
|
||||
if(sensor.isValidSensor()) {
|
||||
qInfo(ltr("Successfully enumerated sensor on port %1").arg(portInfo.portName()));
|
||||
sensors.push_back(std::move(sensor));
|
||||
sensors.push_back(sensor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <type_traits>
|
||||
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
|
||||
namespace utils {
|
||||
|
||||
template<typename InType, typename OutType>
|
||||
auto interpolate(InType value, InType inMin, InType inMax, OutType outMin, OutType outMax)
|
||||
{
|
||||
return (value - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
|
||||
}
|
||||
|
||||
template<typename InType, typename OutType>
|
||||
auto map(InType value, InType inMin, InType inMax, OutType outMin, OutType outMax)
|
||||
{
|
||||
if constexpr(std::is_integral_v<OutType>) {
|
||||
return std::clamp(static_cast<OutType>(std::round(interpolate(value, inMin, inMax, outMin, outMax))), outMin, outMax);
|
||||
}
|
||||
|
||||
return std::clamp(static_cast<OutType>(interpolate(value, inMin, inMax, outMin, outMax)), outMin, outMax);
|
||||
return (value - inMin) * (outMax - outMin) / (inMax - inMin) + outMin;
|
||||
}
|
||||
|
||||
template<typename>
|
||||
|
||||
+3
-9
@@ -71,16 +71,10 @@ target_link_libraries(AdaptiveBrightness
|
||||
Qt5::SerialPort
|
||||
)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||
target_link_libraries(AdaptiveBrightness
|
||||
stdc++fs
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
target_link_libraries(AdaptiveBrightness
|
||||
Dxva2.lib
|
||||
)
|
||||
target_link_libraries(AdaptiveBrightness
|
||||
Dxva2.lib
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
[PreviousGenFiles]
|
||||
HeaderPath=D:/dev/AdaptiveBrightness/firmware/Inc
|
||||
HeaderFiles=gpio.h;adc.h;usb_device.h;usbd_conf.h;usbd_desc.h;usbd_cdc_if.h;stm32f0xx_it.h;stm32f0xx_hal_conf.h;main.h;iwdg.h;
|
||||
SourcePath=D:/dev/AdaptiveBrightness/firmware/Src
|
||||
SourceFiles=gpio.c;adc.c;usb_device.c;usbd_conf.c;usbd_desc.c;usbd_cdc_if.c;stm32f0xx_it.c;stm32f0xx_hal_msp.c;main.c;iwdg.c;
|
||||
|
||||
[PreviousLibFiles]
|
||||
LibFiles=Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pcd.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pcd_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_ll_usb.h;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_usb.c;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_def.h;Drivers/STM32F0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_cortex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_exti.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_adc.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_adc_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_iwdg.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim_ex.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_core.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ctlreq.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ioreq.h;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc.h;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_gpio.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_dma.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_exti.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_iwdg.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim_ex.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pcd.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pcd_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_ll_usb.h;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_usb.c;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_def.h;Drivers/STM32F0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_cortex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_exti.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_adc.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_adc_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_iwdg.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim_ex.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_core.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ctlreq.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ioreq.h;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc.h;Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f042x6.h;Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f0xx.h;Drivers/CMSIS/Device/ST/STM32F0xx/Include/system_stm32f0xx.h;Drivers/CMSIS/Device/ST/STMLine truncated
|
||||
|
||||
[PreviousUsedMakefileFiles]
|
||||
SourceFiles=Src\main.c;Src\gpio.c;Src\adc.c;Src\iwdg.c;Src\usb_device.c;Src\usbd_conf.c;Src\usbd_desc.c;Src\usbd_cdc_if.c;Src\stm32f0xx_it.c;Src\stm32f0xx_hal_msp.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_usb.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_gpio.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_dma.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_exti.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_iwdg.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim_ex.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;Src/system_stm32f0xx.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_usb.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_gpio.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_dma.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_exti.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_iwdg.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim_ex.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;Src/system_stm32f0xx.c;Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c;;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;
|
||||
HeaderPath=Drivers\STM32F0xx_HAL_Driver\Inc;Drivers\STM32F0xx_HAL_Driver\Inc\Legacy;Middlewares\ST\STM32_USB_Device_Library\Core\Inc;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Inc;Drivers\CMSIS\Device\ST\STM32F0xx\Include;Drivers\CMSIS\Include;Inc;
|
||||
CDefines=USE_HAL_DRIVER;STM32F042x6;USE_HAL_DRIVER;USE_HAL_DRIVER;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
[PreviousGenFiles]
|
||||
HeaderPath=D:/dev/AdaptiveBrightness/AdaptiveBrightnessFirmware/Inc
|
||||
HeaderFiles=gpio.h;adc.h;usb_device.h;usbd_conf.h;usbd_desc.h;usbd_cdc_if.h;stm32f0xx_it.h;stm32f0xx_hal_conf.h;main.h;
|
||||
SourcePath=D:/dev/AdaptiveBrightness/AdaptiveBrightnessFirmware/Src
|
||||
SourceFiles=gpio.c;adc.c;usb_device.c;usbd_conf.c;usbd_desc.c;usbd_cdc_if.c;stm32f0xx_it.c;stm32f0xx_hal_msp.c;main.c;
|
||||
|
||||
[PreviousLibFiles]
|
||||
LibFiles=Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pcd.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pcd_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_ll_usb.h;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_usb.c;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_def.h;Drivers/STM32F0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_cortex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_exti.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_adc.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_adc_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim_ex.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_core.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ctlreq.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ioreq.h;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc.h;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_gpio.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_dma.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_exti.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim_ex.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pcd.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pcd_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_ll_usb.h;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_usb.c;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_rcc_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_def.h;Drivers/STM32F0xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_i2c_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_gpio_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_dma.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_cortex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_pwr_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_flash_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_exti.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_adc.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_adc_ex.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim.h;Drivers/STM32F0xx_HAL_Driver/Inc/stm32f0xx_hal_tim_ex.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_core.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ctlreq.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h;Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_ioreq.h;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc.h;Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f042x6.h;Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f0xx.h;Drivers/CMSIS/Device/ST/STM32F0xx/Include/system_stm32f0xx.h;Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/cmsis_compiler.h;DriveLine truncated
|
||||
|
||||
[PreviousUsedMakefileFiles]
|
||||
SourceFiles=Src\main.c;Src\gpio.c;Src\adc.c;Src\usb_device.c;Src\usbd_conf.c;Src\usbd_desc.c;Src\usbd_cdc_if.c;Src\stm32f0xx_it.c;Src\stm32f0xx_hal_msp.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_usb.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_gpio.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_dma.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_exti.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim_ex.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;Src/system_stm32f0xx.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_usb.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_i2c_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_gpio.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_dma.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pwr_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_flash_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_exti.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc_ex.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim.c;Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim_ex.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;Src/system_stm32f0xx.c;Drivers/CMSIS/Device/ST/STM32F0xx/Source/Templates/system_stm32f0xx.c;;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c;Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c;Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c;
|
||||
HeaderPath=Drivers\STM32F0xx_HAL_Driver\Inc;Drivers\STM32F0xx_HAL_Driver\Inc\Legacy;Middlewares\ST\STM32_USB_Device_Library\Core\Inc;Middlewares\ST\STM32_USB_Device_Library\Class\CDC\Inc;Drivers\CMSIS\Device\ST\STM32F0xx\Include;Drivers\CMSIS\Include;Inc;
|
||||
CDefines=USE_HAL_DRIVER;STM32F042x6;USE_HAL_DRIVER;USE_HAL_DRIVER;
|
||||
|
||||
+12
-16
@@ -6,21 +6,19 @@ GPIO.groupedBy=Group By Peripherals
|
||||
KeepUserPlacement=false
|
||||
Mcu.Family=STM32F0
|
||||
Mcu.IP0=ADC
|
||||
Mcu.IP1=IWDG
|
||||
Mcu.IP2=NVIC
|
||||
Mcu.IP3=RCC
|
||||
Mcu.IP4=SYS
|
||||
Mcu.IP5=USB
|
||||
Mcu.IP6=USB_DEVICE
|
||||
Mcu.IPNb=7
|
||||
Mcu.IP1=NVIC
|
||||
Mcu.IP2=RCC
|
||||
Mcu.IP3=SYS
|
||||
Mcu.IP4=USB
|
||||
Mcu.IP5=USB_DEVICE
|
||||
Mcu.IPNb=6
|
||||
Mcu.Name=STM32F042K(4-6)Tx
|
||||
Mcu.Package=LQFP32
|
||||
Mcu.Pin0=PA0
|
||||
Mcu.Pin1=PA1
|
||||
Mcu.Pin10=PB8
|
||||
Mcu.Pin11=VP_IWDG_VS_IWDG
|
||||
Mcu.Pin12=VP_SYS_VS_Systick
|
||||
Mcu.Pin13=VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS
|
||||
Mcu.Pin11=VP_SYS_VS_Systick
|
||||
Mcu.Pin12=VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS
|
||||
Mcu.Pin2=PA2
|
||||
Mcu.Pin3=PA7
|
||||
Mcu.Pin4=PB0
|
||||
@@ -29,7 +27,7 @@ Mcu.Pin6=PA11
|
||||
Mcu.Pin7=PA12
|
||||
Mcu.Pin8=PA13
|
||||
Mcu.Pin9=PA14
|
||||
Mcu.PinsNb=14
|
||||
Mcu.PinsNb=13
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F042K6Tx
|
||||
@@ -89,13 +87,13 @@ ProjectManager.ComputerToolchain=false
|
||||
ProjectManager.CoupleFile=true
|
||||
ProjectManager.CustomerFirmwarePackage=
|
||||
ProjectManager.DefaultFWLocation=true
|
||||
ProjectManager.DeletePrevious=false
|
||||
ProjectManager.DeletePrevious=true
|
||||
ProjectManager.DeviceId=STM32F042K6Tx
|
||||
ProjectManager.FirmwarePackage=STM32Cube FW_F0 V1.11.0
|
||||
ProjectManager.FreePins=false
|
||||
ProjectManager.HalAssertFull=false
|
||||
ProjectManager.HeapSize=0x000
|
||||
ProjectManager.KeepUserCode=true
|
||||
ProjectManager.KeepUserCode=false
|
||||
ProjectManager.LastFirmware=true
|
||||
ProjectManager.LibraryCopy=1
|
||||
ProjectManager.MainLocation=Src
|
||||
@@ -108,7 +106,7 @@ ProjectManager.StackSize=0x700
|
||||
ProjectManager.TargetToolchain=Makefile
|
||||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UnderRoot=false
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_ADC_Init-ADC-false-HAL-true,4-MX_USB_DEVICE_Init-USB_DEVICE-false-HAL-false,5-MX_IWDG_Init-IWDG-false-HAL-true
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_ADC_Init-ADC-false-HAL-true,4-MX_USB_DEVICE_Init-USB_DEVICE-false-HAL-false
|
||||
RCC.AHBFreq_Value=48000000
|
||||
RCC.APB1Freq_Value=48000000
|
||||
RCC.APB1TimFreq_Value=48000000
|
||||
@@ -134,8 +132,6 @@ USB_DEVICE.IPParameters=VirtualMode,VirtualModeFS,CLASS_NAME_FS,PRODUCT_STRING_C
|
||||
USB_DEVICE.PRODUCT_STRING_CDC_FS=AdaptiveBrightness
|
||||
USB_DEVICE.VirtualMode=Cdc
|
||||
USB_DEVICE.VirtualModeFS=Cdc_FS
|
||||
VP_IWDG_VS_IWDG.Mode=IWDG_Activate
|
||||
VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
VP_USB_DEVICE_VS_USB_DEVICE_CDC_FS.Mode=CDC_FS
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -42,7 +42,7 @@
|
||||
/*#define HAL_TSC_MODULE_ENABLED */
|
||||
/*#define HAL_DAC_MODULE_ENABLED */
|
||||
/*#define HAL_I2S_MODULE_ENABLED */
|
||||
#define HAL_IWDG_MODULE_ENABLED
|
||||
/*#define HAL_IWDG_MODULE_ENABLED */
|
||||
/*#define HAL_LCD_MODULE_ENABLED */
|
||||
/*#define HAL_LPTIM_MODULE_ENABLED */
|
||||
/*#define HAL_RNG_MODULE_ENABLED */
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
##########################################################################################################################
|
||||
# File automatically-generated by tool: [projectgenerator] version: [3.7.1] date: [Thu Jul 09 19:18:35 CEST 2020]
|
||||
# File automatically-generated by tool: [projectgenerator] version: [3.7.1] date: [Sun Jun 28 13:32:11 CEST 2020]
|
||||
# and modified by hand
|
||||
##########################################################################################################################
|
||||
|
||||
@@ -38,7 +38,6 @@ BUILD_DIR = build
|
||||
# C sources
|
||||
C_SOURCES = \
|
||||
Src/init.c \
|
||||
Src/iwdg.c \
|
||||
Src/gpio.c \
|
||||
Src/adc.c \
|
||||
Src/usb_device.c \
|
||||
@@ -66,7 +65,6 @@ Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc.c \
|
||||
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_adc_ex.c \
|
||||
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim.c \
|
||||
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_tim_ex.c \
|
||||
Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_iwdg.c \
|
||||
Src/system_stm32f0xx.c \
|
||||
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c \
|
||||
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c \
|
||||
@@ -149,6 +147,7 @@ C_INCLUDES = \
|
||||
-IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc \
|
||||
-IMiddlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc \
|
||||
-IDrivers/CMSIS/Device/ST/STM32F0xx/Include \
|
||||
-IDrivers/CMSIS/Include \
|
||||
-IDrivers/CMSIS/Include
|
||||
|
||||
# C++ includes
|
||||
@@ -159,6 +158,7 @@ CXX_INCLUDES = \
|
||||
-IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc \
|
||||
-IMiddlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc \
|
||||
-IDrivers/CMSIS/Device/ST/STM32F0xx/Include \
|
||||
-IDrivers/CMSIS/Include \
|
||||
-IDrivers/CMSIS/Include
|
||||
|
||||
|
||||
File renamed without changes.
Loaded 100 of 132 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user