#ifndef X_ERROR_H
#define X_ERROR_H

#define XERROR_DEBUG_LEVEL 2

#define XERROR_DEBUG_MODE_ANALOG      asm ("   NOP")


#if (XERROR_DEBUG_LEVEL == 0)
  #define XERROR_DEBUG_MODE      asm ("   NOP")
#else
  #define XERROR_DEBUG_MODE      asm ("   ESTOP0")
#endif


#if (XERROR_DEBUG_LEVEL <= 1)
  #define XERROR_DEBUG_MODE_TK_NOT_READY   asm ("   NOP")
  #define XERROR_DEBUG_MODE_IN_NOT_READY   asm ("   NOP")
  #define XERROR_DEBUG_MODE_OUT_NOT_READY  asm ("   NOP")
  #define XERROR_DEBUG_MODE_HWP_NOT_READY  asm ("   NOP")
  #define XERROR_DEBUG_MODE_ANALOG_NOT_READY  asm ("   NOP")
  #define XERROR_DEBUG_MODE_INPUT_NEW_NOT_READY  asm ("   NOP")
#else
  #define XERROR_DEBUG_MODE_TK_NOT_READY   asm ("   ESTOP0")
  #define XERROR_DEBUG_MODE_IN_NOT_READY   asm ("   ESTOP0")
  #define XERROR_DEBUG_MODE_OUT_NOT_READY  asm ("   ESTOP0")
  #define XERROR_DEBUG_MODE_HWP_NOT_READY  asm ("   ESTOP0")
  #define XERROR_DEBUG_MODE_ANALOG_NOT_READY  asm ("   ESTOP0")
  #define XERROR_DEBUG_MODE_INPUT_NEW_NOT_READY  asm ("   ESTOP0")
  #define XERROR_DEBUG_MODE_HWP_ERROR_SET_LEVEL_PROTECT  asm ("   ESTOP0")
#endif



    #define main_er_ID(er_ID)                (  0  + er_ID)
	#define xseeprom_er_ID(er_ID)            (100  + er_ID)
    #define xtools_er_ID(er_ID)              (200  + er_ID)
	#define xserial_bus_er_ID(er_ID)         (300  + er_ID)
    #define xparall_bus_er_ID(er_ID)         (400  + er_ID)
	#define xplane_hwp_er_ID(er_ID)          (700  + er_ID)
    #define xtk_plane_er_ID(er_ID)           (900  + er_ID)
    #define xin_plane_er_ID(er_ID)           (1000 + er_ID)

/*
    #define xinput_new_er_ID(er_ID)          (100  + er_ID)
    #define xintc_er_ID(er_ID)               (200  + er_ID)
    #define xserial_bus_er_ID(er_ID)         (300  + er_ID)
    #define xserial_bus_simple_er_ID(er_ID)  (400  + er_ID)
    #define xsoft_fifo_er_ID(er_ID)          (500  + er_ID)
    #define xtimer_er_ID(er_ID)              (600  + er_ID)
    #define xplane_hwp_er_ID(er_ID)          (700  + er_ID)
    #define xtk_plane_er_ID(er_ID)           (900  + er_ID)
    #define xin_plane_er_ID(er_ID)           (1000 + er_ID)
    #define xout_plane_er_ID(er_ID)          (1100 + er_ID)
    #define xspeed_sensor_er_ID(er_ID)       (1200 + er_ID)
    #define xcontroller_plane_er_ID(er_ID)   (1300 + er_ID)
    #define xplane_analog_er_ID(er_ID)       (1400 + er_ID)
*/
    int xerror(unsigned int er_ID, void *CallBackRef);
//    int xassert(unsigned int er, unsigned int er_ID, void *CallBackRef);

//	#define XERROR_DEBUG_MODE_HWP_NOT_READY  asm ("   ESTOP0")

void xPeriphErrReset(void);

#endif //X_ERROR_H
