UI_PSF_sleep.c File Reference


Detailed Description

This module provides user interface parent sleep state handle.

REVISION

Definition in file UI_PSF_sleep.c.

#include "ui.h"
#include "ui_assert.h"
#include "../basicboot/bootmode.h"
#include "../SYSTEM/sys_main.h"
#include "../SYSTEM/sys_led.h"
#include "../SYSTEM/sys_clock.h"
#include "../HDD/hdd.h"

Include dependency graph for UI_PSF_sleep.c:

Include dependency graph

Go to the source code of this file.

Functions

PARENT_STATE UI_PSF_sleep (st_MSG *msgIN)
 Function serves as the parent sleep state handle.


Function Documentation

PARENT_STATE UI_PSF_sleep st_MSG msgIN  ) 
 

Function serves as the parent sleep state handle.

This is where system gets shutdown with the power cable plugged in. When coming here, only following 4 messages can possibly wake system up, 1), PLAY press; 2), HiSi press; 3), USB plug; 4), Alarm fired. and 5) Unplug of power cabe or hold key-back will completely shut down system.

Parameters:
msgIN Input message.
Returns:
Next state.

Definition at line 65 of file UI_PSF_sleep.c.

References ALL_LED, BOOT_AUTOLAUNCH1, BOOT_HHISI, BOOT_MAIN, KBD_isKeyDown(), KDOWN, LCD_power(), LED_OFF, SPOWER_UNPLUG, SPSF_NULL, SSHUT_DOWN, SSTART2HISI, SSTART2RECORD, SSTATE_END, SSTATE_START, SUSB_PLUG, SYS_autoffDisable(), SYS_delayMicrosecond(), SYS_onOffLEDs(), USB_cableStatusInit(), and st_SYSPARAM::x_hisibutton.

00066 {   
00067     st_MSG          msgOUT;
00068     MSG_ID          id = msgIN->id;     
00069     MSG_DATA        d1 = msgIN->d1; 
00070     MSG_DATA        d2 = msgIN->d2;
00071 
00072     if( (SYS_MSG_ID == id)&&(SSTATE_START == d1) )
00073     {
00074         // Wait till system status is stable.
00075         SYS_delayMicrosecond(300000);
00076             
00077         if( (!SYS_isPowerPlugged()) || (SYS_isBatDead()) ||
00078             !( (HDD_ID == 0xA017) || (HDD_ID == 0xA018) ) ) // is a usb 2.0 backpack? -wk
00079         {
00080             LCD_power(LCD_POWER_OFF, 0);    
00081             SYS_onOffLEDs(ALL_LED, LED_OFF);
00082 
00083             // Wait till LCD stably shuts down.
00084             SYS_delayMicrosecond(1000000);
00085             _shutDown();
00086         }
00087         else
00088         {
00089             //SYS_clockSetup(CLOCK_SLEEP);
00090             SYS_autoffDisable();
00091             
00092             USB_cableStatusInit();
00093             SYS_usbEnabled();
00094             
00095             // Tell system to do the charge animation.
00096             SYS_batteryAnimation();
00097 
00098             // Reenble keyboard routine here.
00099             SYS_kbdEnabled();
00100         }
00101     }
00102     else if( ((KBD_MSG_ID == id)&&((KEY_PPLAY == d1)||(KEY_PLAY == d1)))||
00103         ((SYS_MSG_ID == id)&&((SUSB_PLUG == d1)||(SSHUT_DOWN == d1))) ) 
00104 //DeepB
00105 // Disable USB Cable detection
00106 //  else if( ((KBD_MSG_ID == id)&&((KEY_PPLAY == d1)||(KEY_PLAY == d1)))||
00107 //      ((SYS_MSG_ID == id)&&(SSHUT_DOWN == d1)) ) 
00108     {
00109         if(TRUE == KBD_isKeyDown(KDOWN))
00110         {           
00111             SYS_reboot(BOOT_AUTOLAUNCH1);
00112         }
00113         SYS_reboot(BOOT_MAIN);          
00114     }
00115 //DeepB
00116     else if( (((SYS_MSG_ID == id)&&(SSTART2RECORD == d1))||
00117         ((SYS_MSG_ID == id)&&(SSTART2HISI == d1)) ) && (sysParam.x_hisibutton < XTRA_HISI_OFF))
00118     {
00119         SYS_reboot(BOOT_HHISI);         
00120     }
00121     else if( ( (SYS_MSG_ID == id) && (SPOWER_UNPLUG == d1) ) || 
00122              ( (KBD_MSG_ID == id) && (KEY_HBACK == d1) ) // check for key-left -wk
00123              )
00124     {
00125             _shutDown();
00126     }
00127     else if( (SYS_MSG_ID == id)&&(SSTATE_END == d1) )
00128     {
00129         mMSG_send(sysMsgQ, SYS_MSG_ID, SPSF_NULL, DONTCARE, SYS_FOREVER);
00130         return P_SLEEP;
00131     }
00132     //else if alarm here...
00133     return P_SLEEP;
00134 }

Here is the call graph for this function:


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