Read analog (A6) on standalone chip

I have built a standalone 328p-au board and set it up with the gammon 8mhz lilypad bootloader.
|
Part of my program is to analogRead on A6. The function works fine if i upload on its own but within the program it doesnt seem to read the pin.

Is there some special case for A6 and A7?

  void battery_sense() {                                                                          
  int total = 0;                                        // Reset value
  analogRead(6);                                    // 
  for (int x = 0; x < 11; x++) {                    // 
    total = total + analogRead(6);                  // Add each value
  
  }
  batVolt = total * 4.29 / 1023;                    // Convert readings to volt
  Serial.print("The battery is ");
  Serial.print(batVolt);
  Serial.println(" volts");
  delay(100);
  v(16);                                        // "BATTERY"
  delay(1200);
  if (batVolt <= 11.5) {
    v(17);                                    // "WARNING"
    delay(1200);
    v(16);                                    // "BATTERY"
    delay(1200);
    v(17);                                    // "WARNING"
    delay(1200);
    Serial.println("BATTERY LOW!");
    engine_off();
  }
  else {
    int volt = batVolt * 100;
    int Fi = (volt / 1000) % 10;
    v(Fi); delay(800);                          // "first digit"
    int Se = (volt / 100) % 10;
    v(Se); delay(800);                          // "second digit
    v(18); delay(800);                          // "POINT"
    int Th = (volt / 10) % 10;
    v(Th); delay(800);                          // "Third digit"
    int Fo = volt % 10;
    v(Fo); delay(800);                          // "fourth digit"
    v(19); delay(2000);                         // "VOLTS"
    engine_start();
  }
}

There is a sleep function that turns off the ADC:

void sleep() {
  simc.println("AT+CNETLIGHT=0");
  delay(1000);
  simc.println("AT+CSCLK=2");
  delay(1000);
  
  ADCSRA = 0;   // disable ADC
  set_sleep_mode (SLEEP_MODE_PWR_DOWN);  
  sleep_enable();
  noInterrupts ();            // Do not interrupt before we go to sleep, or the ISR will detach interrupts and we won't wake. 
  attachInterrupt (0, wake, FALLING);           // will be called when pin D2 goes low  
  EIFR = bit (INTF0);                           // clear flag for interrupt 0
  MCUCR = bit (BODS) | bit (BODSE);// turn off brown-out enable in software. BODS must be set to one and BODSE must be set to zero within four clock cycles
  MCUCR = bit (BODS); // The BODS bit is automatically cleared after three clock cycles 
  interrupts ();  // We are guaranteed that the sleep_cpu call will be done as the processor executes the next instruction after interrupts are turned on.
  sleep_cpu ();
  }
void wake ()
{
  sleep_disable();// cancel sleep as a precaution
  simc.println("AT+CNETLIGHT=1");
  delay(1000);
  detachInterrupt (0); // precautionary while we do other stuff
}

But isnt this turned back on automatically after wake or an analogRead?

analogRead(6);

The analogRead() function returns an int data type. You need to store the returned value.

int reading = analogRead(6);