00001
00002
00003
00004
00005
00006
00007
00016
00017 #ifndef SYS_ASSERT__H
00018 #define SYS_ASSERT__H
00019
00020
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024
00025
00026 #include "stdio.h"
00027 #include "stdlib.h"
00028 #include "string.h"
00029 #include "std.h"
00030 #include "swi.h"
00031 #include "tsk.h"
00032 #include "mbx.h"
00033 #include "lck.h"
00034 #include "sem.h"
00035 #include "../ctype.h"
00036 #include "../c54regs.h"
00037
00038
00039
00040
00041 #define SYS_NOTASSERTED() (0 == g_ERROR)
00042
00043
00044 #define USER_ERR 0x0000
00045 #define LCD_ERR 0x0800
00046 #define NAND_ERR 0x1800
00047 #define FAT_ERR 0x2800
00048 #define USB_ERR 0x3800
00049 #define DB_ERR 0x4800
00050 #define MENU_ERR 0x5800
00051 #define UI_ERR 0x6800
00052 #define SYS_ERR 0x7800
00053 #define BAT_ERR 0x8800
00054 #define KBD_ERR 0x9800
00055 #define HDD_ERR 0xA800
00056 #define CODEC_ERR 0xB800
00057 #define M3U_ERR 0xC800
00058 #define NDB_ERR 0xD800
00059
00060 extern TSK_Stat statbuf;
00061 #if 0
00062 #define SYS_stackassert(err) { TSK_disable(); \
00063 TSK_stat(TSK_self(), &statbuf); \
00064 if (statbuf.used > (statbuf.attrs.stacksize * 9/10)) \
00065 { SYS_die(err); } \
00066 TSK_enable(); }
00067 #else
00068 #define SYS_stackassert(err) ;
00069 #endif
00070
00071
00072 #define SYS_2SYNCTASK SYS_ERR|0x010
00073 #define SYS_2SYNCTASK2 SYS_ERR|0x011
00074 #define SYS_AFTERSYNCTASK SYS_ERR|0x018
00075 #define SYS_AFTERSYNCTASK2 SYS_ERR|0x019
00076 #define SYS_AFTERSYNCTASK3 SYS_ERR|0x01A
00077 #define SYS_CREATE_DECODERTASK SYS_ERR|0x020
00078 #define SYS_CREATE_DECODERTASK1 SYS_ERR|0x021
00079 #define SYS_CREATE_DECODERTASK2 SYS_ERR|0x022
00080 #define SYS_CREATE_DECODERTASK3 SYS_ERR|0x023
00081 #define SYS_CREATE_DECODERTASK4 SYS_ERR|0x024
00082
00083 #define SYS_CREATE_ENCODERTASK SYS_ERR|0x028
00084 #define SYS_CREATE_ENCODERTASK1 SYS_ERR|0x029
00085 #define SYS_CREATE_ENCODERTASK2 SYS_ERR|0x02A
00086 #define SYS_CREATE_ENCODERTASK3 SYS_ERR|0x02B
00087
00088 #define SYS_CREATEDISKDBTASK SYS_ERR|0x030
00089 #define SYS_DECODER_CONFIG SYS_ERR|0x033
00090 #define SYS_DECODER_CONFIG_MP3 SYS_ERR|0x034
00091 #define SYS_DECODER_CONFIG_OGG SYS_ERR|0x036
00092 #define SYS_DECODER_CONFIG_WMA SYS_ERR|0x038
00093 #define SYS_DECODER_CONFIG_WMA2 SYS_ERR|0x039
00094 #define SYS_DECODER_CONFIG_WAV SYS_ERR|0x03A
00095 #define SYS_DECODER__WAVFIRST SYS_ERR|0x03C
00096 #define SYS_DISKDB_CREATEVERSIONFILE SYS_ERR|0x040
00097 #define SYS_DISKDB_CREATEVERSIONFILE2 SYS_ERR|0x041
00098 #define SYS_DISKDB_CREATEVERSIONFILE3 SYS_ERR|0x042
00099 #define SYS_DISKDB_HDDSETUP SYS_ERR|0x044
00100 #define SYS_DISKDB_HDDSETUP2 SYS_ERR|0x045
00101 #define SYS_ENCODER_CONFIG SYS_ERR|0x048
00102 #define SYS_ENCODER_CONFIG2 SYS_ERR|0x049
00103 #define SYS_ENCODER_CONFIG3 SYS_ERR|0x04A
00104 #define SYS_ENCODER_CONFIG4 SYS_ERR|0x04B
00105 #define SYS_MAIN SYS_ERR|0x050
00106 #define SYS_SERIALNUMBER SYS_ERR|0x058
00107 #define SYS_SERIALNUMBER2 SYS_ERR|0x059
00108 #define SYS_SHUTDOWNTASK SYS_ERR|0x05C
00109 #define SYS_SHUTDOWNTASK2 SYS_ERR|0x05D
00110 #define SYS_STARTUPTASK SYS_ERR|0x060
00111 #define SYS_STARTUPTASK2 SYS_ERR|0x061
00112 #define SYS_STARTUPTASK3 SYS_ERR|0x062
00113 #define SYS_STARTUPTASK4 SYS_ERR|0x063
00114 #define SYS_STARTUPTASK5 SYS_ERR|0x064
00115 #define SYS_SYNCDBTASK SYS_ERR|0x068
00116 #define SYS_SYNCDBTASK2 SYS_ERR|0x069
00117 #define SYS_GEN_PUSHSTACK SYS_ERR|0x080
00118 #define SYS_WDSLEPT SYS_ERR|0x7ff
00119
00120 #define SYS_PROFILER_MAIN SYS_ERR|0x200
00121 #define SYS_PROFILER_MAIN2 SYS_ERR|0x201
00122
00123
00124 extern int g_ERROR;
00125
00126
00127 void SYS_assert(unsigned int, unsigned int);
00128 void SYS_die(unsigned int);
00129 void SYS_initStack(int *, int);
00130
00131
00132 #ifdef __cplusplus
00133 }
00134 #endif
00135
00136
00137 #endif
00138
00139
00140
00141
00142