Make twi timer local to the wait function

This commit is contained in:
Alex Voinea 2022-02-17 09:22:18 +01:00
parent 0172cbdf8b
commit 1e0f414d41
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ static void twi_stop()
static uint8_t twi_wait(uint8_t status) static uint8_t twi_wait(uint8_t status)
{ {
static ShortTimer timmy; ShortTimer timmy;
timmy.start(); timmy.start();
while(!(TWCR & _BV(TWINT))) { while(!(TWCR & _BV(TWINT))) {
if (timmy.expired(TWI_TIMEOUT_MS)) { if (timmy.expired(TWI_TIMEOUT_MS)) {