20210928LTS04

Signed-off-by: guduhanyan <xuyanjun27@163.com>
This commit is contained in:
guduhanyan
2021-09-28 21:46:34 +08:00
parent 3f1f0e5426
commit 6e93876d29
2 changed files with 10 additions and 8 deletions
@@ -342,7 +342,7 @@ void PaddingAsyncCallbackInfoIsByCreateTimer(
napi_value CreateTimer(napi_env env, napi_callback_info info)
{
size_t argc = CREATE_MAX_PARA;
napi_value argv[CREATE_MAX_PARA];
napi_value argv[CREATE_MAX_PARA] = {0};
napi_value thisVar = nullptr;
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, NULL));
std::shared_ptr<ITimerInfoInstance> iTimerInfoInstance = std::make_shared<ITimerInfoInstance>();
@@ -444,7 +444,7 @@ void PaddingAsyncCallbackInfoIsByStartTimer(
napi_value StartTimer(napi_env env, napi_callback_info info)
{
size_t argc = START_MAX_PARA;
napi_value argv[START_MAX_PARA];
napi_value argv[START_MAX_PARA] = {0};
napi_value thisVar = nullptr;
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, NULL));
@@ -552,7 +552,7 @@ void PaddingAsyncCallbackInfoIsByStopTimer(
napi_value StopTimer(napi_env env, napi_callback_info info)
{
size_t argc = STOP_MAX_PARA;
napi_value argv[STOP_MAX_PARA];
napi_value argv[STOP_MAX_PARA] = {0};
napi_value thisVar = nullptr;
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, NULL));
@@ -657,7 +657,7 @@ void PaddingAsyncCallbackInfoIsByDestroyTimer(
napi_value DestroyTimer(napi_env env, napi_callback_info info)
{
size_t argc = DESTROY_MAX_PARA;
napi_value argv[DESTROY_MAX_PARA];
napi_value argv[DESTROY_MAX_PARA] = {0};
napi_value thisVar = nullptr;
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, NULL));
+6 -4
View File
@@ -173,14 +173,15 @@ void TimeService::PaserTimerPara(int32_t type, bool repeat, uint64_t interval, T
{
bool isRealtime = false;
bool isWakeup = false;
auto uIntType = static_cast<uint32_t>(type);
paras.flag = 0;
if ((type & TIMER_TYPE_REALTIME_MASK) > 0 ) {
if ((uIntType & TIMER_TYPE_REALTIME_MASK) > 0) {
isRealtime = true;
}
if ((type & TIMER_TYPE_REALTIME_WAKEUP_MASK) > 0) {
if ((uIntType & TIMER_TYPE_REALTIME_WAKEUP_MASK) > 0) {
isWakeup = true;
}
if ((type & TIMER_TYPE_EXACT_MASK) > 0) {
if ((uIntType & TIMER_TYPE_EXACT_MASK) > 0) {
paras.windowLength = 0;
}else{
paras.windowLength = -1;
@@ -341,7 +342,8 @@ int TimeService::set_rtc_time(time_t sec) {
strs << "/dev/rtc" << rtc_id;
auto rtc_dev = strs.str();
TIME_HILOGI(TIME_MODULE_SERVICE, "rtc_dev : %{public}s:", rtc_dev.data());
fd = open(rtc_dev.data(), O_RDWR);
auto rtc_data = rtc_dev.data();
fd = open(rtc_data, O_RDWR);
if (fd < 0) {
TIME_HILOGE(TIME_MODULE_SERVICE, "open failed %{public}s: %{public}s", rtc_dev.data(), strerror(errno));
return -1;