Skip to content

Commit d135e9b

Browse files
authored
Merge pull request #11394 from hugueskamba/hk-replace-deprecated-wait_us
Replace wait_ms calls with rtos::ThisThread::sleep_for
2 parents 34a3948 + 97acdc5 commit d135e9b

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) :
@@ -206,7 +208,7 @@ bool UBLOX_AT_CellularContext::activate_profile(const char *apn,
206208
if (activated) { //If context is activated, exit while loop and return status
207209
break;
208210
}
209-
wait_ms(5000); //Wait for 5 seconds and then try again
211+
rtos::ThisThread::sleep_for(5000); //Wait for 5 seconds and then try again
210212
}
211213
t1.stop();
212214
}

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)
@@ -93,7 +95,7 @@ nsapi_error_t UBLOX_AT_CellularNetwork::ubx_reboot()
9395
} else {
9496
//Don't clear err here so that we get some error in case of failure
9597
_at.clear_error();
96-
wait_ms(1000);
98+
rtos::ThisThread::sleep_for(1000);
9799
}
98100
}
99101
t1.stop();

0 commit comments

Comments
 (0)