football_project_wo_output

Dependencies:   mbed

Fork of football_project by MZJ

Revision:
70:bd4b1e19a0c6
Parent:
67:5650f461722a
Child:
72:84365ba93d6b
Child:
73:ac3588017e32
--- a/main.cpp	Fri Feb 12 21:13:14 2016 +0000
+++ b/main.cpp	Mon Feb 22 09:48:42 2016 +0000
@@ -277,14 +277,14 @@
           // Plugged-in seems to add ~23% to level, so checking for 99% is like 76% unplugged.
           //  But I had a failure with a smaller gap, so reduced another 8%.  Also: Prevent alarm initially.
           if( millis() > 5000 && /* pct < 100 && TMP to prevent alarm on disconnected battery */
-              pct >= 91 )  ta.beep( 15000 );  // Alarm Clock TMP TODO remove once hardware is fixed.
+              pct >= 90 /* 91 */ )  ta.beep( 15000 );  // Alarm Clock TMP TODO remove once hardware is fixed.
 
           if( !wasCharging )
               pct     = 101;   // Show 101% at start of charging.
           wasCharging = true;  // Force show when done charging.
       }
 
-    if( pct <= 10 )  ta.batteryLow = true;
+    if( pct <= 15 /* 10 */ )  ta.batteryLow = true;
 
     batt_and_id[2] = pct;
     ble.clearAdvertisingPayload();
@@ -294,6 +294,11 @@
     if( NULL != battServiceP )  battServiceP->updateBatteryLevel( pct );
 }
 
+uint8_t getLastBattLevel()
+{
+    return  batt_and_id[2];
+}
+
 #define BAT_TOP  793  // 3250  // 52000
 #define BAT_BOT  684  // 2800  // 44800
 uint8_t getBattLevel()
@@ -595,7 +600,7 @@
 
         toPhoneChk();  // Write any pending data to phone.
 
-        if( is_master || Dbg )
+        if( is_master || Dbg || RDbg )
         {
             int bytes = MIN( MAX_LEN, phoneP->readable() );
             getRadioInput( phoneToDev, phoneP->read( phoneToDev, bytes, 1 ) );