Bmag incl gps rettelse

Dependencies:   mbed WDT MODSERIAL BME280

Revision:
22:9f5955f051f5
Parent:
21:325cb82f1838
Child:
23:2e914b705b99
--- a/ErrorHandler/ErrorHandler.cpp	Thu May 11 13:42:32 2017 +0000
+++ b/ErrorHandler/ErrorHandler.cpp	Mon May 15 12:46:50 2017 +0000
@@ -64,10 +64,12 @@
     \param es The errorstate needed of type ErrorState  
 */
 void ErrorHandler::setErrorState(ErrorState es){
+   
+   this->currentState = es;    
     
     switch(currentState){
         
-        case(NONE): 
+        case(NONE):
             break;
             
         case(NO_GPS):
@@ -88,13 +90,15 @@
             break;
         
         case(NO_MAG_DATA):
-            
+            memset(tmparr,'\0',15);
+            sprintf(tmparr, "%s", gpsPtr->getCurrentTime().c_str());
             errorStr1.assign("!MagData");
-            errorStr2.assign("        ");         
+            errorStr2.assign(tmparr);
+                     
             break;
         
         case(DISPLAY_VBAT_FIX):
-            memset(tmparr,'\0',10);+
+            memset(tmparr,'\0',15);
             sprintf(tmparr, "VB: %s", *batteryvoltageptr);
             errorStr1.assign(tmparr);
             
@@ -108,7 +112,7 @@
             break;
             
         case(DISPLAY_MAG_MEASUREMENT):
-            memset(tmparr,'\0',10);
+            memset(tmparr,'\0',15);
             errorStr1.assign("Q:   nT:");  
             errorStr1[2] = bmagptr->getMagSq()[0];
             errorStr1[3] = bmagptr->getMagSq()[1];
@@ -136,7 +140,7 @@
     \return setMagTimePrompted A bool indicating if user has been prompted to set time on mag or not.
 */
 bool ErrorHandler::getMagTimePromtStatus(void){
-    return setMagTimePrompted;  
+    return this->setMagTimePrompted;  
 };
 
 //! getErrorState is a method returning the current errorstate
@@ -146,5 +150,5 @@
     \return currentState The current ErrorState
 */
 ErrorState ErrorHandler::getErrorState(void){
-  return   currentState;
+  return   this->currentState;
 };
\ No newline at end of file