task_communication(7492).h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef _TASK_COMMUNICATION_H_
  2. #define _TASK_COMMUNICATION_H_
  3. //-------------私有包含
  4. #include "FreeRTOS.h"
  5. #include "task.h"
  6. #include "main.h"
  7. #include "cmsis_os.h"
  8. #include "gpio.h"
  9. #include "stdio.h"
  10. #include "electronicFence.h"
  11. #include "EC800_FTP_OTA.h"
  12. #include "comm_car_485.h"
  13. #include "EC800.h"
  14. #include "task_ec800_upload.h"
  15. /* typedef -----------------------------------------------------------*/
  16. typedef struct{
  17. uint8_t fenceStatus; // 围栏状态 1:超出围栏 0:围栏内
  18. uint8_t maxFeed; // 下发给车的最高时速 km/h
  19. uint8_t maxRunFeed; // 此时车的允许运行时速 km/h
  20. uint8_t driveStatus; // 行车状态 2:为中间态(打火但没行驶,车速为0) 1:初始态 3:运行态(行驶速度大于判断阈值)
  21. uint16_t Malfunction; // 故障 定义
  22. // bit0:超出围栏故障 bit1:485通信故障 bit2:升级故障 bit3:MQTT故障
  23. // bit4:陀螺仪故障 bit5:电池故障 bit6:4G模块初始化失败
  24. // bit7:gps定位故障
  25. uint8_t vinRecSuccess; // 车架号成功获取标志 1;成功获取 0:暂未获取
  26. }comData;
  27. extern comData s_comData;
  28. // 故障枚举
  29. enum malfunction{
  30. fence,
  31. com485,
  32. update,
  33. errorMqtt,
  34. gyroscope,
  35. batError,
  36. init_4G_error,
  37. positionError,
  38. };
  39. /* define -----------------------------------------------------------*/
  40. #define times_3s 3
  41. //-------------函数声明
  42. extern void task_communication_content(void);
  43. #endif