123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #ifndef __EXCEPTION_H__
- #define __EXCEPTION_H__
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <stdint.h>
- #include <stdbool.h>
- typedef struct
- {
- float preBestResult_Voltage2power ;
- float preBestResult_chargeV2P_f ;
- float P_mAh ;
- float kg ;
- float P2 ;
- float P1 ;
- float Battery_capacity_mAh ;
- float adc_tp4056_power ;
- char init;
- char sta ;
- char chargeV2P_f_init;
- char Voltage2power_init;
- } battercb_t;
- typedef enum {
-
- EXCEPT_DATA_BACK_MAG =0,
- EXCEPT_DATA_FRONT_ACC,
- EXCEPT_DATA_FRONT_GRY,
- EXCEPT_DATA_FRONT_MAG,
- EXCEPT_DATA_CHARGE,
- EXCEPT_DATA_BATTERY,
- EXCEPT_IMU_SUSPEND_OVERFLOW,
- EXCEPT_ANT_DAMAGE,
- EXCEPT_FLASH,
- EXCEPT_GAME,
- EXCEPT_RealStep,
- EXCEPT_DATEStep,
- EXCEPT_Pair,
- EXCEPT_Power,
- EXCEPT_DFU,
- EXCEPT_CONNET,
- EXCEPT_OVERTURAN,
- EXCEPT_UNKOWN_RESET,
- EXCEPT_ADC_INIT,
- EXCEPT_SPI_INIT,
- EXCEPT_SPI_RW,
- EXCEPT_IIC_RW,
- EXCEPT_FLASH_INIT,
- EXCEPT_PWM_INIT,
- EXCEPT_WDT_INIT,
- EXCEPT_RTC_INIT,
- EXCEPT_RTC_CONFIG,
- EXCEPT_EXCEPTION,
- EXCEPT_QMA7981,
- EXCEPT_NUM,
- }ExcepType_t;
- void Exception_Init(void);
- void Except_SetExceptype(ExcepType_t excep_type);
- void Except_ClearExceptype(ExcepType_t excep_type);
- bool Except_IsError(ExcepType_t excep_type);
- bool Except_IsErrorExist(void);
- int Except_TxError(ExcepType_t excep_type,const char *errstr);
- void Except_Get_Cur_Porcess_ID(uint32_t cur_process_id);
- void Except_Unkown_Reset_WDT_Set(void);
- int Except_Display(ExcepType_t excep_type,const char *errstr);
- battercb_t* Except_Get_Battery_Record_Buff(void);
- #ifdef __cplusplus
- }
- #endif
- #endif
|