diff src/ui/mfw/ti1_key.c @ 77:a7e383456c01

mfw/ti1_key.c: white space fixes
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Oct 2020 18:50:48 +0000
parents 67bfe9f274f6
children c632896652ba
line wrap: on
line diff
--- a/src/ui/mfw/ti1_key.c	Sun Oct 25 18:33:17 2020 +0000
+++ b/src/ui/mfw/ti1_key.c	Sun Oct 25 18:50:48 2020 +0000
@@ -17,12 +17,12 @@
    History:
 
    Sep 18, 2006 REF: OMAPS00094426 - x0039928
-   Description: Locosto - KPD Release event would NOT be generated if a key is pressed 
+   Description: Locosto - KPD Release event would NOT be generated if a key is pressed
    several times in a short period of time
    Solution : If the long press timer expires mmi checks the bsp kpd status and accordingly
    sets long press bit in the key map.
 
-   
+
 */
 
 #define ENTITY_MFW
@@ -83,8 +83,8 @@
 UBYTE keypad_initialize (void);
 
 void sendKeyInd( T_KPD_VIRTUAL_KEY_ID virtual_key_id,
-				    T_KPD_KEY_STATE key_state,
-				    T_KPD_PRESS_STATE press_state);
+                    T_KPD_KEY_STATE key_state,
+                    T_KPD_PRESS_STATE press_state);
 
 static void (*sig) (char,char) = 0;     /* kbd signaling function   */
 static char *keyMap = (char *) kbd_map; /* current keyboard mapping */
@@ -155,7 +155,7 @@
 // Commented by Nitin for Neptune Platfrom. 05/04/2005
 //keypad_initialize ();
 #else
-	keypad_initialize ();
+    keypad_initialize ();
 #endif
 
 
@@ -176,7 +176,7 @@
 {
     sig = 0;
 
-	// by Nitin 05/04/2004
+    // by Nitin 05/04/2004
 #ifndef NEPTUNE_BOARD
   //unsubscribe the client from the keypad driver
 #ifndef _SIMULATION_
@@ -184,7 +184,7 @@
 #endif
 // Added by Nitin 05/04/2004
 #else /* NOT defined NEPTUNE_BOARD  */
-	kpdMgr_unsubscribe(); // Sumit; commented for time being
+    kpdMgr_unsubscribe(); // Sumit; commented for time being
 #endif
 
 }
@@ -200,14 +200,14 @@
 */
 char drvGetKeyIndex( char key)
 {
-	int i;
+    int i;
 
 #ifndef _SIMULATION_
     for (i = 0; i < 32; i++)
     {
         if (keyMap[i] == key)
         {
-        	return (i);
+            return (i);
         }
     }
 
@@ -248,68 +248,68 @@
         powered_on =TRUE;
 
         /* ADDED BY RAVI - 22-11-2005 - OMAPS00056702 FIX */
-#if (BOARD!=61)   
-		/* JVJ #1705 MMI will be started here */
+#if (BOARD!=61)
+        /* JVJ #1705 MMI will be started here */
         mmiInit();
         return;
 #endif
       /* END RAVI - 22-11-2005 */
     }
 
-	if (key != (char)0)
-	{
-		if ((key >= 48) && (key <=57))
-		{
-			key -= 47;
-		}
-		else
-		{
-			switch(key)
-			{
-				case 35:
-					key = (char)18;
-					break;
+    if (key != (char)0)
+    {
+        if ((key >= 48) && (key <=57))
+        {
+            key -= 47;
+        }
+        else
+        {
+            switch(key)
+            {
+                case 35:
+                    key = (char)18;
+                    break;
 
-				case 42:
-					key = (char)17;
-					break;
+                case 42:
+                    key = (char)17;
+                    break;
 
-				case 45:
-					key = (char)11;
-					break;
+                case 45:
+                    key = (char)11;
+                    break;
 
-				case 67:
-					key = (char)13;
-					break;
+                case 67:
+                    key = (char)13;
+                    break;
 
-				case 69:
-					key = (char)25;
-					break;
+                case 69:
+                    key = (char)25;
+                    break;
 
-				case 86:
-					key = (char)16;
-					break;
+                case 86:
+                    key = (char)16;
+                    break;
 
-				case 94:
-					key = (char)14;
-					break;
+                case 94:
+                    key = (char)14;
+                    break;
 
-				case 97:
-					key = (char)15;
-					break;
+                case 97:
+                    key = (char)15;
+                    break;
 
-				case 98:
-					key = (char)12;
-					break;
+                case 98:
+                    key = (char)12;
+                    break;
 
-				default:
-					key = (char)0;
-					break;
-			}
-		}
+                default:
+                    key = (char)0;
+                    break;
+            }
+        }
 
-		kbd_putMakeAndKey( upDown, key);
-	}
+        kbd_putMakeAndKey( upDown, key);
+    }
 
     if (!sig) return;                   /* no event handler         */
 
