Skip to content

Commit 96a9754

Browse files
committed
esp-idf: add documentation on adding missing nanosleep function
1 parent f1dd7d9 commit 96a9754

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/esp-idf/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ namely:
2424
If you already have other components you may just add the reference to the newly
2525
added component.
2626

27+
- As the ESP-IDF does not provide a `nanosleep` function in its SDK, you should add
28+
this in your project so you will be able to find it at linking time, for example:
29+
30+
```
31+
int nanosleep(const struct timespec *req, struct timespec *_Nullable rem) {
32+
return usleep(req->tv_sec*1000 + req->tv_nsec / 1000);
33+
}
34+
```
35+
2736
Now you are almost ready to use libmodbus in your project!
2837

2938
If you desire to use the library for serial communication, you will need to do a few

0 commit comments

Comments
 (0)