Merge pull request #12624 from OpenNuvoton/nuvoton_ec2x

Cellular: Support EC2x power control pin support no connect
pull/12631/head
Martin Kojtal 2020-03-16 14:34:58 +00:00 committed by GitHub
commit 2a4e48179d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -97,10 +97,12 @@ CellularDevice *CellularDevice::get_default_instance()
nsapi_error_t QUECTEL_EC2X::press_power_button(uint32_t timeout)
{
if (_pwr_key.is_connected()) {
_pwr_key = _active_high;
ThisThread::sleep_for(timeout);
_pwr_key = !_active_high;
ThisThread::sleep_for(100);
}
return NSAPI_ERROR_OK;
}