attempt to fix posible power issues with the sharp

Dependencies:   ADS1115 BME280 CronoDot SDFileSystem mbed

Fork of Outdoor_UPAS_v1_2_Tboard by scott kelleher

Revision:
49:055231b09a7e
Parent:
47:fe50d72c7adc
Child:
50:5f1b378e4f64
--- a/main.cpp	Thu May 05 17:43:23 2016 +0000
+++ b/main.cpp	Thu May 05 22:00:03 2016 +0000
@@ -219,6 +219,7 @@
 static int runReady = 0;
 static uint8_t startAndEndTime[12] = {0,};
 static uint8_t fileTransferLock = 0;
+static uint8_t transmissionStopLock = 1;
 
 //////////////////////////////////////////////////////////////
 //BLE Functions
@@ -264,21 +265,18 @@
                              fileTransferLock=0;
                              RGB_LED.set_led(1,1,1);
                          }
-                    } 
+                    }
+                    if((transmissionValue == 10 && dataLength<17)||(transmissionValue == 11 && dataLength<9))transmissionStopLock=0;
+                    else transmissionStopLock=1; 
                     if(transmissionValue == 8){
                          runReady = 1;
                          microChannel.attach(NULL,microChannel.RxIrq);
-                     }
-                    haltBLE = 1;
-                    transmissionValue = 0;
-                    dataLength = 0;
-                    //if(fileWrite == 1){
-                        //FILE *fp = fopen(gpsConfigFilename, "a");    
-                        //fprintf(fp,"HELLO");
-                        //fclose(fp); 
-                        //free(fp);
-                        //fileWrite=0;
-                    //}
+                    }
+                    if(transmissionStopLock==1){
+                        haltBLE = 1;
+                        transmissionValue = 0;
+                        dataLength = 0;
+                    }
                 }
             }
         }