diff src/ui/bmi/mmiMain.c @ 84:7160f0d005d2

first stage of actual FreeCalypso backlight rework
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Oct 2020 23:46:55 +0000
parents 46bab586c09b
children 00f4455e4c45
line wrap: on
line diff
--- a/src/ui/bmi/mmiMain.c	Mon Oct 26 21:51:55 2020 +0000
+++ b/src/ui/bmi/mmiMain.c	Mon Oct 26 23:46:55 2020 +0000
@@ -679,29 +679,7 @@
     #endif
 #endif
 
-    /*Setup when we want the backlight to come on*/
-//  Nov 09, 2005    REF: DVT OMAPS00056873 xdeepadh
-//On Isample boards the backlight is set off, since the bright LEDS are very disturbing.
-
-    for (i=0;i<BL_LAST_OPTION;i++)
-#if (BOARD == 71)
-    mme_setBacklightEvent(i,BL_NO_LIGHT);
-#else
-    mme_setBacklightEvent(i,BL_MAX_LIGHT);
-#endif
-
-#if (BOARD == 71)
-    mme_setBacklightEvent(BL_IDLE_TIMER,BL_NO_LIGHT);
-#else
-    mme_setBacklightEvent(BL_IDLE_TIMER,BL_SET_IDLE);
-#endif
-
-    mme_setBacklightEvent(BL_KEY_PRESS,BL_MAX_LIGHT);
-    mme_setBacklightEvent(BL_INCOMING_CALL,BL_MAX_LIGHT);
-    mme_setBacklightEvent(BL_EXIT,BL_NO_LIGHT);
-
-    /*and tell the backlight that the init event has happened */
-    mme_backlightEvent(BL_INIT);
+    mme_backlightOnEvent();
 
     //x0018858 24 Mar, 2005 MMI-FIX-11321
     //Added two functions to set the indication and CMER values.
@@ -783,7 +761,7 @@
      * sigDistribute() in mfw_kbd.c, rather than at the end.
      */
     if (res_int != -1)
-	return;
+	return 0;
 
   /* terminate the ringing in all situation (it doesnt matter where the user is */
   if ( (e & KEY_HUP) && (e & KEY_MAKE) )
@@ -829,6 +807,13 @@
 
   HUPKeyOrigin = 0;
 
+  /* FreeCalypso backlight handling */
+  if (e & KEY_MAKE) {
+	if (mme_backlightKeyPress())
+		return 1;
+  } else {
+	mme_backlightOnEvent();
+  }
 
 #ifdef SIM_TOOLKIT
        /*SPR#2121 - DS - Only download event to SAT if the event has been registered
@@ -1236,8 +1221,8 @@
    if (CphsPresent() == CPHS_ERR)
         cphs_support_check();
 
-
-  mme_backlightEvent(BL_IDLE_TIMER);
+  /* removed in FreeCalypso */
+  /* mme_backlightEvent(BL_IDLE_TIMER); */
 
   timStart(times);