 
   tft.setTextSize(1);
   tft.setCursor(1, 30);
-  switch ( ret ) {
-    case 1:
-      tft.setTextColor(ST7735_RED, ST7735_BLACK);
-      tft.println("Cant set command mode");
-      delay(10000);
-
-      break;
-    case 2:
-      tft.setTextColor(ST7735_RED, ST7735_BLACK);
-      tft.println("ATNT Failed");
-      delay(10000);
-      break;
-    case 3:
-      tft.setTextColor(ST7735_RED, ST7735_BLACK);
-      tft.println("ATID Failed");
-      delay(10000);
-      break;
-    case 4:
-      tft.setTextColor(ST7735_RED, ST7735_BLACK);
-      tft.println("ATDN Failed");
-      delay(10000);
-      break;
-    case 5:
-      tft.println("Done");
-      break;
-  }
+  if ( ret > 0 ) {
+    displayError(ST7735_RED, ST7735_BLACK, srfErrMsg[ret]);
+    delay(10000);
+  } else
+    tft.println(srfErrMsg[ret]);
+  /*
+    switch ( ret ) {
+      case 1:
+        displayError(ST7735_RED, ST7735_BLACK, "Cant set command mode");
+  //      delay(10000);
+        break;
+      case 2:
+        displayError(ST7735_RED, ST7735_BLACK, "ATNT Failed");
+  //      delay(10000);
+        break;
+      case 3:
+        displayError(ST7735_RED, ST7735_BLACK, "ATID Failed");
+  //      delay(10000);
+        break;
+      case 4:
+        displayError(ST7735_RED, ST7735_BLACK, "ATDN Failed");
+  //      delay(10000);
+        break;
+      case 5:
+        tft.println("Done");
+        break;
+    }
+  */
+  //  if ( ret < 5 )
+  //    delay(10000);
+
   digitalWrite(SRF_RADIO_ENABLE, HIGH); // select the radio
 
   LLAP.init();

  if (!sendCommand("ATNT0")) return 2;
  if (!sendCommand("ATID5AA5")) return 3;
  if (!sendCommand("ATDN")) return 4;
  return 5; // success
}




byte current_menu_item;

char *srfErrMsg[6] = { "Done",
                       "Cant set command mode",
                       "ATNT Failed",
                       "ATID Failed",
                       "ATDN Failed"
                     };

// Joystick functions

