Skip to content

Commit 97acdc5

Browse files
committed
Replace wait_ms calls with rtos::ThisThread::sleep_for
`wait_ms` is deprecated and its use generates a warning.
1 parent bdd6cb8 commit 97acdc5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularContext.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include "APN_db.h"
2020
#include "CellularLog.h"
2121

22+
#include "rtos/ThisThread.h"
23+
2224
namespace mbed {
2325

2426
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,
236238
if (activated) { //If context is activated, exit while loop and return status
237239
break;
238240
}
239-
wait_ms(5000); //Wait for 5 seconds and then try again
241+
rtos::ThisThread::sleep_for(5000); //Wait for 5 seconds and then try again
240242
}
241243
t1.stop();
242244
}

features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularNetwork.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
#include "UBLOX_AT_CellularNetwork.h"
1919

20+
#include "rtos/ThisThread.h"
21+
2022
using namespace mbed;
2123

2224
UBLOX_AT_CellularNetwork::UBLOX_AT_CellularNetwork(ATHandler &atHandler) : AT_CellularNetwork(atHandler)
@@ -98,7 +100,7 @@ nsapi_error_t UBLOX_AT_CellularNetwork::ubx_reboot()
98100
break;
99101
} else {
100102
_at.clear_error();
101-
wait_ms(1000);
103+
rtos::ThisThread::sleep_for(1000);
102104
}
103105
}
104106
t1.stop();

0 commit comments

Comments
 (0)