@@ -399,15 +399,15 @@
         if (!strcmp(key,config_map[i]))
         {
           if (mode)
-		      {
-	          kbd_putMakeAndKey(0,i);			/* assume key down event    */
-	          sig(0,0);
-		      }
-			    else
-		      {
-	          kbd_putMakeAndKey(1,i);			/* assume key up event    */
-	          sig(0,0);
-		      }
+              {
+              kbd_putMakeAndKey(0,i);           /* assume key down event    */
+              sig(0,0);
+              }
+                else
+              {
+              kbd_putMakeAndKey(1,i);           /* assume key up event    */
+              sig(0,0);
+              }
             return;
         }
       }
@@ -437,10 +437,10 @@
 
     U16 signal_high;
     U16 signal_low;
-	U8   key_code;
-	U8   key_state;
+    U8   key_code;
+    U8   key_state;
 
-	int nPresses; //Number of key presses still in the queue
+    int nPresses; //Number of key presses still in the queue
 
 
 
@@ -455,32 +455,32 @@
     signal_low = (U16) (signal_params->UserData & 0xFFFF);
 #endif
 
-	key_code = (U8) (signal_low & 0xFF);
+    key_code = (U8) (signal_low & 0xFF);
     if (signal_high == 1)
-		key_state = KEY_STAT_PRS;
+        key_state = KEY_STAT_PRS;
     else
-		key_state = KEY_STAT_REL;
+        key_state = KEY_STAT_REL;
 
 /*JVJ #1705 When the first POWER KEY event arrives, an event is sent to MMI */
 /*to start it */
 if ((!powered_on)&&(key_code==POWER_KEY))
 {
-		sendKeyInd(key_code, key_state, 0);
+        sendKeyInd(key_code, key_state, 0);
         return;
 }
 
 
-	//Add keypress to queue of key presses
-	nPresses = kbd_getNumElements();
+    //Add keypress to queue of key presses
+    nPresses = kbd_getNumElements();
 
 
-	kbd_putMakeAndKey( (char)key_state, (char)key_code);
+    kbd_putMakeAndKey( (char)key_state, (char)key_code);
 
-	if ((!kbd_stillProcessingKeys()) && (nPresses == 0))
-	{	//Only this element present - create and send message.
-		sendKeyInd(key_code, key_state, 0);
+    if ((!kbd_stillProcessingKeys()) && (nPresses == 0))
+    {   //Only this element present - create and send message.
+        sendKeyInd(key_code, key_state, 0);
 
-	}
+    }
 
 }
 
@@ -499,81 +499,81 @@
 {
 // NITIN
 #ifndef NEPTUNE_BOARD
-	T_KPD_KEY_EVENT_MSG* event;
-	T_KPD_STATUS_MSG*    status;
-	T_RV_CHECK*  check;
-	
+    T_KPD_KEY_EVENT_MSG* event;
+    T_KPD_STATUS_MSG*    status;
+    T_RV_CHECK*  check;
+
 
 
 
 
 
-	check = (T_RV_CHECK*)parameter;
+    check = (T_RV_CHECK*)parameter;
 
-	if (check->msg_id EQ KPD_STATUS_MSG)
-	{
-	    //status message is used
-	    status = (T_KPD_STATUS_MSG*) parameter;
+    if (check->msg_id EQ KPD_STATUS_MSG)
+    {
+        //status message is used
+        status = (T_KPD_STATUS_MSG*) parameter;
 
 
 
-	    if (status->status_value EQ KPD_PROCESS_OK)
-	    {
-	      //ok
-	    }
-	    else
-	    {
-	      //failed !
-	      return;
-	    }
-	}
-	else
-	{
-		int nPresses; //Number of key presses still in the queue
-	    //event message is used
-	    event = (T_KPD_KEY_EVENT_MSG*) parameter;
+        if (status->status_value EQ KPD_PROCESS_OK)
+        {
+          //ok
+        }
+        else
+        {
+          //failed !
+          return;
+        }
+    }
+    else
+    {
+        int nPresses; //Number of key presses still in the queue
+        //event message is used
+        event = (T_KPD_KEY_EVENT_MSG*) parameter;
 
 
-		//Add keypress to queue of key presses
-		nPresses = kbd_getNumElements();
+        //Add keypress to queue of key presses
+        nPresses = kbd_getNumElements();
 
-		if (event->key_info.press_state EQ KPD_INSIGNIFICANT_VALUE)
-		{
-				kbd_putMakeAndKey( (char)event->key_info.state, (char)event->key_info.virtual_key_id );
-		}
-		else
-		{
+        if (event->key_info.press_state EQ KPD_INSIGNIFICANT_VALUE)
+        {
+                kbd_putMakeAndKey( (char)event->key_info.state, (char)event->key_info.virtual_key_id );
+        }
+        else
+        {
 
-			//key_ind->key_stat (U8):
-			//        00xx 0000 = KEY_PRESSED
-			//        00xx 0001 = KEY_RELEASED
-			//        0000 00xx = KPD_FIRST_PRESS
-			//        0001 00xx = KPD_LONG_PRESS
-			//        0010 00xx = KPD_REPEAT_PRESS
-			//
-			//    x = anystate
+            //key_ind->key_stat (U8):
+            //        00xx 0000 = KEY_PRESSED
+            //        00xx 0001 = KEY_RELEASED
+            //        0000 00xx = KPD_FIRST_PRESS
+            //        0001 00xx = KPD_LONG_PRESS
+            //        0010 00xx = KPD_REPEAT_PRESS
+            //
+            //    x = anystate
 //   Sep 18, 2006 REF: OMAPS00094426 - x0039928
 // Fix : Store the virtual key info in the global variable kpd_key for later use
 #if (BOARD == 71)
-			kpd_key = (char)event->key_info.virtual_key_id;
+            kpd_key = (char)event->key_info.virtual_key_id;
 #endif
-			kbd_putMakeAndKey( (char)(event->key_info.state | (event->key_info.press_state << 4)),
-								  (char)event->key_info.virtual_key_id );
-		}
+            kbd_putMakeAndKey( (char)(event->key_info.state | (event->key_info.press_state << 4)),
+                                  (char)event->key_info.virtual_key_id );
+        }
 
-		if ((!kbd_stillProcessingKeys()) && (nPresses == 0))
+        if ((!kbd_stillProcessingKeys()) && (nPresses == 0))
 
-		{	//Only this element present - create and send message.
+        {   //Only this element present - create and send message.
 
 
 
-			sendKeyInd(event->key_info.virtual_key_id, event->key_info.state, event->key_info.press_state);
+            sendKeyInd(event->key_info.virtual_key_id, event->key_info.state, event->key_info.press_state);
 
-		}
+        }
 
-	}
+    }
 #endif // NEPTUNE_BOARD
-	return;
+    return;
 
 }
 
