UI_parent.c File Reference


Detailed Description

This module provides user interface parent task handle.

REVISION

Definition in file UI_parent.c.

#include "../basicboot/bootmode.h"
#include "../SYSTEM/sys_main.h"
#include "../SYSTEM/sys_hardware.h"
#include "../SYSTEM/sys_led.h"
#include "../SYSTEM/rtc_inc.h"
#include "../USB/usb.h"
#include "ui.h"
#include "ui_assert.h"
#include "m3u.h"

Include dependency graph for UI_parent.c:

Include dependency graph

Go to the source code of this file.

Functions

void UI_parent (void)
 Function serves as user interface parent task handle.


Function Documentation

void UI_parent void   ) 
 

Function serves as user interface parent task handle.

Parent task is responsible to handle macro level states, such as USB, playback, recording, radio etc.

Definition at line 62 of file UI_parent.c.

References st_MSG::d1, st_MSG::d2, st_MSG::id, MSG_createQ(), PARENT_STATE, SPOWERUP_SEQUENCEDONE, SSTART2HISI, SSTATE_END, SSTATE_END_ACK, SYS_autoffEnable(), SYS_deleteDiskDbTask(), UI_m3uInit(), UI_PSF_hisidone(), and USB_isCablePlugged().

Referenced by SYS_createResidentTask().

00063 {   
00064     st_MSG          msgIN;
00065     st_MSG          msgOUT;
00066     MSG_ID          id;
00067     MSG_DATA        d1;
00068     MSG_DATA        d2;
00069     PARENT_STATE    p_oldstate = P_NULL;
00070     PARENT_STATE    p_curstate = P_NULL;
00071     PSFHDL          PSFHDL_TABLE[] = 
00072                     {           
00073                         UI_PSF_null,
00074                         UI_PSF_sleep,
00075                         UI_PSF_autosync,
00076                         UI_PSF_play,
00077                         UI_PSF_radio,
00078                         UI_PSF_record,
00079                         UI_PSF_recorddone,
00080                         UI_PSF_hisi,
00081                         UI_PSF_hisidone
00082                     };
00083     
00084     uiParentMsgQ = MSG_createQ(UI_MSG_Q_LENGTH);
00085     
00086     while(1)
00087     {
00088         mMSG_get(uiParentMsgQ, &msgIN, SYS_FOREVER);
00089         
00090         id = msgIN.id;     
00091         d1 = msgIN.d1; 
00092         d2 = msgIN.d2;
00093         
00094         if( (SYS_MSG_ID == id)&&(SPOWERUP_SEQUENCEDONE == d1) )
00095         {
00096             SYS_deleteDiskDbTask(SYS_FOREVER);
00097             
00098             #ifdef M3U_SUPPORT
00099             UI_m3uInit();
00100             #endif
00101             
00102             // System has been fully powered up, check to auto-resume
00103             // if USB is not plugged and it is not hisi powerup.
00104             if(SYS_isHisiPowerup())
00105             {
00106                 SYS_powerupSequenceDone();
00107                 mMSG_send(sysMsgQ, SYS_MSG_ID, SSTART2HISI, DONTCARE, SYS_FOREVER);
00108                 continue;
00109             }
00110             
00111             if( (!USB_isCablePlugged())&&(!SYS_isLowBattery()) )
00112             {
00113                 if(FALSE == _autoResume())
00114                 {
00115                     SYS_autoffEnable();     
00116                 }
00117             }           
00118             SYS_usbEnabled();
00119             SYS_powerupSequenceDone();
00120             continue;
00121         }
00122         
00123         p_curstate = UI_getParentSFhdl(p_oldstate)(&msgIN);
00124         while(p_curstate != p_oldstate) 
00125         {
00126             p_oldstate = p_curstate;
00127             _loadCurStateCode(p_curstate);
00128             
00129             msgOUT.id = SYS_MSG_ID;
00130             msgOUT.d1 = SSTATE_START;
00131             // msgIN.d2 is carried over here.
00132             msgOUT.d2 = msgIN.d2;
00133 
00134             p_curstate = UI_getParentSFhdl(p_oldstate)(&msgOUT);
00135         }
00136         
00137         // Report to system the following message status.
00138         if( (SYS_MSG_ID == id)&&(SSTATE_END == d1) )
00139         {
00140             mMSG_send(sysMsgQ, SYS_MSG_ID, SSTATE_END_ACK, DONTCARE, SYS_FOREVER);  
00141         }
00142 
00143         UI_stackassert(UI_PARENT);
00144     }
00145 }

Here is the call graph for this function:


Generated on Wed Jan 19 01:13:30 2005 for neuros-firmware by  doxygen 1.3.9.1