global(548).h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _GLOBAL_H_
  2. #define _GLOBAL_H_
  3. /* includes ----------------------------------------------------------*/
  4. #include "stm32f1xx_hal.h"
  5. #include "usart.h"
  6. #include <string.h>
  7. #include "EC800.h"
  8. #include "flash.h"
  9. #include "task_communication.h"
  10. #include "comm_car_485.h"
  11. /* typedef -----------------------------------------------------------*/
  12. typedef struct{
  13. uint16_t ctrEvent; // 中控板事件
  14. // bit0:中控板迁移事件
  15. // 故障相关
  16. uint8_t positionErrorCnt; // 定位信息错误计数
  17. uint8_t mqttTimeoutCnt; // MQTT通信超时计数
  18. uint8_t InitFaultFlag_4G; // 4g模块初始化标志 1:初始化失败 0:初始化成功
  19. uint8_t timeoutCnt_485; // 485通信超时计数
  20. }global_par;
  21. extern global_par s_global_par;
  22. // 事件枚举
  23. enum event{
  24. CtrlPanelMigration, // 中控板迁移事件
  25. };
  26. /* define ------------------------------------------------------------*/
  27. #define TIMEOUT_485 10 // 10S 485通信超时时间
  28. /* macro -------------------------------------------------------------*/
  29. /* variables ---------------------------------------------------------*/
  30. /* function prototypes -----------------------------------------------*/
  31. // @brief 中控板初始化
  32. extern void centralCtrSys_Init(param_boot *p_param_boot, global_par *p_global_par);
  33. #endif