comparison src/ui/bmi/mmiMmi.c @ 213:0947a816580c

first stage of FreeCalypso handset switch-on logic rework
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 22 Apr 2021 21:23:16 +0000
parents 7eee5ad6ae86
children
comparison
equal deleted inserted replaced
212:782c6ae77467 213:0947a816580c
128 128
129 #include "MmiDummy.h" 129 #include "MmiDummy.h"
130 #include "MmiDialogs.h" 130 #include "MmiDialogs.h"
131 #include "MmiLists.h" 131 #include "MmiLists.h"
132 132
133 /* Retrieve PM duration from FlashData structure */
134 #ifdef NEPTUNE_BOARD
135 #ifdef MMI_POWER_MANAGEMENT_TEST
136 #include "mfw_ffs.h"
137 #endif
138 #endif
139
140 #include "dspl.h" 133 #include "dspl.h"
141 #include "drv_key.h" 134 #include "drv_key.h"
142
143 #ifdef FF_MMI_MULTIMEDIA
144 /* To Assign the MSL_Init Return Value */
145 #include "MSL.h"
146 #include "mmiMultimediaApp.h"
147 #include "omxutil.h"
148 /* Bug Fix - OMAPS00084167 */
149 /* Added - To access the funtion dev_Mbox_isDspMboxReady () */
150 #include "typedefs.h"
151 #include "main_system.h"
152 #include "dev_Mbox.h" /* 04-07-2006 */
153 #include "mfw_acie.h" /* prototypes of aci_delete and aci_create */
154 #endif
155 135
156 #ifdef MMI_LITE 136 #ifdef MMI_LITE
157 #define MFW_MEMORY_POOL_SIZE 22000 /*SPR 2686*/ 137 #define MFW_MEMORY_POOL_SIZE 22000 /*SPR 2686*/
158 #else 138 #else
159 #ifdef FF_MMI_MMS 139 #ifdef FF_MMI_MMS
182 162
183 static U8 mfwMem [MFW_MEMORY_POOL_SIZE]; /* mfw memory pool */ 163 static U8 mfwMem [MFW_MEMORY_POOL_SIZE]; /* mfw memory pool */
184 /* x0039928 - Lint warning fix 164 /* x0039928 - Lint warning fix
185 static int initialized = 0; */ 165 static int initialized = 0; */
186 166
187 /* Begin Bug Fix - OMAPS00084167 */
188 /* Added for Primitive exchange */
189 #ifdef ENABLE_KEY_ON_BOOTING
190 #define hCommACI _ENTITY_PREFIXED(hCommACI)
191
192 #if defined (NEW_FRAME)
193 EXTERN T_HANDLE hCommACI;
194 #else
195 EXTERN T_VSI_CHANDLE hCommACI;
196 #endif
197
198 #define BOOTUP_WAIT_TIME 20
199 #define BOOTUP_SUCCESS_IND 1
200 #define MFW_BOOTUP_IND 0x910
201
202 static int iPrimitiveSlot = 0;
203
204 /* ====================================================== */
205 /**
206 * Structure which holds the Status details
207 **/
208 /* ====================================================== */
209 typedef struct
210 {
211 int iStatus;
212 }T_MFW_BOOTUP_IND;
213
214 GLOBAL BOOL bootup_response_cb (ULONG opc, void * data);
215 #endif
216 /* End - OMAPS00084167 */
217
218 167
219 /******************************************************************************* 168 /*******************************************************************************
220 169
221 Public Methods 170 Public Methods
222 171
234 183
235 *******************************************************************************/ 184 *******************************************************************************/
236 185
237 void mmi_main( void ) 186 void mmi_main( void )
238 { 187 {
239 /* JVJ #1874 - mmi_main doesnt start the MMI. It only initilizes the Keyboard handler*/ 188 /*
240 /* The keyboard handler will call mmiInit() when the Power Key is pressed */ 189 * In FreeCalypso this function is now empty: Switch_ON() will call
241 // Jun 13 2005, REF:LOCOSTO-OTH-32113 - xpradipg 190 * fchs_pwon_button_boot() which will cause mmiInit() to be called
242 #if (BOARD == 61) 191 * in MMI task context, and the setup of key_power_init (for subsequent
243 /* BUG FIX - OMAPS00084167 */ 192 * power-off, not for power-on!) now happens inside mmiInit().
244 /* For multimedia alone generate the primitive */ 193 */
245 #ifdef ENABLE_KEY_ON_BOOTING
246 /* Send the primitive to MMI */
247 PALLOC (bootup_indication, MFW_BOOTUP_IND);
248 #endif
249 /* END - OMAPS00084167 */
250
251 #if FF_MMI_SERVICES_MIGRATION
252 drvKeyUpDown(0,0);
253 #else
254 key_power_init();
255 #endif
256
257
258 #ifndef ENABLE_KEY_ON_BOOTING
259 vsi_t_sleep(VSI_CALLER 50);
260 mmiInit();
261 #else
262 /* Begin - Bug fix - OMAPS00084167 */
263 iPrimitiveSlot = aci_create (bootup_response_cb, NULL);
264
265 bootup_indication->iStatus = BOOTUP_SUCCESS_IND;
266 PSENDX (ACI, bootup_indication);
267 /* End - OMAPS00084167 */
268 #endif
269
270
271 #else /* Other Builds */
272 key_power_init();
273 #endif
274
275 } 194 }
276 /* Begin - Bugfix - OMAPS00084167 */
277 #ifdef ENABLE_KEY_ON_BOOTING
278 /* ===========================================================*/
279 /**
280 * bootup_response_cb () - response function.
281 *
282 * @param ULONG opc - Operation Code.
283 *
284 * @param void * data - structure data.
285 *
286 * @return BOOL - TRUE / FALSE
287 *
288 * @see
289 */
290 /* =========================================================== */
291 GLOBAL BOOL bootup_response_cb (ULONG opc, void * data)
292 {
293 T_MFW_BOOTUP_IND *bootup_indication;
294
295 if (opc == MFW_BOOTUP_IND) {
296 bootup_indication = (T_MFW_BOOTUP_IND *)data;
297
298 /* Status is 1 then bootup sequence has enabled */
299 if (bootup_indication->iStatus == BOOTUP_SUCCESS_IND) {
300 /* Contineous Pooling */
301 while (dev_Mbox_isDspMboxReady() == FALSE)
302 {
303 vsi_t_sleep (VSI_CALLER BOOTUP_WAIT_TIME); /* Small Delay after each check */
304 }
305
306 aci_delete (iPrimitiveSlot);
307
308 /* Once DSP initialization is done */
309 mmiInit ();
310
311 return TRUE;
312
313 }
314
315 }
316
317 return FALSE;
318
319 }
320 #endif /* End - OMAPS00084167 */
321 195
322 196
323 /******************************************************************************* 197 /*******************************************************************************
324 198
325 $Function: mmiInit 199 $Function: mmiInit
333 *******************************************************************************/ 207 *******************************************************************************/
334 208
335 209
336 void mmiInit( void ) 210 void mmiInit( void )
337 { 211 {
338 #ifdef FF_MMI_MULTIMEDIA
339 unsigned int uiResult = 0;
340 #endif
341
342 /* get the resources running 212 /* get the resources running
343 */ 213 */
344 214
345 /* Initialise the MFW and windowing system 215 /* Initialise the MFW and windowing system
346 */ 216 */
347 mfwInit( mfwMem, sizeof( mfwMem ) ); 217 mfwInit( mfwMem, sizeof( mfwMem ) );
348 winInit( &mmiScrX, &mmiScrY ); 218 winInit( &mmiScrX, &mmiScrY );
349 219
350
351 timInit(); /* init timer handler */ 220 timInit(); /* init timer handler */
352 kbdInit(); /* init keyboard handler */ 221 kbdInit(); /* init keyboard handler */
222 key_power_init(); /* init power-off handler */
353 lngInit(); /* init language handler */ 223 lngInit(); /* init language handler */
354 #ifndef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */ 224 #ifndef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */
355 edtInit(); /* init editor handler */ 225 edtInit(); /* init editor handler */
356 #endif /* NEW_EDITOR */ 226 #endif /* NEW_EDITOR */
357 227
358 mnuInit(); /* init menu handler */ 228 mnuInit(); /* init menu handler */
359 icnInit(); /* init icon handler */ 229 icnInit(); /* init icon handler */
360 //Oct 05, 2006 ER: OMAPS00094496 x0061088(Prachi) 230 //Oct 05, 2006 ER: OMAPS00094496 x0061088(Prachi)
361 sAT_PercentCSQ ( CMD_SRC_LCL, CSQ_Enable ); 231 sAT_PercentCSQ ( CMD_SRC_LCL, CSQ_Enable );
362 mainInit(0); 232 mainInit(0);
363 #ifdef FF_MMI_MULTIMEDIA
364 /* MSL Init Call */
365 uiResult = MSL_Init();
366 vsi_t_sleep(0, 100);
367 mmi_setInitResult(uiResult);
368
369 /* Power management. Enable/Disable on boot up based on value stored*/
370 #ifdef NEPTUNE_BOARD
371 #ifdef MMI_POWER_MANAGEMENT_TEST
372 if(FFS_flashData.pm_duration)
373 {
374 SVC_SCN_EnablePM( 1, FFS_flashData.pm_duration);
375 }
376 #endif
377 #endif
378 /* PCM Setup Done */
379 /* MSLRM_Start (); */
380 #endif
381
382 } 233 }
383 234
384 235
385 /******************************************************************************* 236 /*******************************************************************************
386 237
395 *******************************************************************************/ 246 *******************************************************************************/
396 247
397 248
398 void mmiExit( void ) 249 void mmiExit( void )
399 { 250 {
400 TRACE_EVENT("mmiExit"); 251 TRACE_EVENT("mmiExit");
401 252
402 icnExit(); /* finit icon handler */ 253 icnExit(); /* finit icon handler */
403 mnuExit(); /* finit menu handler */ 254 mnuExit(); /* finit menu handler */
404 #ifndef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */ 255 #ifndef NEW_EDITOR /* SPR#1428 - SH - New Editor changes */
405 edtExit(); /* finit edit handler */ 256 edtExit(); /* finit edit handler */
406 #endif /* NEW_EDITOR */ 257 #endif /* NEW_EDITOR */
407 lngExit(); /* finit language handler */ 258 lngExit(); /* finit language handler */
408 kbdExit(); /* finit keyboard handler */ 259 kbdExit(); /* finit keyboard handler */
409 timExit(); /* finit timer handler */ 260 timExit(); /* finit timer handler */
423 * 274 *
424 */ 275 */
425 #ifndef _SIMULATION_ 276 #ifndef _SIMULATION_
426 AI_Power(0); 277 AI_Power(0);
427 #endif //_SIMULATION_ 278 #endif //_SIMULATION_
428
429 } 279 }
430 280
431 281
432 /******************************************************************************* 282 /*******************************************************************************
433 283