SpenceKonde / megaTinyCore

Arduino core for the tinyAVR 0/1/2-series - Ones's digit 2,4,5,7 (pincount, 8,14,20,24), tens digit 0, 1, or 2 (featureset), preceded by flash in kb. Library maintainers: porting help available!
Other
563 stars 148 forks source link

Wire.usePullups() stopped working after version 2.6.1 #1158

Open jvasileff opened 3 weeks ago

jvasileff commented 3 weeks ago

As can be confirmed with a multimeter and the following setup code:

Wire.usePullups();
Wire.begin();

Wire.usePullups() stopped pulling PB0 and PB1 high with version 2.6.2 or 2.6.3. This was tested with an attiny1627.

MX682X commented 3 weeks ago

https://github.com/SpenceKonde/megaTinyCore/blob/f0e59764d741bdff09b670be0d055b5c728b4788/megaavr/libraries/Wire/src/twi_pins.c#L441

could you try the newest version but remove the right part of the #if conditional ( " && MEGATINYCORE_SERIES != 2 ")? I don't have a 2-Series to test

jvasileff commented 3 weeks ago

Thanks! Indeed, that does fix Wire.usePullups() on 2.6.10. I just did a quick test with a multimeter, I didn't try to actually use i2c with this change.

jvasileff commented 3 weeks ago

I've now tested actually using i2c with this change - everything works great.

SpenceKonde commented 3 weeks ago

There are CONSIDERABLY more serious issues here. Much more complicated than implied here.

MX682X commented 3 weeks ago

How so? As far as I can see the use Pullups function isn't doing anything in the 2 series. all we have to do is to #if def the OUTCLR, however I think it would be sensible to just keep it like that - I doubt anyone will end up using I2C pins on a PCB for anything but I2C