PA6H/MT3339 GPS: how to know if time is GPS locked or from internal RTC?

Now it's clearer (lcd.setCursor(0,1); instead of lcd.println(); )

#include <NMEAGPS.h> // Using Neo-GPS lib
#include <EEPROM.h>
#include <NeoSWSerial.h> //Serial com
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 12, 13, 7); // RS, EN, D4, D5, D6, D7
static const int RXPin = A5, TXPin = A4;

NeoSWSerial gpsSerial(RXPin, TXPin);

NMEAGPS gps;
gps_fix fix;
uint8_t gsvTracked;

// #define gpsPort Serial1 // you may be using a different serial port
int contr=0; // Correzione manuale al contrasto automatico (-10...+10)

void setup()
{
  //Serial.begin( 9600 );
  // Serial.println( F("status,date/time,speed") );
  // gpsPort.begin( 9600 );
  gpsSerial.begin(9600);        //Starting GPS at a 9600 baud rate
  lcd.begin(16,2);
  pinMode(11, OUTPUT);// PWM out per contrasto automatico
  if(EEPROM.read(0)==255) contr=70; else contr=EEPROM.read(13); // Carica il valore del contrasto
  analogWrite(11,contr); // Applica il contrasto memorizzato
}

extern void detectRTCtimeOnly();
  
void loop()
{
  if (gps.available( gpsSerial ))
  {
    fix = gps.read();

    lcd.clear();
    stampa();  // show *before* detectRTCOnly, on line 0

    lcd.setCursor(0,1); // on line 1,
    detectRTCtimeOnly();
    stampa();      //  ... show *after*  detectRTCOnly
  }
}

void stampa()
{
  const char *stato;
  if (fix.valid.status)
    {      
    if (fix.status == gps_fix::STATUS_NONE)
      stato="RTC ";
    else if (fix.status == gps_fix::STATUS_TIME_ONLY)
      stato="GPS ";
    else if (fix.status >= gps_fix::STATUS_STD)
      stato="3   ";
    }
  else
    stato="-   ";  
  lcd.print(stato);
  if (fix.valid.date) lcd.print( 'd' );
  if (fix.valid.time) lcd.print( 't' );
  lcd.print( F("sat:") );
  if (fix.valid.satellites) lcd.print( fix.satellites );
  lcd.print( '/' );
  lcd.print( gsvTracked );

  // not needed for now
//  lcd.print(F(" spd: "));
//  if (fix.valid.speed)
//    lcd.print( fix.speed_kph() );
}


void detectRTCtimeOnly()
{
  if (fix.valid.status && (fix.status == gps_fix::STATUS_TIME_ONLY)) {
    // The MTK3339 will never send this value,
    //   but this is how you might detect it on ublox GPS devices.
    return;
  }

  bool satellites = fix.valid.satellites and (fix.satellites > 0);
  bool haveTime   = fix.valid.date or fix.valid.time;
  bool tracking   = fix.valid.status and (fix.status >= gps_fix::STATUS_STD);

//  if (not tracking) {
    gsvTracked = 0;
    // Look for tracked satellites from the GSV sentences
    for (uint8_t i=0; i < gps.sat_count; i++) {
      if (gps.satellites[ i ].tracked) {
        satellites = true;
        gsvTracked++;
//        break;
      }
    }
//  }

  if (haveTime and not tracking and satellites) {
    // Force the fix status even though no NMEA sentences set it
    fix.valid.status = true;
    fix.status       = gps_fix::STATUS_TIME_ONLY;
  }

} // detectRTCtimeOnly