Console Serial IO con display OLED e seriale asincrona

Dependencies:   mbed BufferedSerial AserialIOFuncLib SSD1306 TerminalPlusV2

Fork of SerialIO by Max Scordamaglia

Console Serial IO con display OLED e seriale asincrona

Files at this revision

API Documentation at this revision

Comitter:
MaxScorda
Date:
Wed Aug 19 23:45:39 2015 +0000
Parent:
20:fc0a3050c5d1
Child:
22:96199b7addb9
Commit message:
first test flash and io async

Changed in this revision

Functions.h Show annotated file Show diff for this revision Revisions of this file
macroDisp.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Functions.h	Tue Aug 18 21:55:23 2015 +0000
+++ b/Functions.h	Wed Aug 19 23:45:39 2015 +0000
@@ -38,12 +38,12 @@
             if (param=="on ") {
                 realExtraSerial=true;
                 sc.writeScreen("ON \n",62,14,3);
-                                errp=0;
+                errp=0;
             }
             if (param=="off") {
                 realExtraSerial=false;
                 sc.writeScreen("OFF\n",62,14);
-                                errp=0;
+                errp=0;
             }
         }
     }
@@ -56,7 +56,7 @@
                 sc.writeScreen("Led ACCESO \n",42,20,99);
                 ardser.printf("\nLed ACCESO \n\r");
                 printDisp(dispType,"Led ACCESO \n\r");
-                led.onOff(true); //Accende il led
+                led.onOff(1); //Accende il led
                 errp=0;
             }
             if (param=="off") {
@@ -64,7 +64,7 @@
                 sc.writeScreen("Led SPENTO! \n",42,20,99);
                 ardser.printf("\nLed SPENTO! \n\r");
                 printDisp(dispType,"Led SPENTO \n\r");
-                led.onOff(false); //Spegne il led
+                led.onOff(0); //Spegne il led
                 errp=0;
             }
         }
--- a/macroDisp.h	Tue Aug 18 21:55:23 2015 +0000
+++ b/macroDisp.h	Wed Aug 19 23:45:39 2015 +0000
@@ -125,4 +125,18 @@
         case 1: //lcd
             break;
     }
+}
+
+void inverseDisp(int disptype)
+{
+    static bool boolf=0;
+    switch (disptype) {
+        case 0: //oled
+            boolf=!boolf;
+            oled.set_inverse(boolf);
+            //oled.update();
+            break;
+        case 1: //lcd
+            break;
+    }
 }
\ No newline at end of file
--- a/main.cpp	Tue Aug 18 21:55:23 2015 +0000
+++ b/main.cpp	Wed Aug 19 23:45:39 2015 +0000
@@ -51,6 +51,7 @@
         ardser.attach(&callback);
         //seriale interna
         c=pc.getc(); //legge un carattere dalla seriale
+        inverseDisp(dispType);
         if (c != 13) {
             buffer[i]=c; // se il carattere è diverso da CarriageReturn (ASCII 13) lo memorizza nel buffer
             i++; // incrementa il puntatore al buffer