Skip to content

Commit

Permalink
esp-idf: add documentation on adding missing nanosleep function
Browse files Browse the repository at this point in the history
  • Loading branch information
fedepell committed Jun 29, 2024
1 parent f1dd7d9 commit 96a9754
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/esp-idf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ namely:
If you already have other components you may just add the reference to the newly
added component.

- As the ESP-IDF does not provide a `nanosleep` function in its SDK, you should add
this in your project so you will be able to find it at linking time, for example:

```
int nanosleep(const struct timespec *req, struct timespec *_Nullable rem) {
return usleep(req->tv_sec*1000 + req->tv_nsec / 1000);
}
```

Now you are almost ready to use libmodbus in your project!

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

0 comments on commit 96a9754

Please sign in to comment.