There is a possible mistake in the i2c code, there is a semicolon after an if clause and a following break statement, which may make the i2c retry fail.
I have no i2c display to test it, but i believe this wont work as expected, it will break the loop on the first iter , and not go for the full MAX_RETRIES
also GCC 9.2 complains and this says it all.
Compiling .pio/build/pro16MHzatmega328/libaf3/ssd1306/intf/spi/ssd1306_spi_avr.o
.pio/libdeps/pro16MHzatmega328/ssd1306/src/intf/i2c/ssd1306_i2c_twi.c: In function 'ssd1306_twi_start':
.pio/libdeps/pro16MHzatmega328/ssd1306/src/intf/i2c/ssd1306_i2c_twi.c:49:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
49 | if (!--iters);
| ^~
.pio/libdeps/pro16MHzatmega328/ssd1306/src/intf/i2c/ssd1306_i2c_twi.c:50:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
50 | {
| ^
There is a possible mistake in the i2c code, there is a semicolon after an if clause and a following break statement, which may make the i2c retry fail.
I have no i2c display to test it, but i believe this wont work as expected, it will break the loop on the first iter , and not go for the full MAX_RETRIES
also GCC 9.2 complains and this says it all.
The code
To Reproduce Well - i cant .
Expected behavior remove the semicolon
Screenshots n.a.
Please complete the following information: