Closed 38saibot closed 2 years ago
Wouldn't it be possible to get things separated, sending the request, then going back to the main loop, doing a poll in every loop cycle and then read the response if available?
Absolutely. That's indeed a reasonable issue of this library. I'll work on a non-blocking version as soon as I can and upload it for you to test.
Unfortunately, I couldn't address this issue in a timely manner because I haven't been working with the ESP32 ever since. In this meantime, I2C Slave support has been added to the official ESP32 framework as you can see in the updated README of this repo. Therefore this library is no longer needed and its development will be ceased.
Describe the bug Requesting some bytes from a slave is blocking the main loop for 3..6ms In the implementation of slaveReq.request() is the delay function used in a while loop: WireslaveRequest.cpp in Line 32:
The request is sent and then it stucks for some ms while waiting for the response. Wouldn't it be possible to get things separated, sending the request, then going back to the main loop, doing a poll in every loop cycle and then read the response if available?
The actual implementation is killing my application which requires a fast CPU cycle.
To Reproduce Use the sample code for master_reader and slave_sender
Additional context