Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Terminal by
Diff: Terminal.cpp
- Revision:
- 8:e3c6d6322506
- Parent:
- 7:80096ab72764
- Child:
- 9:82803dacf475
--- a/Terminal.cpp	Sat Sep 19 01:08:02 2015 +0000
+++ b/Terminal.cpp	Wed Sep 23 00:04:05 2015 +0000
@@ -150,14 +150,15 @@
     this->printf("\033[7m");
 }
 //*************************************
-void Terminal::formatPrintf(char sstr[], int xx, int yy, int padb)
+void Terminal::formatPrintf(char sstr[], int xx, int yy, int padb, bool boldf )
 {
     int i=0; //mettere lungo come stringa
     //string tempstr=string(sstr);
     int screenColumn=78; //per ora lo forziamo
 
     locate(xx, yy);
-    this->printf(sstr);
+    if (boldf==1) bold();
+    this->puts(sstr);
     if (yy!=23) this->printf("\033[1A"); // fa davvero cagare. Torna su col cursore per evitare il \n eccetto l'ultima riga. Servirebbe togliere il \n
     while ((sstr[i]!='\n') && (i<(screenColumn-xx+1))) {
         i++;
@@ -169,6 +170,7 @@
         i++;
         padb--;
     }
+    if (boldf==1) resetattrib();
 }
 
 
@@ -213,42 +215,17 @@
     formatPrintf(createStr(B_BR),x+w,y+h);
 }
 
-void Terminal::banner()
-{
-    cls();
-    frame(0, 0, 79, 22,1);
-    forgcol(3);
-    bold();
-    formatPrintf("_____ Boot screen _____\n",27,1);
-    formatPrintf("___ Nucleo Scorda IO Terminal ___\n",22,2);
-    forgcol(9);
-    formatPrintf(string2char(padstr("\n",78,char(196))),1,5); //azzo funziona...
-    formatPrintf("Parsing \n",2,5);
-    formatPrintf("Funzione\n",2,7);
-    formatPrintf("Numero\n",22,7);
-    formatPrintf("Parametro\n",42,7);
-    formatPrintf(string2char(padstr("\n",78,char(196))),1,10); //azzo funziona...
-    formatPrintf("Status \n",2,10);
-    formatPrintf("Led 1 \n",2,12);
-    formatPrintf("Virtual Led \n",22,12);
-    formatPrintf("Other Commands \n",42,12);
-    formatPrintf("Real Out Serial\n",62,12);
-    formatPrintf("Input string\n",2,15);
-    formatPrintf("Result\n",42,15);
-    formatPrintf(string2char(padstr("\n",78,char(196))),1,18); //azzo funziona...
-    formatPrintf("Serial Feedback \n",2,18);
-    resetattrib();
-}
-
 void Terminal::bannerAdv()
 {
     cls();
     frame(0, 0, 79, 22,1);
     forgcol(3);
-    bold();
+
     formatPrintf("_____ Boot screen _____\n",27,1);
     formatPrintf("___ Nucleo Scorda IO Terminal ___\n",22,2);
-    forgcol(9);
+
+    //resetattrib();
+    forgcol(7);
 
     formatPrintf(string2char(padstr("\n",78,char(196))),1,3); //top 1/2
     formatPrintf("Funzione \n",2,4);
@@ -259,7 +236,7 @@
     formatPrintf("Status Virtual Led \n",42,6);
 //5-6
     formatPrintf("Other Commands.... \n",2,8);
-    formatPrintf("Real Out Serial... \n",42,8);
+    formatPrintf("Real Serial(rso/f) \n",42,8);
 //7-8
     formatPrintf("Input string...... \n",2,10);
     formatPrintf("Result............ \n",42,10);
@@ -267,8 +244,8 @@
 //11-12
     formatPrintf(string2char(padstr("\n",78,char(196))),1,15); //bottom pot
 
-    formatPrintf(string2char(padstr("\n",78,char(196))),1,19); //azzo funziona...
-    formatPrintf("Serial Feedback \n",2,20);
+    formatPrintf(string2char(padstr("\n",78,char(196))),1,20); //azzo funziona...
+    formatPrintf("Serial Feedback \n",2,21);
 
 // grigino
     foreground(0x0f0f0f);
@@ -277,13 +254,14 @@
     formatPrintf(string2char(padstr("\n",78,char(196))),1,9); //top 7/8
     formatPrintf(string2char(padstr("\n",78,char(196))),1,11); //top 9/10
     formatPrintf(string2char(padstr("\n",78,char(196))),1,13); //top 11/12
-
     resetattrib();
+    //  bold();
 }
 
 void Terminal::readypos()
 {
-    formatPrintf("Command: > ",1,23);
+    locate(1, 23);
+    this->printf("Command: > ");
 }
 
 
    