SYS_assert.c File Reference


Detailed Description

This module provides system assert support functions.

REVISION

Definition in file SYS_assert.c.

#include "sys_hardware.h"
#include "sys_assert.h"
#include "sys_main.h"
#include "../KEYBOARD/keyboard.h"
#include "../MENU/menu.h"
#include "../LCD/lcd.h"
#include "../BASICBOOT/bootmode.h"
#include "../NAND/nand.h"
#include "../DB/db_assert.h"
#include "../FAT/fat_assert.h"

Include dependency graph for SYS_assert.c:

Include dependency graph

Go to the source code of this file.

Functions

void SYS_assert (unsigned int cond, unsigned int err)
 error code.
void SYS_die (unsigned int err)
 Function halts the system and reports the error code.
void SYS_initStack (int *stk, int len)
 Function clears the task stack to support BIOS stack status.


Function Documentation

void SYS_die unsigned int  err  ) 
 

Function halts the system and reports the error code.

Parameters:
err error code.

Definition at line 61 of file SYS_assert.c.

References FONT_MAIN14, LCD_power(), LCD_refreshAll(), LCD_setBrush(), LCD_setFont(), LCD_setPen(), and MENU_buf.

Referenced by CODEC_init(), DB__register(), DECODER_config(), ENCODER_config(), FAT__clusEntry(), FAT__createFile(), FAT__findFirst(), FAT__freeClusNum(), FAT__getCurWorkDir(), HDD__format(), KBD_main(), LCD__loadGraph(), LCD_rdRect(), NAND_mount(), SYS_assert(), SYS_createDecoderTask(), SYS_createEncoderTask(), SYS_kickoff(), SYS_serialNumber(), UI_insertAudioRecord(), UI_insertHisiRecord(), UI_m3uClear(), UI_m3uInit(), UI_PSF_play(), and USB_main().

00062 {   
00063     _fatal(err);
00064     HWI_disable();
00065     g_ERROR = err;
00066     DROM_SWITCH(0);
00067     HWI_disable();
00068     // Set to use internal safe stack.
00069     asm(" stm #0456H, SP");
00070     asm(" nop");
00071     asm(" nop");
00072     asm(" nop");
00073     
00074     // Reinitialize the menu interface.
00075     GEN_load(MSGBOX_CODE);
00076     GEN_reinit(LCD_OBJ);
00077     LCD_setPen(NULL);
00078     LCD_setBrush(NULL);
00079     LCD_setFont(FONT_MAIN14);
00080     if(0 == g_ERROR) LCD_power(LCD_POWER_ON, 22);
00081     mMENU_init();
00082     
00083     // Print out the error code.
00084     _hexErrCode(errCode, g_ERROR);
00085     
00086     MENU_buf[0] = DP_MSGBOX;
00087     MENU_buf[1] =(g_ERROR == 0)? MSGBX_ASSERTHW:MSGBX_ASSERT;
00088     GEN_writeXdata((ULONG)text_assert, (USHORT*)errCode, 2);
00089     mMENU_create((void*)&MENU_buf[0]);
00090     LCD_refreshAll();           
00091     _bail();
00092 }

Here is the call graph for this function:

void SYS_initStack int *  stk,
int  len
 

Function clears the task stack to support BIOS stack status.

Parameters:
stk Task stack pointer.
len Stack length in words.

Definition at line 103 of file SYS_assert.c.

Referenced by SYS__createDiskDbTask(), SYS_createDecoderTask(), SYS_createEncoderTask(), and SYS_createResidentTask().

00104 {
00105     while(len--) *stk++ = 0xBEEF;
00106 }


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