dCArun: Fix DigitalOutputAbstraction
This commit is contained in:
parent
cd6b1fed00
commit
2c09402bbb
@ -20,6 +20,7 @@ CArun::CArun(QObject *parent)
|
|||||||
|
|
||||||
this->timerChainCtrl->start();
|
this->timerChainCtrl->start();
|
||||||
|
|
||||||
|
|
||||||
this->digitalOutputAbstraction = new DigitalOutputAbstraction(this->HWaccess, this);
|
this->digitalOutputAbstraction = new DigitalOutputAbstraction(this->HWaccess, this);
|
||||||
this->digitalOutputAbstraction->addCCWake("/sys/class/leds/wakeupctrl_cc/brightness");
|
this->digitalOutputAbstraction->addCCWake("/sys/class/leds/wakeupctrl_cc/brightness");
|
||||||
this->digitalOutputAbstraction->addCCPower("/run/powerctrl_cc");
|
this->digitalOutputAbstraction->addCCPower("/run/powerctrl_cc");
|
||||||
|
@ -18,9 +18,9 @@ DigitalOutputAbstraction::DigitalOutputAbstraction(hwinf *dc, QObject *parent)
|
|||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, dc(dc)
|
, dc(dc)
|
||||||
{
|
{
|
||||||
auto fileMonitor = new QFileSystemWatcher(this);
|
this->fileMonitor = new QFileSystemWatcher(this);
|
||||||
|
|
||||||
connect(fileMonitor, &QFileSystemWatcher::fileChanged,
|
connect(this->fileMonitor, &QFileSystemWatcher::fileChanged,
|
||||||
this, &DigitalOutputAbstraction::fileChanged);
|
this, &DigitalOutputAbstraction::fileChanged);
|
||||||
|
|
||||||
qCritical() << "... init DigitalOutputAbstraction";
|
qCritical() << "... init DigitalOutputAbstraction";
|
||||||
@ -74,7 +74,7 @@ void DigitalOutputAbstraction::fileChanged(const QString &path)
|
|||||||
{
|
{
|
||||||
if (path == this->ccPowerPath) this->private_ccPowerChanged();
|
if (path == this->ccPowerPath) this->private_ccPowerChanged();
|
||||||
if (path == this->ccWakePath) this->private_ccWakeChanged();
|
if (path == this->ccWakePath) this->private_ccWakeChanged();
|
||||||
if (path == this->modemPowerPath) this->private_ccWakeChanged();
|
if (path == this->modemPowerPath) this->private_modemPowerChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DigitalOutputAbstraction::private_modemPowerChanged()
|
void DigitalOutputAbstraction::private_modemPowerChanged()
|
||||||
@ -87,7 +87,7 @@ void DigitalOutputAbstraction::private_modemPowerChanged()
|
|||||||
auto modemPower = modemPowerFile.readAll();
|
auto modemPower = modemPowerFile.readAll();
|
||||||
if (!modemPower.isEmpty()) {
|
if (!modemPower.isEmpty()) {
|
||||||
int state = modemPower.at(0);
|
int state = modemPower.at(0);
|
||||||
//qCritical() << "INFO: modemPower = " << modemPower;
|
// qCritical() << "INFO: modemPower = " << state;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case 0x30: // '0'
|
case 0x30: // '0'
|
||||||
qCritical() << "INFO: modemPower -> off";
|
qCritical() << "INFO: modemPower -> off";
|
||||||
@ -126,7 +126,7 @@ void DigitalOutputAbstraction::private_ccPowerChanged()
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//qCritical() << "INFO: modemPower = " << modemPower;
|
//qCritical() << "INFO: ccPower = " << state;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case 0x30: // '0'
|
case 0x30: // '0'
|
||||||
qCritical() << "INFO: ccPower -> off";
|
qCritical() << "INFO: ccPower -> off";
|
||||||
|
Loading…
Reference in New Issue
Block a user