@@ -627,15 +627,15 @@
   notified_keys.notified_keys [16] = KPD_KEY_STAR;
   notified_keys.notified_keys [17] = KPD_KEY_DIESE;
 
-	if (KPD_NB_PHYSICAL_KEYS > 22)
-	{
-		notified_keys.notified_keys [18] = KPD_KEY_SOFT_LEFT;
-		notified_keys.notified_keys [19] = KPD_KEY_SOFT_RIGHT;
-		notified_keys.notified_keys [20] = KPD_KEY_VOL_UP;
-		notified_keys.notified_keys [21] = KPD_KEY_VOL_DOWN;
-		notified_keys.notified_keys [22] = KPD_KEY_ENTER;
-		//? #define KPD_KEY_RECORD     (24)
-	}
+    if (KPD_NB_PHYSICAL_KEYS > 22)
+    {
+        notified_keys.notified_keys [18] = KPD_KEY_SOFT_LEFT;
+        notified_keys.notified_keys [19] = KPD_KEY_SOFT_RIGHT;
+        notified_keys.notified_keys [20] = KPD_KEY_VOL_UP;
+        notified_keys.notified_keys [21] = KPD_KEY_VOL_DOWN;
+        notified_keys.notified_keys [22] = KPD_KEY_ENTER;
+        //? #define KPD_KEY_RECORD     (24)
+    }
 
 #ifndef _SIMULATION_
   return_value = kpd_subscribe (&subscriber_p, mode, &notified_keys, return_path);
@@ -690,38 +690,38 @@
   PURPOSE : Sends an MMI_KEYPAD_IND to the protocol stack
 */
 void sendKeyInd( T_KPD_VIRTUAL_KEY_ID virtual_key_id,
-				    T_KPD_KEY_STATE key_state,
-				    T_KPD_PRESS_STATE press_state)
+                    T_KPD_KEY_STATE key_state,
+                    T_KPD_PRESS_STATE press_state)
 {
 #if defined (NEW_FRAME)
-	EXTERN T_HANDLE hCommACI;
+    EXTERN T_HANDLE hCommACI;
 
 
 
 
-//	ULONG signal_raw;   // RAVI
+//  ULONG signal_raw;   // RAVI
 #else
-	EXTERN T_VSI_CHANDLE hCommACI;
+    EXTERN T_VSI_CHANDLE hCommACI;
 #endif
 
-	PALLOC(key_ind,MMI_KEYPAD_IND);
+    PALLOC(key_ind,MMI_KEYPAD_IND);
 
-	key_ind->key_code = (U8)0;
+    key_ind->key_code = (U8)0;
 
-	key_ind->key_stat = 0;
+    key_ind->key_stat = 0;
 
 #if defined (NEW_FRAME)
-	PSENDX(ACI,key_ind);
+    PSENDX(ACI,key_ind);
 #else
 #if defined (_TMS470)
-	vsi_c_send("",hCommACI,D2P(key_ind),
-	        sizeof(T_PRIM_HEADER)+sizeof(T_MMI_KEYPAD_IND));
+    vsi_c_send("",hCommACI,D2P(key_ind),
+            sizeof(T_PRIM_HEADER)+sizeof(T_MMI_KEYPAD_IND));
 #else
-	PSEND(ACI,key_ind);
+    PSEND(ACI,key_ind);
 #endif
 #endif
 
-	return;
+    return;
 
 }