UI_ear.c File Reference


Detailed Description

This module provides GUI level EAR support.

REVISION

Definition in file UI_ear.c.

#include "../SYSTEM/sys_main.h"
#include "../SYSTEM/sys_hardware.h"
#include "../basicboot/bootmode.h"
#include "../ear/ear.h"
#include "ui.h"
#include "ui_assert.h"

Include dependency graph for UI_ear.c:

Include dependency graph

Go to the source code of this file.

Functions

long UI_pendingEarDiskSpace (void)
 Function returns pending device-to-PC EAR disk space in kilobytes.
void UI_processEAR (void)
 Function checks to handle all EAR requests if there is any.
BOOL UI_earPut (const char *drive, D2PEAR_ID id, PEAR_DATA pData, USHORT dataLen, long diskSpace)
 Function adds an EAR entry to the EAR file and refresh membar if needed.


Function Documentation

BOOL UI_earPut const char *  drive,
D2PEAR_ID  id,
PEAR_DATA  pData,
USHORT  dataLen,
long  diskSpace
 

Function adds an EAR entry to the EAR file and refresh membar if needed.

Parameters:
drive Drive letter string.
id device to PC EAR id.
pData EAR request support data pointer.
dataLen EAR support data length in words.
diskSpace EAR disk space usage in kilo bytes. (1024).
Returns:
TRUE if request successfully added, otherwise FALSE.

Definition at line 144 of file UI_ear.c.

References D2PEAR_ID, EAR_put(), FAT_freeSpace(), PEAR_DATA, and UI_updateMembar().

Referenced by UI_PSF_play().

00149 {
00150     if(diskSpace < 0)
00151     {
00152         if(-diskSpace > FAT_freeSpace((drive == strDISKD)?DISK_D:DISK_C) )
00153         {
00154             // Disk full.
00155             return FALSE;
00156         }       
00157     }
00158     
00159     EAR_put(drive,id,pData,dataLen,diskSpace);
00160     //if(diskSpace)
00161     {
00162         UI_updateMembar();
00163     }
00164     
00165     if( (SYS_isHDDpresent())&&(!SYS_isPlayActive())) 
00166     {
00167         HDD_setPowerMode( HDD_POWEROFF, 0 );
00168     }
00169     
00170     return TRUE;
00171 }

Here is the call graph for this function:

void UI_processEAR void   ) 
 

Function checks to handle all EAR requests if there is any.

Done with EAR, check to reboot system.

Definition at line 78 of file UI_ear.c.

References DISK_C, DISK_D, EAR_DATA, EAR_getClose(), EAR_getFirst(), EAR_getNext(), FAT_cd(), and FAT_delete().

00079 {
00080     EAR_DATA        earData[MAX_DEVICE_EAR_LENGTH];
00081     BOOL            bREBOOT = FALSE;
00082     const char *    disk;
00083     char            strSYNCDIR[16]; 
00084     char            strPC2WOIDEAR[16];
00085     
00086     GEN_readXstr((ULONG)text_syncDir, (USHORT*)strSYNCDIR, 16);
00087     GEN_readXstr((ULONG)text_pc2neurosEar, (USHORT*)strPC2WOIDEAR, 16);
00088     
00089     disk = SYS_isHDDpresent()? strDISKC:strDISKD;
00090 
00091     if(EAR_getFirst(disk, earData, TRUE) == TRUE)
00092     {
00093         do
00094         {
00095             if(_processEAR(earData) == TRUE)
00096                 bREBOOT = TRUE;
00097         
00098         } while( EAR_getNext(earData) == TRUE );    
00099         
00100         EAR_getClose();
00101     }
00102     
00103     // Remove EAR file.
00104     FAT_cd(disk);
00105     
00106     if(FAT_cd(strSYNCDIR) == FALSE ) return;
00107     
00108     FAT_delete(strPC2WOIDEAR);
00109     
00110     
00112     if(bREBOOT == TRUE)
00113     {
00114         // Unmount disk to flush.
00115         FAT_unmountDisk(DISK_D);
00116         if(SYS_isHDDpresent())FAT_unmountDisk(DISK_C);
00117         GEN_reboot();
00118     }
00119     
00120     if( (SYS_isHDDpresent())&&(!SYS_isPlayActive())) 
00121     {
00122         HDD_setPowerMode( HDD_POWEROFF, 0 );
00123     }
00124 }

Here is the call graph for this function:


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