matlab_23550/Inu/Src/N12_Xilinx/xerror.c
Razvalyaev 7e0063eee0 #3 Скомпилилось, но пока ничего не вызывается
Все основные файлы подтянуты без изменений

Изменены (только папка main_matlab):
- заглушки для ненужных функций (main_matlab.c)
- iq библиотека (IQmathLib_matlab.c)
- библиотеки DSP281x
2025-01-13 11:09:58 +03:00

429 lines
11 KiB
C

#include "xerror.h"
/*
#pragma CODE_SECTION(xassert,".fast_run");
int xassert(unsigned int er, unsigned int er_ID, void *CallBackRef){
if(er)
return xerror(er_ID, CallBackRef);
return 0;
}
*/
int xerror(unsigned int er_ID, void *CallBackRef)
{
switch(er_ID){
//main
// error test Xilinx. Xilinx dead.
case main_er_ID(1): XERROR_DEBUG_MODE; break;
// îøèáêà â íàñòðîéêàõ ïðîåêòà, ðàçìåðíîñòü ìàññèâà íàïðèìåð
case main_er_ID(2): XERROR_DEBUG_MODE; break;
// îøèáêà íà ëèíèè err0
case main_er_ID(3): XERROR_DEBUG_MODE; break;
//xtools
// error load Xilinx. faulse level on line INIT
case xtools_er_ID(1): XERROR_DEBUG_MODE; break;
// error load Xilinx. faulse level on line DONE
case xtools_er_ID(2): XERROR_DEBUG_MODE; break;
//xseeprom
//error write to serial eeprom. xseeprom_write_all
case xseeprom_er_ID(1): XERROR_DEBUG_MODE; break;
// error read from serial eeprom. xseeprom_read_all
case xseeprom_er_ID(2): XERROR_DEBUG_MODE; break;
// error compare serial eeprom.
case xseeprom_er_ID(3): XERROR_DEBUG_MODE; break;
//serialBus
//error write to serial bus
case xserial_bus_er_ID(1): XERROR_DEBUG_MODE; break;
//error find plates on serial bus
case xserial_bus_er_ID(2): XERROR_DEBUG_MODE; break;
//PBus
//error setup to parall bus, overfull size pbus array!
case xparall_bus_er_ID(1): XERROR_DEBUG_MODE; break;
//error run parall bus!
case xparall_bus_er_ID(2): XERROR_DEBUG_MODE; break;
default: XERROR_DEBUG_MODE; break;
}
return 1;
}
/*
int xerror(unsigned int er_ID, void *CallBackRef){
unsigned int er=1;
unsigned int Value;
static int count_error=0;
// XIn_Plane XIn_Plane0;
// if(x_mask_er)
// return 0;
// asm (" ESTOP0");
switch(er_ID){
// error write/read
case main_er_ID(1): XERROR_DEBUG_MODE; xReady_reg_reset(); break;
// error in write/read
//case xinput_new_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
// case xinput_new_er_ID(2): XERROR_DEBUG_MODE; break;
case xinput_new_er_ID(2): XERROR_DEBUG_MODE_INPUT_NEW_NOT_READY; if (XERROR_DEBUG_LEVEL==1) {er=0;} break;
// config information is empty
case xinput_new_er_ID(3): XERROR_DEBUG_MODE; break;
// bad input parameter
case xinput_new_er_ID(4): XERROR_DEBUG_MODE; break;
// too large parameter max,high or low
case xinput_new_er_ID(5): XERROR_DEBUG_MODE; break;
// High_value must be more 0
case xinput_new_er_ID(6): XERROR_DEBUG_MODE; break;
// too large parameter Max_value
case xinput_new_er_ID(7): XERROR_DEBUG_MODE; break;
// triggeing data is NOT READY
case xinput_new_er_ID(8): XERROR_DEBUG_MODE; break;
// test write/read is failure
case xinput_new_er_ID(9): XERROR_DEBUG_MODE; break;
// error in write/read
//case xintc_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
case xintc_er_ID(2): XERROR_DEBUG_MODE; break;
// unknown mode
case xintc_er_ID(3): XERROR_DEBUG_MODE; break;
// Id is not exist
case xintc_er_ID(4): XERROR_DEBUG_MODE; break;
// Handle is Null
case xintc_er_ID(5): XERROR_DEBUG_MODE; break;
//self-test is failure because mode is Real or
//simulate of interrupt is failure because mode is Real
case xintc_er_ID(6): XERROR_DEBUG_MODE; break;
//self-test is failure
case xintc_er_ID(7): XERROR_DEBUG_MODE; break;
// error in write/read
case xserial_bus_er_ID(1): //XERROR_DEBUG_MODE;
count_error++;
Value=((XSerial_bus *)CallBackRef)->Adr.bit.AdrPlane;
break;
// structure is NOT READY
case xserial_bus_er_ID(2): XERROR_DEBUG_MODE; break;
// config information is empty
case xserial_bus_er_ID(3): XERROR_DEBUG_MODE; break;
// PicoBlaze is not found in hardware
case xserial_bus_er_ID(4): XERROR_DEBUG_MODE; break;
// serial bus is hang up
case xserial_bus_er_ID(5): XERROR_DEBUG_MODE; write_memory(((XSerial_bus *)CallBackRef)->BaseAddress+adr_Xserial_iar_ipr,0xffff); break;
// error in write/read
case xserial_bus_simple_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
case xserial_bus_simple_er_ID(2): XERROR_DEBUG_MODE; break;
// config information is empty
case xserial_bus_simple_er_ID(3): XERROR_DEBUG_MODE; break;
// self-test is failure
case xserial_bus_simple_er_ID(4): XERROR_DEBUG_MODE; break;
// tune is failure
case xserial_bus_simple_er_ID(5): XERROR_DEBUG_MODE; break;
// error in write/read
//case xsoft_fifo_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
case xsoft_fifo_er_ID(2): XERROR_DEBUG_MODE; break;
// error in write/read
//case xtimer_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
case xtimer_er_ID(2): XERROR_DEBUG_MODE; break;
// config information is empty
case xtimer_er_ID(3): XERROR_DEBUG_MODE; break;
// self-test is failure
case xtimer_er_ID(4): XERROR_DEBUG_MODE; break;
// start is failure
case xtimer_er_ID(5): XERROR_DEBUG_MODE; break;
// value_us must be more 0
case xtimer_er_ID(6): XERROR_DEBUG_MODE; break;
// hw is't compatible with software: RangeCount_Is too small or time_us too large
case xtimer_er_ID(7): XERROR_DEBUG_MODE; break;
// error in write/read
//case xplane_hwp_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
case xplane_hwp_er_ID(2): XERROR_DEBUG_MODE_HWP_NOT_READY; if (XERROR_DEBUG_LEVEL==1) {er=0;} break;
// config information is empty or bad
case xplane_hwp_er_ID(3): XERROR_DEBUG_MODE; break;
// test er_line is failure
case xplane_hwp_er_ID(4): XERROR_DEBUG_MODE; break;
// error in write/read in dac
case xplane_hwp_er_ID(5): XERROR_DEBUG_MODE; break;
// no error test is failure
case xplane_hwp_er_ID(6): XERROR_DEBUG_MODE; break;
// watch timer test is failure
case xplane_hwp_er_ID(7): XERROR_DEBUG_MODE; break;
// reference test is failure
case xplane_hwp_er_ID(8): XERROR_DEBUG_MODE; break;
// define voltage test is failure
case xplane_hwp_er_ID(9): XERROR_DEBUG_MODE; break;
// voltage test is failure
case xplane_hwp_er_ID(10): XERROR_DEBUG_MODE; break;
// error in write/read
//case xtools_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
//case xtools_er_ID(2): XERROR_DEBUG_MODE; break;
// config information is empty
//case xtools_er_ID(3): XERROR_DEBUG_MODE; break;
// bad input parameter Time_Unit_Is
case xtools_er_ID(4): XERROR_DEBUG_MODE; break;
// bad input parameter Time_Unit_Is
case xtools_er_ID(5): XERROR_DEBUG_MODE; break;
// too large parameter Value
case xtools_er_ID(6): XERROR_DEBUG_MODE; break;
// faulse level on line INIT
case xtools_er_ID(7): XERROR_DEBUG_MODE; break;
// faulse level on line DONE
case xtools_er_ID(8): XERROR_DEBUG_MODE; break;
// error in write/read
//case xtk_plane_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
case xtk_plane_er_ID(2): XERROR_DEBUG_MODE_TK_NOT_READY; if (XERROR_DEBUG_LEVEL==1) {er=0;} break;
// config information is empty
case xtk_plane_er_ID(3): XERROR_DEBUG_MODE; ((XTk_Plane *)CallBackRef)->IsReady=0; break;
// self-test is failure
case xtk_plane_er_ID(4): XERROR_DEBUG_MODE; ((XTk_Plane *)CallBackRef)->IsReady=0; break;
// no connection on serial bus
case xtk_plane_er_ID(5): XERROR_DEBUG_MODE; ((XTk_Plane *)CallBackRef)->IsReady=0; if (XERROR_DEBUG_LEVEL==1) {er=0;} break;
// test Tk_Bus is failure
case xtk_plane_er_ID(6): XERROR_DEBUG_MODE; ((XTk_Plane *)CallBackRef)->IsReady=0; break;
// error in write/read
//case xtk_plane_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
case xin_plane_er_ID(2): XERROR_DEBUG_MODE_IN_NOT_READY; if (XERROR_DEBUG_LEVEL==1) {er=0;} break;
// config information is empty
case xin_plane_er_ID(3): XERROR_DEBUG_MODE; ((XIn_Plane *)CallBackRef)->IsReady=0; break;
// self-test is failure
case xin_plane_er_ID(4): XERROR_DEBUG_MODE; ((XIn_Plane *)CallBackRef)->IsReady=0; break;
// no connection on serial bus
case xin_plane_er_ID(5): XERROR_DEBUG_MODE; ((XIn_Plane *)CallBackRef)->IsReady=0; if (XERROR_DEBUG_LEVEL==1) {er=0;}; break;
// bad configuration of InputNew
case xin_plane_er_ID(6): XERROR_DEBUG_MODE; ((XIn_Plane *)CallBackRef)->IsReady=0; break;
// error in set Real mode
case xin_plane_er_ID(7): XERROR_DEBUG_MODE; ((XIn_Plane *)CallBackRef)->IsReady=0; break;
// error in write/read
//case xtk_plane_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
case xout_plane_er_ID(2): XERROR_DEBUG_MODE_OUT_NOT_READY; if (XERROR_DEBUG_LEVEL==1) {er=0;} break;
// config information is empty
case xout_plane_er_ID(3): XERROR_DEBUG_MODE; ((XOut_Plane *)CallBackRef)->IsReady=0; break;
// self-test is failure
case xout_plane_er_ID(4): XERROR_DEBUG_MODE; ((XOut_Plane *)CallBackRef)->IsReady=0; break;
// no connection on serial bus
case xout_plane_er_ID(5): XERROR_DEBUG_MODE; ((XOut_Plane *)CallBackRef)->IsReady=0; if (XERROR_DEBUG_LEVEL==1) {er=0;}; break;
// bad configuration of InputNew
//case xout_plane_er_ID(6): XERROR_DEBUG_MODE; break;
// error in set Real mode
//case xout_plane_er_ID(7): XERROR_DEBUG_MODE; break;
// error in write/read
//case xspeed_sensor_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
//case xspeed_sensor_er_ID(2): XERROR_DEBUG_MODE; break;
// config information is empty
//case xspeed_sensor_er_ID(3): XERROR_DEBUG_MODE; break;
// self-test is failure
//case xspeed_sensor_er_ID(4): XERROR_DEBUG_MODE; break;
// bad configuration of InputNew
case xspeed_sensor_er_ID(5): XERROR_DEBUG_MODE; break;
// too large parameter Filtr_Max
case xspeed_sensor_er_ID(6): XERROR_DEBUG_MODE; break;
// too large parameter Lenth_Min
//case xspeed_sensor_er_ID(7): XERROR_DEBUG_MODE; break;
// compare predefine macros is failure
case xspeed_sensor_er_ID(8): XERROR_DEBUG_MODE; break;
// maximum of reriod is small
case xspeed_sensor_er_ID(9): XERROR_DEBUG_MODE; break;
// maximum of reriod is small => overrun count_max_by_hw
case xspeed_sensor_er_ID(10): XERROR_DEBUG_MODE; break;
// count_max_by_sw must be less count_max_by_hw
case xspeed_sensor_er_ID(11): XERROR_DEBUG_MODE; break;
// error in write/read
//case xcontroller_plane_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
//case xcontroller_plane_er_ID(2): XERROR_DEBUG_MODE; break;
// config information is failure
case xcontroller_plane_er_ID(3): XERROR_DEBUG_MODE; break;
// self-test is failure
//case xcontroller_plane_er_ID(4): XERROR_DEBUG_MODE; break;
// error in write/read
//case xplane_analog_er_ID(1): XERROR_DEBUG_MODE; break;
// structure is NOT READY
case xplane_analog_er_ID(2): XERROR_DEBUG_MODE_ANALOG_NOT_READY; if (XERROR_DEBUG_LEVEL==1) {er=0;} break;
// config information is empty or bad
case xplane_analog_er_ID(3): XERROR_DEBUG_MODE; break;
// test er_line is failure
// case xplane_analog_er_ID(4): XERROR_DEBUG_MODE; break;
// error in write/read in dac
case xplane_analog_er_ID(5): XERROR_DEBUG_MODE_ANALOG; break; // xplane_analog_chanals_init(&XPlane_Analog_Chanals0); break;
default: break;
}
x_er|=er;
xReady_reg_update();
return 1;
}
*/