#ifndef TEST_H #define TEST_H #include #include #include #include #include #include #include #include #include #include "irq.h" #include "udelay\udelay.h" #define PERIOD_TICK 1000000.0f // 1000000us = 1s #ifdef __cplusplus extern "C" { #endif //unsigned int wrbyte_24c02(unsigned int addr, unsigned char data); //unsigned char rdbyte_24c02(unsigned int addr); //void feedWatchdog(void); //uint32_t getCurrentTime(void); //void udelay(uint32_t t ); // //typedef unsigned int irq_state_t; //static inline irq_state_t arch_irq_save(void) //{ // unsigned int cpsr = 0; // return cpsr; //} // //static inline void arch_irq_restore(irq_state_t flags) //{ // flags += 1; //} //// 故障信息 //typedef struct _StrCanFault //{ // uint8_t navigator_count; // 导航仪计数器 // uint8_t motor1_count; // 左电机计数器 // uint8_t motor2_count; // 右电机计数器 // uint8_t bms_count; // bms计数器 // uint8_t temperature_count; // 温度计数器 // uint8_t remote_count; // 遥控计数器 // // uint8_t navigator_state; // 导航仪故障状态 // uint8_t motor1_state; // 电机1故障状态 // uint8_t motor2_state; // 电机2故障状态 // uint8_t bms_state; // bms状态 // uint8_t temperature_state; // 温度计数器 // uint8_t remote_state; // 遥控状态 //} StrCanFault; //typedef union _UnCanFault //{ // StrCanFault bit_data; // 使用定义的结构体类型 // uint8_t arr[sizeof(StrCanFault)]; // 通过结构体确定数组大小 //} UnCanFault; //extern UnCanFault can_fault_info; //typedef struct _StrEthernetFault //{ // uint8_t auto_count; // 自动数据计数器 // uint8_t manual_count; // 手动数据计数器 // uint8_t auto_state; // 自动状态 | 0正常 1故障 // uint8_t manual_state; // 手动状态 | 0正常 1故障 //} StrEthernetFault; // //typedef union _UnEthernetFault //{ // StrEthernetFault bit_data; // 使用定义的结构体类型 // uint8_t arr[sizeof(StrEthernetFault)]; // 通过结构体大小确定数组大小 //} UnEthernetFault; //extern UnEthernetFault ethernet_fault_Info; #ifdef __cplusplus } #endif #endif // TEST_H