Replace wait_ms calls with rtos::ThisThread::sleep_for

`wait_ms` is deprecated and its use generates a warning.
pull/11394/head
Hugues Kamba 2019-09-02 15:11:29 +01:00
parent bdd6cb8dee
commit 97acdc59a3
2 changed files with 6 additions and 2 deletions

View File

@ -19,6 +19,8 @@
#include "APN_db.h"
#include "CellularLog.h"
#include "rtos/ThisThread.h"
namespace mbed {
UBLOX_AT_CellularContext::UBLOX_AT_CellularContext(ATHandler &at, CellularDevice *device, const char *apn, bool cp_req, bool nonip_req) :
@ -236,7 +238,7 @@ bool UBLOX_AT_CellularContext::activate_profile(const char *apn,
if (activated) { //If context is activated, exit while loop and return status
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();
}

View File

@ -17,6 +17,8 @@
#include "UBLOX_AT_CellularNetwork.h"
#include "rtos/ThisThread.h"
using namespace mbed;
UBLOX_AT_CellularNetwork::UBLOX_AT_CellularNetwork(ATHandler &atHandler) : AT_CellularNetwork(atHandler)
@ -98,7 +100,7 @@ nsapi_error_t UBLOX_AT_CellularNetwork::ubx_reboot()
break;
} else {
_at.clear_error();
wait_ms(1000);
rtos::ThisThread::sleep_for(1000);
}
}
t1.stop();