Is this a good function for I2C receive?
No problem with multiple returns but it could be reduced to:

uint8_t I2C_rx(bool ack_rx)
{
  uint8_t cr = (1&lt;&lt;TWINT) | (1&lt;&lt;TWEN);
  if (ack_rx) cr |= (1&lt;&lt;TWEA);
  TWCR = cr;
  while (!(TWCR &amp; (1&lt;&lt;TWINT)));
  return TWDR;
}


or

uint8_t I2C_rx(bool ack_rx)
{
  TWCR = (1&lt;&lt;TWINT) | (1&lt;&lt;TWEN) | (ack_rx&lt;&lt;TWEA);
  while (!(TWCR &amp; (1&lt;&lt;TWINT)));
  return TWDR;
}


Cheers!