rambo / TinyWire

My modifications to TinyWire Arduino libs
284 stars 121 forks source link

ATTiny24 Support? #26

Closed Pecacheu closed 8 years ago

Pecacheu commented 8 years ago

Works with ATiny84, but any chance of getting ATTiny24 support? I kind-of already soldered my project together with an ATTiny24A inside, so it's a little late to change processors.

rambo commented 8 years ago

128B RAM sounds a bit low...

Anyway look for block like https://github.com/rambo/TinyWire/blob/master/TinyWireS/usiTwiSlave.c#L67 and add check for attiny24 too, then see if it works, it it does send in a patch...

Pecacheu commented 8 years ago

Okay, got it working. Anyway, I have another question. Is there any foolproof way to totally reset the library's input and output buffers? Can I just call TinyWireS.begin again?

I'm using the ATTiny as a power controller for the main MCU and other things, and when it turns the master device's power on the buffer should reset.

rambo commented 8 years ago

Can I just call TinyWireS.begin again?

That should work.

https://github.com/rambo/TinyWire/blob/master/TinyWireS/usiTwiSlave.c#L345

https://github.com/rambo/TinyWire/blob/master/TinyWireS/TinyWireS.cpp#L34