How often should I call TinyWireS_stop_check()?
Closed this issue · 1 comments
Are there any calculations?
no, but supposing a normal START slave_w_addr reg_addr STOP START slave_r_addr R R STOP pattern it depends on how quickly the master is going to start the second transaction as well as the raw bus speed. Probably you will have to experiment, but I would recommend keeping especially the onreceive and onrequest handlers very short (basically just managing the register pointer and sending data) and use the pattern used by many devices where the master will trigger some long-running task by writing a register and then periodically polling another one to see if it has completed. The slave will then handle the task (some sort-of pre-emptive multitasking [or simply sprinkling those check calls in between the long running code] is possibly needed), update the data registers and set up the "data ready" flag.