You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.6 KiB

2 years ago
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdio.h>
  4. #include "board/project_board.hpp"
  5. #include "libiflytop_micro\stm32\basic\basic.h"
  6. #include "libiflytop_micro\stm32\component\tmc\ic\tmc4361A.hpp"
  7. //
  8. #include <stdlib.h>
  9. #include "board/hardware.hpp"
  10. #include "libiflytop_micro\stm32\basic\stm32_tim.hpp"
  11. #include "libiflytop_micro\stm32\basic\zsignal.hpp"
  12. #include "libiflytop_micro\stm32\component\iflytop_can_slave_module\device_base_control_service.hpp"
  13. #include "libiflytop_micro\stm32\component\iflytop_can_slave_module\idcard_reader_service.hpp"
  14. #include "libiflytop_micro\stm32\component\iflytop_can_slave_module\single_axis_motor_control_v2.hpp"
  15. #include "libiflytop_micro\stm32\component\iflytop_can_slave_v1\iflytop_can_slave.hpp"
  16. #include "libiflytop_micro\stm32\component\m3078\m3078_code_scaner.hpp"
  17. #define UPDATE_REG(reg, value, periodms) \
  18. { \
  19. static uint32_t lastReportTicket = 0; \
  20. if (m_hardware.hasPassedMS(lastReportTicket) > (periodms + random(3))) { \
  21. lastReportTicket = m_hardware.getTicket(); \
  22. m_protocolStack.writeRegValue(reg, value, false); \
  23. } \
  24. }
  25. namespace iflytop {
  26. class Main {
  27. public:
  28. Hardware m_hardware;
  29. Main() {}
  30. void main(int argc, char const *argv[]);
  31. public:
  32. };
  33. } // namespace iflytop
  34. static iflytop::Main mainObject;
  35. extern "C" {
  36. int umain(int argc, char const *argv[]) {
  37. mainObject.main(argc, argv);
  38. return 0;
  39. }
  40. }