提交 14566adf 编写于 作者: u010509634's avatar u010509634

fix:调整driver light 文档中示例代码格式

Signed-off-by: u010509634's avatarhgv5 <htxytchg@163.com>
上级 c19ab5a2
......@@ -180,9 +180,9 @@ The light driver model provides APIs to obtain information about all the lights
drvData->lightNum = parser->GetElemNum(light, "lightType");
....
for (i = 0; i < drvData->lightNum; ++i) {
/* Obtains the light type information. */
ret = parser->GetUint32ArrayElem(light, "lightType", i, &temp, 0);
CHECK_LIGHT_PARSER_RESULT_RETURN_VALUE(ret, "lightType");
/* Obtains the light type information. */
ret = parser->GetUint32ArrayElem(light, "lightType", i, &temp, 0);
CHECK_LIGHT_PARSER_RESULT_RETURN_VALUE(ret, "lightType");
}
for (i = 0; i < drvData->lightNum; ++i) {
......@@ -261,13 +261,13 @@ The light driver model provides APIs to obtain information about all the lights
/* Create a timer. */
if (OsalTimerCreate(&drvData->timer, drvData->info[lightType]->onTime,
LightTimerEntry, (uintptr_t)lightType) != HDF_SUCCESS) {
HDF_LOGE("%s: create light timer fail!", __func__);
return HDF_FAILURE;
HDF_LOGE("%s: create light timer fail!", __func__);
return HDF_FAILURE;
}
/* Start the periodic timer. */
if (OsalTimerStartLoop(&drvData->timer) != HDF_SUCCESS) {
HDF_LOGE("%s: start light timer fail!", __func__);
return HDF_FAILURE;
HDF_LOGE("%s: start light timer fail!", __func__);
return HDF_FAILURE;
}
}
return HDF_SUCCESS;
......
......@@ -180,9 +180,9 @@ Light驱动模型支持获取系统中所有灯的信息,动态配置闪烁模
drvData->lightNum = parser->GetElemNum(light, "lightType");
....
for (i = 0; i < drvData->lightNum; ++i) {
/* 获取灯的类型 */
ret = parser->GetUint32ArrayElem(light, "lightType", i, &temp, 0);
CHECK_LIGHT_PARSER_RESULT_RETURN_VALUE(ret, "lightType");
/* 获取灯的类型 */
ret = parser->GetUint32ArrayElem(light, "lightType", i, &temp, 0);
CHECK_LIGHT_PARSER_RESULT_RETURN_VALUE(ret, "lightType");
}
for (i = 0; i < drvData->lightNum; ++i) {
......@@ -261,13 +261,13 @@ Light驱动模型支持获取系统中所有灯的信息,动态配置闪烁模
/* 创建定时器 */
if (OsalTimerCreate(&drvData->timer, drvData->info[lightType]->onTime,
LightTimerEntry, (uintptr_t)lightType) != HDF_SUCCESS) {
HDF_LOGE("%s: create light timer fail!", __func__);
return HDF_FAILURE;
HDF_LOGE("%s: create light timer fail!", __func__);
return HDF_FAILURE;
}
/* 启动周期定时器 */
if (OsalTimerStartLoop(&drvData->timer) != HDF_SUCCESS) {
HDF_LOGE("%s: start light timer fail!", __func__);
return HDF_FAILURE;
HDF_LOGE("%s: start light timer fail!", __func__);
return HDF_FAILURE;
}
}
return HDF_SUCCESS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册