12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #ifndef _TASK_COMMUNICATION_H_
- #define _TASK_COMMUNICATION_H_
- //-------------私有包含
- #include "FreeRTOS.h"
- #include "task.h"
- #include "main.h"
- #include "cmsis_os.h"
- #include "gpio.h"
- #include "stdio.h"
- #include "electronicFence.h"
- #include "EC800_FTP_OTA.h"
- #include "comm_car_485.h"
- #include "EC800.h"
- #include "task_ec800_upload.h"
- #include "flash.h"
- #include "global.h"
- /* typedef -----------------------------------------------------------*/
- typedef struct{
- uint8_t fenceStatus; // 围栏状态 1:超出围栏 0:围栏内
- uint8_t maxFeed; // 下发给车的最高时速 km/h
- uint8_t maxRunFeed; // 此时车的允许运行时速 km/h
- uint8_t driveStatus; // 行车状态 2:为中间态(打火但没行驶,车速为0) 1:初始态 3:运行态(行驶速度大于判断阈值)
- uint32_t Malfunction; // 故障 定义
- // bit0:超出围栏故障 bit1:485通信故障 bit2:MQTT故障
- // bit3:陀螺仪故障 bit4:电池故障 bit5:4G模块初始化失败
- // bit6:gps定位故障 bit7: OTA升级故障
- // bit8: 超速故障
- uint8_t vinRecSuccess; // 车架号成功获取标志 1;成功获取 0:暂未获取
- }comData;
- extern comData s_comData;
- // 故障枚举
- enum malfunction{
- fence,
- com485,
- errorMqtt,
- gyroscope,
- carError,
- init_4G_error,
- positionError,
- OTA_fault,
- outSpeed,
- };
- /* define -----------------------------------------------------------*/
- #define times_5s 5
- #define times_60s 60
- //-------------函数声明
- extern void task_communication_content(void);
- #endif
|