我在使用 ec200t 时遇到一个问题,模块 at 命令初始化之后一直打印 the power is off.,间隔为 EC200X_LINK_DELAY_TIME。
static int ec200x_check_link_status(struct at_device *device)
{
at_response_t resp = RT_NULL;
struct at_device_ec200x *ec200x = RT_NULL;
int result = -RT_ERROR;
ec200x = (struct at_device_ec200x *)device->user_data;
if ( ! ec200x->power_status)//power off
{
LOG_D("the power is off.");
return(-RT_ERROR);
}
/* ... */
}
目前我是做了以下修改规避这个问题
--- a/class/ec200x/at_device_ec200x.c
+++ b/class/ec200x/at_device_ec200x.c
@@ -44,6 +44,7 @@ static int ec200x_power_on(struct at_device *device)
if (ec200x->power_pin == -1)//no power on pin
{
+ ec200x->power_status = RT_TRUE;
return(RT_EOK);
}
if (ec200x->power_status_pin != -1)//use power status pin
@@ -82,6 +83,7 @@ static int ec200x_power_off(struct at_device *device)
if (ec200x->power_pin == -1)//no power on pin
{
+ ec200x->power_status = RT_FALSE;
return(RT_EOK);
}
if (ec200x->power_status_pin != -1)//use power status pin
您好,感谢 at_device。
我在使用 ec200t 时遇到一个问题,模块 at 命令初始化之后一直打印 the power is off.,间隔为
EC200X_LINK_DELAY_TIME
。目前我是做了以下修改规避这个问题
不知道这是 bug 还是我使用方式不对。