记录Error Log函数

 1 void ErrorRecord(uint32_t Error)
 2 {
 3     static uint32_t ErrorRecorder = 0;
 4     static uint32_t ErrorLast = 0;
 5     static uint8_t  ErrorCounter = 0;
 6     if((Error != ErrorLast) && (ErrorCounter < 1))
 7     {
 8         ErrorLast = Error;
 9         ErrorRecorder = ErrorRecorder | (Error<<(4*ErrorCounter));
10         ErrorCounter++;        
11         SetFPS(ErrorRecorder);
12     }
13     else
14     {
15     }
16 }
17 
18 void ErrorWrite(uint32_t FunctionIndex,uint32_t ErrorIndex)
19 {
20     uint32_t Error = 0;
21     if((FunctionIndex > 3) || (ErrorIndex > 3))
22     {
23         return;
24     }
25     else
26     {
27         Error = FunctionIndex<<2 + ErrorIndex;
28         ErrorRecord(Error);
29     }
30 }

 

posted @ 2020-10-22 13:41  aWolfMan  阅读(119)  评论(0编辑  收藏  举报