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.

67 lines
1.8 KiB

2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
  1. #include <stddef.h>
  2. #include <stdio.h>
  3. #include "base/config_service.hpp"
  4. #include "base/device_info.hpp"
  5. #include "iwdg.h"
  6. #include "protocol_impl/protocol_impl_service.hpp"
  7. #include "zsdk/zcanreceiver/zcanreceiver.hpp"
  8. #include "zsdk/zcanreceiver_old/zcanreceiver.hpp"
  9. #include "zsdk/zsdk.hpp"
  10. #define TAG "main"
  11. using namespace iflytop;
  12. extern void umain();
  13. extern "C" {
  14. void StartDefaultTask(void const* argument) { umain(); }
  15. }
  16. /*******************************************************************************
  17. * MAIN *
  18. *******************************************************************************/
  19. extern "C" {
  20. // void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
  21. // }
  22. }
  23. ZGPIO m_debugled;
  24. void debug_light_ctrl() {
  25. static uint32_t lastcall = 0;
  26. static bool light_status = false;
  27. if (zhas_passedms(lastcall) > 100) {
  28. m_debugled.toggle();
  29. lastcall = zget_ticket();
  30. }
  31. }
  32. void umain() {
  33. m_debugled.initAsOutput(DEBUG_LIGHT_GPIO, kxs_gpio_nopull, false, false);
  34. config_init();
  35. deviceInfo_init();
  36. ZLOGI(TAG, "======================= boardinfo ==================== ");
  37. ZLOGI(TAG, "project : %s ", PROJECT);
  38. ZLOGI(TAG, "version : %d ", SOFTWARE_VERSION);
  39. ZLOGI(TAG, "pversion: %d", deviceInfo_getProtocolVersion());
  40. ZLOGI(TAG, "sn : %s", sn_get_str());
  41. ZLOGI(TAG, "boardId : %d", deviceInfo_getBoardId());
  42. ZLOGI(TAG, "=");
  43. HAL_IWDG_Refresh(&hiwdg);
  44. ZLOGI(TAG, "======================= init info ==================== ");
  45. protocol_impl_service_init();
  46. ZLOGI(TAG, "=");
  47. ZLOGI(TAG, "======================= sysinfo ======================= ");
  48. HAL_IWDG_Refresh(&hiwdg);
  49. SysMgr::ins()->initedFinished();
  50. SysMgr::ins()->dumpSysInfo();
  51. ZLOGI(TAG, "=");
  52. while (true) {
  53. osDelay(1);
  54. HAL_IWDG_Refresh(&hiwdg);
  55. debug_light_ctrl();
  56. }
  57. }