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.

65 lines
1.7 KiB

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