Driving LED matrix while using analogRead()

So, I have an ATtiny85 where I need to drive an LED matrix alongside doing 2 analogRead() calls.

The matrix is driven through a port expander over I2C with a refresh rate of <800 microseconds. The LED code on its own functions as expected however, when I do something like below, the code seems to get stuck at some LED and doesn’t work further.

void loop()
{
  analogRead(A2);
  analogRead(A3);

  lightLEDs();
}

void lightLEDs()
{
  if(micros() - previousTime > 800) I2C.write;
}

I think this may be due to the analogRead() call taking too long, but I’m not sure. If someone could help with an alternative, that’d be great.

Suggest posting the full sketch...

I think this may be due to the analogRead() call taking too long,

Yes it is.

One way round it is to start off the analogue read, then check if it is time for refreshing the matrix and then check if the analogue read is complete yet. You have to write your own code to do this not use the built in analogue read function.

Please post all your code.