Code supports writing to the SD card as well as working with the Volckens group smartphone apps for the mbed HRM1017

Dependencies:   ADS1115 BLE_API BME280 Calibration CronoDot EEPROM LSM303 MCP40D17 NCP5623BMUTBG SDFileSystem SI1145 STC3100 mbed nRF51822

Fork of UPAS_BLE_and_USB by Volckens Group Sensors

Files at this revision

API Documentation at this revision

Comitter:
joshuasmth04
Date:
Tue Sep 15 01:52:08 2015 +0000
Parent:
78:a465de6cc47e
Child:
80:5487ba127c82
Commit message:
Added UPAS Demo mode to the admen menu options under consider run ready.

Changed in this revision

Universal_BLE_Menu.lib Show annotated file Show diff for this revision Revisions of this file
Universal_Serial_Menu.lib 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/Universal_BLE_Menu.lib	Fri Sep 11 19:47:06 2015 +0000
+++ b/Universal_BLE_Menu.lib	Tue Sep 15 01:52:08 2015 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/Vockens-Group-Sensors/code/Universal_BLE_Menu/#6ad3a43775a0
+http://developer.mbed.org/teams/Vockens-Group-Sensors/code/Universal_BLE_Menu/#d4d058ba2ae9
--- a/Universal_Serial_Menu.lib	Fri Sep 11 19:47:06 2015 +0000
+++ b/Universal_Serial_Menu.lib	Tue Sep 15 01:52:08 2015 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/Vockens-Group-Sensors/code/Universal_Serial_Menu/#7cd19df4a898
+https://developer.mbed.org/teams/Vockens-Group-Sensors/code/Universal_Serial_Menu/#a47ca39ef4cf
--- a/main.cpp	Fri Sep 11 19:47:06 2015 +0000
+++ b/main.cpp	Tue Sep 15 01:52:08 2015 +0000
@@ -262,6 +262,7 @@
     //if(RTC.OSF()) {                 //Force the menu open if the RTC needs reset.
     //    RunReady = 0;
     //}
+    uint8_t temp_crr = Menu.crr;
     if(RunReady == 0) {
         RGB_LED.set_led(0,1,1); // error code/color
         pc.printf("Change Name\r\n");
@@ -278,10 +279,17 @@
     }
 
     RunReady = 0;
+    if(bleMenu.crr != temp_crr){
+        Menu.crr = bleMenu.crr; // if this was changed in the UBM move it to the primary USM before saving
+    }
     Menu.save_menu(E2PROM, logInerval, refreshtime, volflowSet, device_name, dutyUp, dutyDown, home_lat, home_lon, work_lat, work_lon, RunReady, serial_num);       //Save all data to the EEPROM
     calibrations.initialize(serial_num);
     
-    stop.attach(&check_stop, 60);    // check if we should shut down every 5 seconds, starting 60s after the start.
+    if(!Menu.crr == 2){  // don't shut off when in demo mode
+        stop.attach(&check_stop, 60);    // check if we should shut down every 5 seconds, starting 60s after the start.
+    }
+    
+    
 
     if(volflowSet==1.0) {
         gainFlow = 100;
@@ -435,8 +443,13 @@
 
 
     //** end of initalization **//
-
+    //---------------------------------------------------------------------------------------------//
     //---------------------------------------------------------------------------------------------//
+    if(Menu.crr == 2){  //demo mode never shuts down
+        //default demo mode settings
+        volflowSet = 1.0; //L/min
+        logInerval = 2;
+    }
     //---------------------------------------------------------------------------------------------//
     //---------------------------------------------------------------------------------------------//
     // Main Control Loop