football_project_wo_output

Dependencies:   mbed

Fork of football_project by MZJ

Revision:
31:a6110950f385
Parent:
30:c60b0d52b067
Child:
35:c1405da88d3a
Child:
36:9aa553f5189b
--- a/main.cpp	Mon Jan 04 16:33:39 2016 +0000
+++ b/main.cpp	Tue Jan 05 13:05:48 2016 +0000
@@ -17,6 +17,13 @@
  *                                so things compile properly.*
  *        * Now using $Sub$$UART0_IRQHandler to override UART0_IRQHandler without needing to use lib source.
  *
+ *    *** Now using mbed-src again to modify startup code to use full 32k RAM on QFAC part        20160104  ALS
+ *         while still using RBL BLE Nano as a target:
+ *           Copied files  nRF51822.sct  and  startup_nRF51822.s
+ *             from  targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_32K
+ *             to    targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_ARM_STD/TARGET_MCU_NORDIC_16K
+ *             (Stomping the 16k settings w/ 32k settings.)
+ *
  *   Changed
  *     nRF51822/nordic/pstorage_platform.h  PSTORAGE_MIN_BLOCK_SIZE  changed from 0x010 to 4.
  */
@@ -248,8 +255,16 @@
 
         if( pct > 100 )  pct = 100;
 
-        // Use if we update quite often.
-//        if( !wasCharging && (abs( (int)prev -(int)pct ) < 3) )  return;  // Don't register change of less than 3%.
+        if( wasCharging )
+        {
+            pct      = 102;   // Show 102% at charger unplug.
+            tickTock = 50;    // Cause another normal update in 10 half-seconds.
+
+        } else
+          {
+              // Use if we update quite often.
+//              if( abs( (int)prev -(int)pct ) < 3 )  return;  // Don't register change of less than 3%.
+          }
 
         prev        = pct;
         wasCharging = false;
@@ -260,7 +275,8 @@
           //  But I had a failure with a smaller gap, so reduced another 8%.
           if( pct >= 91 )  ta.beep( 15000 );  // Alarm Clock TMP TODO remove once hardware is fixed.
 
-          pct         = 101;   // Show 101% if charging.
+          if( !wasCharging )
+              pct     = 101;   // Show 101% at start of charging.
           wasCharging = true;  // Force show when done charging.
       }
 
@@ -294,6 +310,9 @@
     connected = true;
 
     // DEBUG( "Connected!\n\r" );
+
+//    char dummy;
+//    writeToPhone( "Hi.  Curr stack bot: 0x%08X\r\n", &dummy );
 }
 
 void disconnectionCallback( Gap::Handle_t handle, Gap::DisconnectionReason_t reason )