I2C clock stretching and disabling of interupts


a question for the experts:

i got a program that needs to use the wire library to act as a i2c slave.
i also need to take advantage of i2c clock stretching since some commands will take a while to complete and by using clock stretching i have a way to prevent i2c master from sending commands too fast.

in my onReceive callback that is run from an interrupt i'm using another library that disables interrupts and then turns the back on again.

what happens to the i2c clock stretching when interrupts are turned off and then back on again like this?
will noInterrupts()/interrupts() clear the pending i2c interrupt too and therefor also disable the clock stretching possibly halfway thru my code?

basically how do noInterrupts()/interrupts() affect pending interrupts? are they cleared? if so i have a problem.
the processor in question is a 328p

i think i can partly answer my own question.
Wire library does NOT support clock stretching (i think)
Wire/src/utility/twi.c calls twi_releaseBus() before calling the slave receive callback, so clock is probably already reset back to normal before callback starts.

and this results in possibility of loosing data if i2c calls is done too fast, exactly what i was hoping to avoid :frowning:

is there any other replacement i2c library out there that do support clock stretching and interrupts? (preferably a library that also uses the built in twi hardware)