|
|
|
@ -57,7 +57,9 @@ size_t GpioControl::turnOnImpl(const IOT_PARAM& param)
|
|
|
|
|
m_items.push_back(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
ALOGI("PWR TurnOn cmd=%d,result=%d ref=%u\r\n",param.cmd, param.result, (uint32_t)references);
|
|
|
|
|
#endif
|
|
|
|
|
return references;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -88,7 +90,7 @@ int GpioControl::getInt(int cmd)
|
|
|
|
|
param.cmd = cmd;
|
|
|
|
|
ioctl(fd, IOT_PARAM_READ, ¶m);
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
ALOGI("getInt cmd=%d,value=%d,result=%d\r\n",param.cmd, param.value, param.result);
|
|
|
|
|
ALOGI("getInt cmd=%d,value=%d,result=%d",param.cmd, param.value, param.result);
|
|
|
|
|
#endif
|
|
|
|
|
close(fd);
|
|
|
|
|
return param.value;
|
|
|
|
@ -281,7 +283,9 @@ size_t GpioControl::TurnOff(int cmd, uint32_t delayedCloseTime/* = 0*/)
|
|
|
|
|
}
|
|
|
|
|
m_locker.unlock();
|
|
|
|
|
m_semaphore.release();
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
ALOGI("PWR TurnOff cmd=%d ref=%u", cmd, (uint32_t)ref);
|
|
|
|
|
#endif
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -371,6 +375,9 @@ void GpioControl::PowerControlThreadProc()
|
|
|
|
|
{
|
|
|
|
|
if (it->references == 0 && it->closeCmds == 0 && it->closeTime == 0)
|
|
|
|
|
{
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
ALOGI("PWR TH cmd=%d ref=%u closeCmds=%u", it->cmd, (uint32_t)it->references, (uint32_t)it->closeCmds);
|
|
|
|
|
#endif
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -395,6 +402,9 @@ void GpioControl::PowerControlThreadProc()
|
|
|
|
|
// close it directly
|
|
|
|
|
setInt(it->cmd, 0);
|
|
|
|
|
it->closeTime = 0;
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
ALOGI("PWR TH DO TurnOff cmd=%d", it->cmd);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -406,7 +416,9 @@ void GpioControl::PowerControlThreadProc()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
ALOGI("PWR TH cmd=%d ref=%u closeCmds=%u", it->cmd, (uint32_t)it->references, (uint32_t)it->closeCmds);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
m_locker.unlock();
|
|
|
|
|
|
|
|
|
|