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.

86 lines
2.3 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. #include <stddef.h>
  2. #include <stdio.h>
  3. //
  4. #include "base_service/base_service.h"
  5. #include "base_service/fpga_if.h"
  6. #include "service/device_info.hpp"
  7. #include "service/extern_if_service.h"
  8. #include "service/network_service.h"
  9. #include "service/reg_manager.h"
  10. #include "service/report_generator_service.h"
  11. //
  12. #define TAG "main"
  13. using namespace std;
  14. extern void umain();
  15. extern "C" {
  16. extern void MX_LWIP_Init(void);
  17. void StartDefaultTask(void const* argument) { umain(); }
  18. }
  19. /*******************************************************************************
  20. * MAIN *
  21. *******************************************************************************/
  22. /**
  23. * @brief
  24. * | extern_if_service |
  25. * ========================================
  26. * | reg_manager |
  27. * config_service ========================================
  28. * | report_generator | device_info |
  29. * =================== ==============
  30. * | fpage_if |
  31. * ========================================
  32. *
  33. */
  34. xs_gpio_t m_debug_led;
  35. extern "C" {
  36. void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { report_generator_service_irq_trigger(GPIO_Pin); }
  37. }
  38. void umain() {
  39. XS_LOGI(TAG, "%s:%d", PC_PROJECT_NAME, PC_VERSION);
  40. /**
  41. * @brief ָʾƳʼ
  42. */
  43. xs_gpio_init_as_output(&m_debug_led, PC_DEBUG_LIGHT_GPIO, kxs_gpio_nopull, false, false);
  44. /**
  45. * @brief óʼ
  46. */
  47. config_init();
  48. /**
  49. * @brief ʼ
  50. */
  51. network_service_init();
  52. /**
  53. * @brief fpga_interface init
  54. */
  55. fpga_if_init();
  56. /**
  57. * @brief report_generator init
  58. */
  59. report_generator_service_init(fpga_if_get_instance()->timecode_irq_pin, fpga_if_get_instance()->camera_sync_code_irq_pin);
  60. /**
  61. * @brief device_info init
  62. */
  63. device_info_init();
  64. /**
  65. * @brief reg_manager init
  66. */
  67. reg_manager_init();
  68. /**
  69. * @brief extern_if_service init
  70. *
  71. * ⲿָ
  72. */
  73. extern_if_service_init();
  74. while (true) {
  75. xs_gpio_write(&m_debug_led, true);
  76. xs_delay_ms(100);
  77. xs_gpio_write(&m_debug_led, false);
  78. xs_delay_ms(100);
  79. }
  80. }