Cleanup, add PKGBUILD
This commit is contained in:
@@ -56,11 +56,6 @@ FanGenerator::FindFans(vector<shared_ptr<Sensor>> rpmSensors,
|
||||
c->pwm(100);
|
||||
}
|
||||
|
||||
cout << "Resetting all fans" << endl;
|
||||
for (auto c : pwmControls) {
|
||||
c->Reset();
|
||||
}
|
||||
|
||||
return mapping;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ void HwmonFan::MinPWM(int value) { mMinPWM = value; }
|
||||
void HwmonFan::StartPWM(int value) { mStartPWM = value; }
|
||||
|
||||
void HwmonFan::FindMinPWM() {
|
||||
cout << "Looking for minimal PWM" << endl;
|
||||
int minPWM = 0;
|
||||
mMinPWM = 0;
|
||||
|
||||
|
||||
@@ -1,18 +1,45 @@
|
||||
#include <boost/program_options/options_description.hpp>
|
||||
#include <boost/program_options/parsers.hpp>
|
||||
#include <boost/program_options/value_semantic.hpp>
|
||||
#include <boost/program_options/variables_map.hpp>
|
||||
#include <csignal>
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
#include <App.h>
|
||||
|
||||
namespace po = boost::program_options;
|
||||
|
||||
App app;
|
||||
|
||||
static int doInitialSetup = 0;
|
||||
|
||||
void signal_handler(int s) { app.Shutdown(); }
|
||||
|
||||
int main() {
|
||||
int main(int argc, char **argv) {
|
||||
signal(SIGINT, signal_handler);
|
||||
|
||||
po::options_description desc("Allowed options");
|
||||
desc.add_options()("help", "produce help message")("setup", po::bool_switch(),
|
||||
"run initial setup");
|
||||
|
||||
po::variables_map vm;
|
||||
po::store(po::parse_command_line(argc, argv, desc), vm);
|
||||
po::notify(vm);
|
||||
|
||||
try {
|
||||
app.Init();
|
||||
app.NormalOperation();
|
||||
if (vm.count("help")) {
|
||||
std::cout << desc << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (vm.count("setup") && vm["setup"].as<bool>()) {
|
||||
app.InitialSetup();
|
||||
} else {
|
||||
app.Init();
|
||||
app.NormalOperation();
|
||||
}
|
||||
} catch (const std::exception &e) {
|
||||
std::cout << "An exception was caught: " << e.what() << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user