Merge pull request #11394 from hugueskamba/hk-replace-deprecated-wait_us

Replace wait_ms calls with rtos::ThisThread::sleep_for
pull/11415/head
Martin Kojtal 2019-09-05 09:56:57 +02:00 committed by GitHub
commit d135e9bf32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -19,6 +19,8 @@
#include "APN_db.h" #include "APN_db.h"
#include "CellularLog.h" #include "CellularLog.h"
#include "rtos/ThisThread.h"
namespace mbed { namespace mbed {
UBLOX_AT_CellularContext::UBLOX_AT_CellularContext(ATHandler &at, CellularDevice *device, const char *apn, bool cp_req, bool nonip_req) : UBLOX_AT_CellularContext::UBLOX_AT_CellularContext(ATHandler &at, CellularDevice *device, const char *apn, bool cp_req, bool nonip_req) :
@ -206,7 +208,7 @@ bool UBLOX_AT_CellularContext::activate_profile(const char *apn,
if (activated) { //If context is activated, exit while loop and return status if (activated) { //If context is activated, exit while loop and return status
break; break;
} }
wait_ms(5000); //Wait for 5 seconds and then try again rtos::ThisThread::sleep_for(5000); //Wait for 5 seconds and then try again
} }
t1.stop(); t1.stop();
} }

View File

@ -17,6 +17,8 @@
#include "UBLOX_AT_CellularNetwork.h" #include "UBLOX_AT_CellularNetwork.h"
#include "rtos/ThisThread.h"
using namespace mbed; using namespace mbed;
UBLOX_AT_CellularNetwork::UBLOX_AT_CellularNetwork(ATHandler &atHandler) : AT_CellularNetwork(atHandler) UBLOX_AT_CellularNetwork::UBLOX_AT_CellularNetwork(ATHandler &atHandler) : AT_CellularNetwork(atHandler)
@ -93,7 +95,7 @@ nsapi_error_t UBLOX_AT_CellularNetwork::ubx_reboot()
} else { } else {
//Don't clear err here so that we get some error in case of failure //Don't clear err here so that we get some error in case of failure
_at.clear_error(); _at.clear_error();
wait_ms(1000); rtos::ThisThread::sleep_for(1000);
} }
} }
t1.stop(); t1.stop();