We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1da5171 commit 7f37ef4Copy full SHA for 7f37ef4
libraries/Wire/Wire.cpp
@@ -405,6 +405,19 @@ void TwoWire::_begin(void) {
405
init_ok = false;
406
}
407
408
+
409
+ if (init_ok) {
410
+ // inspired by https://community.element14.com/products/roadtest/b/blog/posts/using-i2c-spi-and-dma-on-renesas-ra2l1-part-1
411
+ // abort previous transactions
412
+ if (!is_sci) {
413
+ for (int i = 0; i < 20; i++) {
414
+ m_i2c_ctrl.p_reg->ICCR1_b.CLO = 1;
415
+ while (m_i2c_ctrl.p_reg->ICCR1_b.CLO) {
416
+ }
417
418
419
+ m_abort(&m_i2c_ctrl);
420
421
422
423
/* -------------------------------------------------------------------------- */
0 commit comments