Skip to content

Commit 5fe1520

Browse files
committed
Replacing deprecated rtos::ThisThread::sleep_for with the version using durations instead of an uint.
1 parent 552c940 commit 5fe1520

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ThreadsafeIO/examples/ts_spi/ts_spi.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* CONSTANTS
99
**************************************************************************************/
1010

11-
static int const BMP388_CS_PIN = 2;
12-
static int const BMP388_INT_PIN = 6;
11+
static int const BMP388_CS_PIN = 2;
12+
static int const BMP388_INT_PIN = 6;
1313
static byte const BMP388_CHIP_ID_REG_ADDR = 0x00;
1414

1515
static size_t constexpr NUM_THREADS = 20;
@@ -82,8 +82,8 @@ byte bmp388_read_reg(byte const reg_addr)
8282
byte const write_buf[3] =
8383
{
8484
static_cast<byte>(0x80 | reg_addr), /* REG_ADDR, if MSBit is set -> READ access */
85-
0, /* Dummy byte. */
86-
0 /* REG_VAL is output on SDO */
85+
0, /* Dummy byte. */
86+
0 /* REG_VAL is output on SDO */
8787
};
8888
byte read_buf[3] = {0};
8989

@@ -102,7 +102,7 @@ void bmp388_thread_func()
102102
for(;;)
103103
{
104104
/* Sleep between 5 and 500 ms */
105-
rtos::ThisThread::sleep_for(random(5,500));
105+
rtos::ThisThread::sleep_for(rtos::Kernel::Clock::duration_u32(random(5,500)));
106106
/* Try to read some data from the BMP3888. */
107107
byte const chip_id = bmp388_read_reg(BMP388_CHIP_ID_REG_ADDR);
108108
/* Print thread id and chip id value to serial. */

ThreadsafeIO/examples/ts_wire/ts_wire.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void lsm6dsox_thread_func()
8181
for(;;)
8282
{
8383
/* Sleep between 5 and 500 ms */
84-
rtos::ThisThread::sleep_for(random(5,500));
84+
rtos::ThisThread::sleep_for(rtos::Kernel::Clock::duration_u32(random(5,500)));
8585
/* Try to read some data from the BMP3888. */
8686
byte const who_am_i = lsm6dsox_read_reg(LSM6DSOX_WHO_AM_I_REG);
8787
/* Print thread id and chip id value to serial. */

0 commit comments

Comments
 (0)