diff src/ui/bmi/mmiMain.c @ 69:77321341946c

first-pass implementation of UI to FCHG connection
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 23 Oct 2020 03:39:22 +0000
parents 74a034762083
children 46bab586c09b
line wrap: on
line diff
--- a/src/ui/bmi/mmiMain.c	Fri Oct 23 01:59:58 2020 +0000
+++ b/src/ui/bmi/mmiMain.c	Fri Oct 23 03:39:22 2020 +0000
@@ -288,7 +288,9 @@
     Solution     : As part of the implementation, type of GlobalIconStatus is changed from U16 to U32 as number of
     bits in the variable is not sufficient to store details about all the icons*/
 U32 GlobalIconStatus;
+#if 0	/* removed in FreeCalypso */
 UBYTE globalMobileMode;
+#endif
 int MmiModule;
 
 // ADDED BY RAVI - 28-11-2005
@@ -313,8 +315,6 @@
 #endif
 
 
-void globalFlashBattery (void);
-
 UBYTE globalBatteryPicNumber;
 UBYTE globalSignalPicNumber;
 
@@ -1172,48 +1172,23 @@
 	TRACE_EVENT_P1("MfwMmeBaState:mc->value: %d", mc->value);
 	switch(value)
 	{
-//x0pleela 10 Apr, 2006 ER: OMAPS00075178
-	case PWR_CHG_PLUG:
+	case BATT_EVENT_CHARGER_PLUG:
 		TRACE_EVENT("Mme Event:PWR_CHG_PLUG");
 		charging_start_info();
 		break;
-	/* External Power Plugged Off */
-    //case 0: //x0pleela 10 Apr, 2006 
-	case PWR_CHG_UNPLUG://x0pleela 10 Apr, 2006 ER: OMAPS00075178
-      		TRACE_EVENT("Mme Event:Discharging");
-	    	globalMobileMode = globalMobileMode & (~GlobalCharging);
-	    	globalMobileMode = globalMobileMode & (~GlobalBatteryPower);
-		globalBatteryMode = GlobalBatteryGreater5; //x0pleela 10 Apr, 2006
-		timStop(battery_charging_animate ); //x0pleela 11 Apr, 2006
-		idleEvent(IdleUpdate); //x0pleela 10 Apr, 2006
+	case BATT_STATE_NO_CHARGING:
+	case BATT_STATE_CHARGING:
+	case BATT_STATE_CHARGING_COMPLETE:
+		TRACE_EVENT_P1("MfwMmeBaState change to %d", value);
+		globalBatteryMode = value;
+		if (value != BATT_STATE_CHARGING)
+			timStop(battery_charging_animate);
+		idleEvent(IdleUpdate);
+		break;
+	default:
+		break;
+	}
 	break;
-
-	/* Mme Event: External Power Connected or End of Charge */
- //      case 1: //x0pleela 10 Apr, 2006 
-	case PWR_CHG_STOP: //x0pleela 10 Apr, 2006 ER: OMAPS00075178
-      		TRACE_EVENT("Mme Event:GlobalBatteryPower");
-//		globalMobileMode = globalMobileMode & (~GlobalCharging);
-	    	globalMobileMode = (globalMobileMode | GlobalBatteryPower);
-	    /* indicate that the battery is full*/
-	  	globalBatteryMode = GlobalBatteryFull;
-		timStop(battery_charging_animate ); //x0pleela 11 Apr, 2006
-		idleEvent(IdleUpdate); //x0pleela 10 Apr, 2006
-	 	 TRACE_EVENT("globalBatteryPicNumber = GlobalBatteryFull");
-	break;
-	/* Mme Event: Start of Charge */
-//	case 2: //x0pleela 10 Apr, 2006
-	case PWR_CHG_BEGIN: //x0pleela 10 Apr, 2006 ER: OMAPS00075178
-	    TRACE_EVENT("Mme Event:Charging");	   
-	    globalMobileMode = globalMobileMode & (~GlobalBatteryPower);
-	    globalMobileMode = (globalMobileMode | GlobalCharging);
-		globalBatteryMode = GlobalBatteryGreater5; //x0pleela 10 Apr, 2006
-		idleEvent(IdleUpdate); //x0pleela 10 Apr, 2006
-		//globalFlashBattery (); //x0pleela 10 Apr, 2006 : included to show animation of battery charging
-	break;
-	default:
-	    break;
-    }
-    break;
 //      xpradipg - LOCOSTO-ENH-31895 : 23 June 2005
 #ifdef FF_MMI_AUDIO_PROFILE
 //indicates the events related to the headset
@@ -1599,7 +1574,9 @@
    //---------------start: Mobile OFF-------------------
     TRACE_EVENT("            Mobile OFF");
     /* delete the state of mobile on   */
+#if 0	/* removed in FreeCalypso */
     globalMobileMode = globalMobileMode & (~GlobalMobileOn);
+#endif
 
     deregis = FALSE;
 
@@ -1632,16 +1609,12 @@
 int globalBatteryUpdate (U8 value)
 {
 
-    MmiModuleDel (ModuleBattLow);  /* delete the state */
-
-    globalBatteryMode = GlobalBatteryGreater5;
-
+  MmiModuleDel (ModuleBattLow);  /* delete the state */
 
   switch (value)
   {
     case 0:       /* battery low */
       globalBatteryPicNumber = 0;
-      globalBatteryMode = GlobalBatteryLesser5;
 
       /* is just a global status */
       MmiModuleSet (ModuleBattLow);  /* set the state */
@@ -1668,9 +1641,9 @@
       break;
   }
 
-    idleEvent(IdleUpdate);
-
-    return 0;
+  idleEvent(IdleUpdate);
+
+  return 0;
 }
 
 
@@ -1699,6 +1672,7 @@
 
 
 
+#if 0	/* removed in FreeCalypso */
 /*******************************************************************************
 
  $Function:  globalFlashBattery
@@ -1722,6 +1696,7 @@
     idleEvent(IdleUpdate);
     TRACE_EVENT(" start the timer for Blink ");
 }
+#endif
 
 /* SPR#1428 - SH - New Editor: this is all obsolete with new editor.  Equivalent
  * functionality can be found in AUITextEntry.c */