FreeCalypso > hg > fc-magnetite
comparison src/ui3/bmi/MmiMmi.c @ 420:e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Sun, 21 Jan 2018 03:09:00 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 419:59143cd42ec7 | 420:e8ddbb0837ed |
|---|---|
| 1 /******************************************************************************* | |
| 2 | |
| 3 CONDAT (UK) | |
| 4 | |
| 5 ******************************************************************************** | |
| 6 | |
| 7 This software product is the property of Condat (UK) Ltd and may not be | |
| 8 disclosed to any third party without the express permission of the owner. | |
| 9 | |
| 10 ******************************************************************************** | |
| 11 | |
| 12 $Project name: Basic MMI | |
| 13 $Project code: BMI (6349) | |
| 14 $Module: MMI | |
| 15 $File: MmiMmi.c | |
| 16 $Revision: 1.0 | |
| 17 | |
| 18 $Author: Condat(UK) | |
| 19 $Date: 25/10/00 | |
| 20 | |
| 21 ******************************************************************************** | |
| 22 | |
| 23 Description: | |
| 24 | |
| 25 This provides the root mofule for the basic MMI | |
| 26 | |
| 27 ******************************************************************************** | |
| 28 $History: MmiMmi.c | |
| 29 | |
| 30 Apr 09, 2007 OMAPS00124879 x0039928(sumanth) | |
| 31 Description : I sample crashes while reading the received SMS from the Agilent | |
| 32 Solution : Heap memory is increased from 35k to 45k | |
| 33 | |
| 34 Oct 05, 2006 ER: OMAPS00094496 x0061088(Prachi) | |
| 35 Description:Enhance RSSI to 3 parameters: Strength, quality, min-access-level | |
| 36 Solution:To solve the ER OMAPS0094496,mmiInit() is now calling sAT_PercentCSQ() | |
| 37 | |
| 38 | |
| 39 | |
| 40 Jun 13 2005, REF:LOCOSTO-OTH-32113 - xpradipg | |
| 41 Description: Bypass the powerkey initialization at bootup | |
| 42 Solution: The powerkey initialization is bypassed by calling the | |
| 43 drvKeyUpDown() in mmi_main() instead of key_power_initialize | |
| 44 | |
| 45 // Jun 23, 2004 REF: CRR MMI-SPR-16665 Rashmi C N(Sasken) | |
| 46 // Description: Ocasionaly the LCD used to get stuck with the TI LOGO during power off. | |
| 47 // Solution: By calling dspl_Enable(1) we are forcing the LCD to get updated. | |
| 48 | |
| 49 // July 05, 2006 REF: OMAPS00084167 Ravishankar(Wipro) | |
| 50 // Description: Automatic bootup with no effect on press of power on key. | |
| 51 // Solution: Checking the status of BDL operation being completed for booting up MMI | |
| 52 // by using the function dev_Mbox_isDspMboxReady()and based on status calling | |
| 53 // mmiInit(). | |
| 54 | |
| 55 | |
| 56 25/10/00 Original Condat(UK) BMI version. | |
| 57 | |
| 58 $End | |
| 59 | |
| 60 *******************************************************************************/ | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 /******************************************************************************* | |
| 66 | |
| 67 Include Files | |
| 68 | |
| 69 *******************************************************************************/ | |
| 70 | |
| 71 #define ENTITY_MFW | |
| 72 | |
| 73 /* includes */ | |
| 74 #include <string.h> | |
| 75 #include <stdio.h> | |
| 76 #include <stdlib.h> | |
| 77 | |
| 78 #if defined (NEW_FRAME) | |
| 79 | |
| 80 #include "typedefs.h" | |
| 81 #include "vsi.h" | |
| 82 #include "pei.h" | |
| 83 #include "custom.h" | |
| 84 #include "gsm.h" | |
| 85 | |
| 86 #else | |
| 87 | |
| 88 #include "STDDEFS.H" | |
| 89 #include "custom.h" | |
| 90 #include "gsm.h" | |
| 91 #include "vsi.h" | |
| 92 | |
| 93 #endif | |
| 94 #include "mfw_sys.h" | |
| 95 | |
| 96 #include "prim.h" | |
| 97 | |
| 98 | |
| 99 #include "mfw_mfw.h" | |
| 100 #include "mfw_win.h" | |
| 101 #include "mfw_kbd.h" | |
| 102 #include "mfw_lng.h" | |
| 103 #include "mfw_tim.h" | |
| 104 /* SPR#1428 - SH - New Editor changes */ | |
| 105 #ifndef NEW_EDITOR | |
| 106 #include "mfw_edt.h" | |
| 107 #endif | |
| 108 #include "mfw_icn.h" | |
| 109 #include "mfw_mnu.h" | |
| 110 #include "mfw_phb.h" | |
| 111 #include "mfw_sim.h" | |
| 112 #include "mfw_nm.h" | |
| 113 #include "mfw_mme.h" | |
| 114 #include "mfw_sat.h" | |
| 115 #include "mfw_sms.h" | |
| 116 | |
| 117 #include "cus_aci.h" | |
| 118 | |
| 119 #include "prim.h" | |
| 120 #ifndef PCM_2_FFS | |
| 121 #include "pcm.h" | |
| 122 #endif | |
| 123 | |
| 124 #include "ksd.h" | |
| 125 #include "psa.h" | |
| 126 | |
| 127 | |
| 128 #include "MmiMmi.h" | |
| 129 #include "MmiMain.h" | |
| 130 | |
| 131 #include "MmiDummy.h" | |
| 132 #include "MmiDialogs.h" | |
| 133 #include "MmiLists.h" | |
| 134 | |
| 135 /* Retrieve PM duration from FlashData structure */ | |
| 136 #ifdef NEPTUNE_BOARD | |
| 137 #ifdef MMI_POWER_MANAGEMENT_TEST | |
| 138 #include "mfw_ffs.h" | |
| 139 #endif | |
| 140 #endif | |
| 141 | |
| 142 #include "dspl.h" | |
| 143 #include "drv_key.h" | |
| 144 | |
| 145 #ifdef FF_MMI_MULTIMEDIA | |
| 146 /* To Assign the MSL_Init Return Value */ | |
| 147 #include "MSL.h" | |
| 148 #include "mmiMultimediaApp.h" | |
| 149 #include "omxutil.h" | |
| 150 /* Bug Fix - OMAPS00084167 */ | |
| 151 /* Added - To access the funtion dev_Mbox_isDspMboxReady () */ | |
| 152 #include "typedefs.h" | |
| 153 #include "main_system.h" | |
| 154 #include "dev_Mbox.h" /* 04-07-2006 */ | |
| 155 #include "mfw_acie.h" /* prototypes of aci_delete and aci_create */ | |
| 156 #endif | |
| 157 | |
| 158 #ifdef MMI_LITE | |
| 159 #define MFW_MEMORY_POOL_SIZE 22000 /*SPR 2686*/ | |
| 160 #else | |
| 161 #ifdef FF_MMI_MMS | |
| 162 #define MFW_MEMORY_POOL_SIZE (220*1024) | |
| 163 #else | |
| 164 #ifdef FF_MMI_MULTIMEDIA | |
| 165 #define MFW_MEMORY_POOL_SIZE (220 * 1024) // RAVI - 18-07-2005 - For Image display | |
| 166 #else | |
| 167 #define MFW_MEMORY_POOL_SIZE 45000 | |
| 168 #endif | |
| 169 #endif | |
| 170 #endif | |
| 171 | |
| 172 | |
| 173 #ifndef _SIMULATION_ | |
| 174 extern void AI_Power(unsigned char power); | |
| 175 #endif //_SIMULATION_ | |
| 176 | |
| 177 /******************************************************************************* | |
| 178 | |
| 179 Global Data Elements | |
| 180 | |
| 181 *******************************************************************************/ | |
| 182 | |
| 183 U16 mmiScrX, mmiScrY; /* display sreen size */ | |
| 184 | |
| 185 static U8 mfwMem [MFW_MEMORY_POOL_SIZE]; /* mfw memory pool */ | |
| 186 /* x0039928 - Lint warning fix | |
| 187 static int initialized = 0; */ | |
| 188 | |
| 189 /* Begin Bug Fix - OMAPS00084167 */ | |
| 190 /* Added for Primitive exchange */ | |
| 191 #ifdef ENABLE_KEY_ON_BOOTING | |
| 192 #define hCommACI _ENTITY_PREFIXED(hCommACI) | |
| 193 | |
| 194 #if defined (NEW_FRAME) | |
| 195 EXTERN T_HANDLE hCommACI; | |
| 196 #else | |
| 197 EXTERN T_VSI_CHANDLE hCommACI; | |
| 198 #endif | |
| 199 | |
| 200 #define BOOTUP_WAIT_TIME 20 | |
| 201 #define BOOTUP_SUCCESS_IND 1 | |
| 202 #define MFW_BOOTUP_IND 0x910 | |
| 203 | |
| 204 static int iPrimitiveSlot = 0; | |
| 205 | |
| 206 /* ====================================================== */ | |
| 207 /** | |
| 208 * Structure which holds the Status details | |
| 209 **/ | |
| 210 /* ====================================================== */ | |
| 211 typedef struct | |
| 212 { | |
| 213 int iStatus; | |
| 214 }T_MFW_BOOTUP_IND; | |
| 215 | |
| 216 GLOBAL BOOL bootup_response_cb (ULONG opc, void * data); | |
| 217 #endif | |
| 218 /* End - OMAPS00084167 */ | |
| 219 | |
| 220 | |
| 221 | |
| 222 /******************************************************************************* | |
| 223 | |
| 224 Public Methods | |
| 225 | |
| 226 *******************************************************************************/ | |
| 227 | |
| 228 /******************************************************************************* | |
| 229 | |
| 230 $Function: mmi_main | |
| 231 | |
| 232 $Description: entry point for the MMI, this hands control to mmiInit | |
| 233 | |
| 234 $Returns: None. | |
| 235 | |
| 236 $Arguments: None. | |
| 237 | |
| 238 *******************************************************************************/ | |
| 239 | |
| 240 void mmi_main( void ) | |
| 241 { | |
| 242 /* JVJ #1874 - mmi_main doesnt start the MMI. It only initilizes the Keyboard handler*/ | |
| 243 /* The keyboard handler will call mmiInit() when the Power Key is pressed */ | |
| 244 // Jun 13 2005, REF:LOCOSTO-OTH-32113 - xpradipg | |
| 245 #if (BOARD == 61) | |
| 246 /* BUG FIX - OMAPS00084167 */ | |
| 247 /* For multimedia alone generate the primitive */ | |
| 248 #ifdef ENABLE_KEY_ON_BOOTING | |
| 249 /* Send the primitive to MMI */ | |
| 250 PALLOC (bootup_indication, MFW_BOOTUP_IND); | |
| 251 #endif | |
| 252 /* END - OMAPS00084167 */ | |
| 253 | |
| 254 #if FF_MMI_SERVICES_MIGRATION | |
| 255 drvKeyUpDown(0,0); | |
| 256 #else | |
| 257 key_power_init(); | |
| 258 #endif | |
| 259 | |
| 260 | |
| 261 #ifndef ENABLE_KEY_ON_BOOTING | |
| 262 vsi_t_sleep(VSI_CALLER 50); | |
| 263 mmiInit(); | |
| 264 #else | |
| 265 /* Begin - Bug fix - OMAPS00084167 */ | |
| 266 iPrimitiveSlot = aci_create (bootup_response_cb, NULL); | |
| 267 | |
| 268 bootup_indication->iStatus = BOOTUP_SUCCESS_IND; | |
| 269 PSENDX (ACI, bootup_indication); | |
| 270 /* End - OMAPS00084167 */ | |
| 271 #endif | |
| 272 | |
| 273 | |
| 274 #else /* Other Builds */ | |
| 275 key_power_init(); | |
| 276 #endif | |
| 277 | |
| 278 } | |
| 279 /* Begin - Bugfix - OMAPS00084167 */ | |
| 280 #ifdef ENABLE_KEY_ON_BOOTING | |
| 281 /* ===========================================================*/ | |
| 282 /** | |
| 283 * bootup_response_cb () - response function. | |
| 284 * | |
| 285 * @param ULONG opc - Operation Code. | |
| 286 * | |
| 287 * @param void * data - structure data. | |
| 288 * | |
| 289 * @return BOOL - TRUE / FALSE | |
| 290 * | |
| 291 * @see | |
| 292 */ | |
| 293 /* =========================================================== */ | |
| 294 GLOBAL BOOL bootup_response_cb (ULONG opc, void * data) | |
| 295 { | |
| 296 T_MFW_BOOTUP_IND *bootup_indication; | |
| 297 | |
| 298 if (opc == MFW_BOOTUP_IND) { | |
| 299 bootup_indication = (T_MFW_BOOTUP_IND *)data; | |
| 300 | |
| 301 /* Status is 1 then bootup sequence has enabled */ | |
| 302 if (bootup_indication->iStatus == BOOTUP_SUCCESS_IND) { | |
| 303 /* Contineous Pooling */ | |
| 304 while (dev_Mbox_isDspMboxReady() == FALSE) | |
| 305 { | |
| 306 vsi_t_sleep (VSI_CALLER BOOTUP_WAIT_TIME); /* Small Delay after each check */ | |
| 307 } | |
| 308 | |
| 309 aci_delete (iPrimitiveSlot); | |
| 310 | |
| 311 /* Once DSP initialization is done */ | |
| 312 mmiInit (); | |
| 313 | |
| 314 return TRUE; | |
| 315 | |
| 316 } | |
| 317 | |
| 318 } | |
| 319 | |
| 320 return FALSE; | |
| 321 | |
| 322 } | |
| 323 #endif /* End - OMAPS00084167 */ | |
| 324 | |
| 325 | |
| 326 | |
| 327 /******************************************************************************* | |
| 328 | |
| 329 $Function: mmiInit | |
| 330 | |
| 331 $Description: This initialises the MMI application | |
| 332 | |
| 333 $Returns: None. | |
| 334 | |
| 335 $Arguments: None. | |
| 336 | |
| 337 *******************************************************************************/ | |
| 338 | |
| 339 | |
| 340 void mmiInit( void ) | |
| 341 { | |
| 342 #ifdef FF_MMI_MULTIMEDIA | |
| 343 unsigned int uiResult = 0; | |
| 344 #endif | |
| 345 | |
| 346 /* get the resources running | |
| 347 */ | |
| 348 | |
| 349 /* Initialise the MFW and windowing system | |
| 350 */ | |
| 351 mfwInit( mfwMem, sizeof( mfwMem ) ); | |
| 352 winInit( &mmiScrX, &mmiScrY ); | |
| 353 | |
| 354 | |
| 355 timInit(); /* init timer handler */ | |
| 356 kbdInit(); /* init keyboard handler */ | |
| 357 lngInit(); /* init language handler */ | |
| 358 #ifndef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */ | |
| 359 edtInit(); /* init editor handler */ | |
| 360 #endif /* NEW_EDITOR */ | |
| 361 | |
| 362 mnuInit(); /* init menu handler */ | |
| 363 icnInit(); /* init icon handler */ | |
| 364 //Oct 05, 2006 ER: OMAPS00094496 x0061088(Prachi) | |
| 365 sAT_PercentCSQ ( CMD_SRC_LCL, CSQ_Enable ); | |
| 366 mainInit(0); | |
| 367 #ifdef FF_MMI_MULTIMEDIA | |
| 368 /* MSL Init Call */ | |
| 369 uiResult = MSL_Init(); | |
| 370 vsi_t_sleep(0, 100); | |
| 371 mmi_setInitResult(uiResult); | |
| 372 | |
| 373 /* Power management. Enable/Disable on boot up based on value stored*/ | |
| 374 #ifdef NEPTUNE_BOARD | |
| 375 #ifdef MMI_POWER_MANAGEMENT_TEST | |
| 376 if(FFS_flashData.pm_duration) | |
| 377 { | |
| 378 SVC_SCN_EnablePM( 1, FFS_flashData.pm_duration); | |
| 379 } | |
| 380 #endif | |
| 381 #endif | |
| 382 /* PCM Setup Done */ | |
| 383 /* MSLRM_Start (); */ | |
| 384 #endif | |
| 385 | |
| 386 } | |
| 387 | |
| 388 | |
| 389 | |
| 390 | |
| 391 | |
| 392 | |
| 393 /******************************************************************************* | |
| 394 | |
| 395 $Function: mmiExit | |
| 396 | |
| 397 $Description: This exits the MMI application | |
| 398 | |
| 399 $Returns: None. | |
| 400 | |
| 401 $Arguments: None. | |
| 402 | |
| 403 *******************************************************************************/ | |
| 404 | |
| 405 | |
| 406 | |
| 407 | |
| 408 | |
| 409 void mmiExit( void ) | |
| 410 { | |
| 411 TRACE_EVENT("mmiExit"); | |
| 412 | |
| 413 icnExit(); /* finit icon handler */ | |
| 414 mnuExit(); /* finit menu handler */ | |
| 415 #ifndef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */ | |
| 416 edtExit(); /* finit edit handler */ | |
| 417 #endif /* NEW_EDITOR */ | |
| 418 lngExit(); /* finit language handler */ | |
| 419 kbdExit(); /* finit keyboard handler */ | |
| 420 timExit(); /* finit timer handler */ | |
| 421 | |
| 422 winExit(); /* finit window handler */ | |
| 423 mfwExit(); /* exit mfw */ | |
| 424 | |
| 425 dspl_ClearAll(); | |
| 426 // Jun 23, 2004 REF: CRR MMI-SPR-16665 Rashmi C N(Sasken) | |
| 427 // Description: Ocasionaly the LCD used to get stuck with the TI LOGO during power off. | |
| 428 // Solution: By calling dspl_Enable(1) we are forcing the LCD to get updated. | |
| 429 dspl_Enable(1); | |
| 430 TRACE_EVENT("SWITCHING_OFF!!!!!"); | |
| 431 vsi_t_sleep (VSI_CALLER 50); | |
| 432 /* | |
| 433 * Power off the board | |
| 434 * | |
| 435 */ | |
| 436 #ifndef _SIMULATION_ | |
| 437 AI_Power(0); | |
| 438 #endif //_SIMULATION_ | |
| 439 | |
| 440 } | |
| 441 | |
| 442 | |
| 443 | |
| 444 | |
| 445 /******************************************************************************* | |
| 446 | |
| 447 End Of File | |
| 448 | |
| 449 *******************************************************************************/ | |
| 450 |
