error.c
来自「PEAKAUDIO用于EV2板的MCU控制源码」· C语言 代码 · 共 60 行
C
60 行
/*************************************************************************
error.c
This is the error reporting module. It also contains routines to support
printing of error messages. Most of the line commands have their own
error messages, this covers the generic errors that many of the line
commands can use.
Copyright (C) 2001-2004 by Cirrus Logic Inc. All Rights Reserved
*************************************************************************/
#include <8051.h>
#include <intrpt.h>
#include <conio.h>
#include "serial.h"
#include "mystrings.h"
#include "error.h"
extern code char * get_error_string( char error_number ) {
static code char * code cmnd_arg_error[] = {
str_ErrorColon,
str_err_BadArg,
errorStr2,
errorStr3,
errorStr4,
errorStr5,
errorStr6,
errorStr7,
errorStr8,
errorStr9,
errorStr10
};
return( cmnd_arg_error[ error_number ] );
}
extern void printErr( char error_number ) {
printStrCode( get_error_string( cERR_ERROR ) );
printStrCodeC( get_error_string( error_number ) );
}
extern void printArgErr( char error_number ) {
printStrCode( get_error_string( cERR_ERROR ) );
printStrCode( get_error_string( cERR_ARGUMENT ) );
printStrCodeC( get_error_string( error_number ) );
}
extern void printErrString( code char * the_error_string ) {
printStrCode( get_error_string( cERR_ERROR ) );
printStrCodeC( the_error_string );
}
extern void printTwoErrorString( code char * first_string, code char * second_string ) {
printStrCode( get_error_string( cERR_ERROR ) );
printStrCode( first_string );
printStrCodeC( second_string );
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?