felias-fogg / SoftI2CMaster

Software I2C Arduino library
GNU General Public License v3.0
368 stars 100 forks source link

Modifications for an Arduino library #62

Closed ArminJo closed 2 years ago

ArminJo commented 2 years ago

Hi Bernhard, I invested a few hours and had to change some code since I used Github Actions for CI and want it to run it also for Attinies again. I also looked at the issues and pull requests for outstanding changes. I hope it is ok for you?

I do not know if the Github Actions run automatically for you, or if you have to enable them manually.

For an Arduino library you must build a release with the tag v2.1.6 and then follow the instructions here. I can you support on this step too.

Since I replaced all calls and jmps by rcalls and rjmps for CPUs not having call and jmp, maybe it is a good idea to change version to 2.1.7, but this is up to you. Good night Armin

ArminJo commented 2 years ago

Thanks!

felias-fogg commented 2 years ago

Hi Armin,

thanks a lot! When I changed the rjmps and rcalls to jmps and calls, I did not recall that some of the ATtinys do not support the 4-byte instructions. And at that point I started to use the ATtiny1634, which does not have this restriction. Thanks, for making these changes!

Interestingly, I just noted, while working on a debugWIRE debugger, that JMP and CALL are supported on all ATtinys that I could get my hands on. It is just the compiler/assembler that refuses to generate the code: https://www.avrfreaks.net/forum/strange-observation-jmp-and-call-are-legal-instructions-attinys

Cheers, Bernhard

ArminJo commented 2 years ago

Hi Bernhard, what was the reason to replace the rjmp with jmp? Does this not corrupt the timing? jmp requires 3 clocks and rjmp only 2 clocks. Best regards Armin

felias-fogg commented 2 years ago

Issue #50 was the reason -- and I changed it without thinking too much about the consequences. Timing is not that critical when you are the master and generate the clock signal. The delay loops become a bit slower, implying that the maximal transmission speed decreases, but that's it.