Skip to content

Commit 2a4e481

Browse files
authored
Merge pull request #12624 from OpenNuvoton/nuvoton_ec2x
Cellular: Support EC2x power control pin support no connect
2 parents eb07229 + 73b96c1 commit 2a4e481

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

features/cellular/framework/targets/QUECTEL/EC2X/QUECTEL_EC2X.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,12 @@ CellularDevice *CellularDevice::get_default_instance()
9797

9898
nsapi_error_t QUECTEL_EC2X::press_power_button(uint32_t timeout)
9999
{
100-
_pwr_key = _active_high;
101-
ThisThread::sleep_for(timeout);
102-
_pwr_key = !_active_high;
103-
ThisThread::sleep_for(100);
100+
if (_pwr_key.is_connected()) {
101+
_pwr_key = _active_high;
102+
ThisThread::sleep_for(timeout);
103+
_pwr_key = !_active_high;
104+
ThisThread::sleep_for(100);
105+
}
104106

105107
return NSAPI_ERROR_OK;
106108
}

0 commit comments

Comments
 (0)