Add option to set frequency in json

This commit is contained in:
2022-10-18 11:05:05 +02:00
parent 596a30b76a
commit f718f82ad1
11 changed files with 71 additions and 13 deletions

View File

@@ -6,10 +6,10 @@
using namespace std;
#define TIMEOUT 500
Controller::Controller(vector<shared_ptr<FanCurve>> curves)
: mFanCurves(curves), mRun(false) {}
Controller::Controller(shared_ptr<Settings> settings,
vector<shared_ptr<FanCurve>> curves)
: mTimeout((1 / settings->Frequency()) * 1000), mFanCurves(curves),
mRun(false) {}
Controller::~Controller() { StopFanControlLoop(); }
@@ -32,6 +32,6 @@ void Controller::Loop() {
c->DoFanControl();
}
this_thread::sleep_for(chrono::milliseconds(TIMEOUT));
this_thread::sleep_for(chrono::milliseconds(mTimeout));
}
}