soft_timer.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef _SOFT_TIMER_H
  2. #define _SOFT_TIMER_H
  3. #include "stdbool.h"
  4. #include "stdio.h"
  5. #include "common.h"
  6. typedef struct
  7. {
  8. bool seed;
  9. bool weight;
  10. bool pump;
  11. bool nozzle;
  12. bool arm;
  13. bool flow;
  14. bool checklow;
  15. bool radar;
  16. bool bms;
  17. bool L_pump1;
  18. bool L_pump2;
  19. bool part_radar;
  20. bool part_Fradar;
  21. bool part_Bradar;
  22. bool temperature;
  23. }Dev_timer;
  24. extern Dev_timer send_devinfo_time;
  25. extern uint32_t test_time[10];
  26. extern uint32_t test_priod;
  27. extern uint8_t utc_send_time;
  28. extern uint32_t utc_time;
  29. #define FOURYEARDAY (365+365+365+366) //4年一个周期内的总天数(1970~2038不存在2100这类年份,故暂不优化)
  30. #define TIMEZONE (8) //北京时区调整
  31. typedef struct rtc_time_struct
  32. {
  33. uint16_t ui8Year; // 1970~2038
  34. uint8_t ui8Month; // 1~12
  35. uint8_t ui8DayOfMonth; // 1~31
  36. uint8_t ui8Week;
  37. uint8_t ui8Hour; // 0~23
  38. uint8_t ui8Minute; // 0~59
  39. uint8_t ui8Second; // 0~59
  40. }rtc_time_t;
  41. extern rtc_time_t beijing_time;
  42. void covUnixTimeStp2Beijing( uint32_t unixTime, rtc_time_t *tempBeijing );
  43. void timer_function(void);
  44. extern bool vol_flag,engine_flag,devtype_flag,can_debug_flag,dev_version_flag,mimo360_radar_flag,pmu_heart_flag,pmu_to_DM4Dmsg_flag ;
  45. uint32_t Get_Systimer_Us(void);
  46. uint32_t check_period_func(uint32_t *time);
  47. #endif