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.

45 lines
1.2 KiB

2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
  1. #include <stddef.h>
  2. #include <stdio.h>
  3. #include "board.h"
  4. //
  5. #include "configs/device_id_mgr.hpp"
  6. #include "sdk/chip/chip.hpp"
  7. #include "sdk/os/zos.hpp"
  8. #define TAG "main"
  9. using namespace std;
  10. extern void umain();
  11. extern "C" {
  12. void StartDefaultTask(void const* argument) { umain(); }
  13. }
  14. void umain() {
  15. zos_cfg_t zoscfg = {0};
  16. chip_cfg_t chipcfg = {};
  17. chipcfg.us_dleay_tim = &PC_SYS_DELAY_US_TIMER;
  18. chipcfg.tim_irq_scheduler_tim = &PC_SYS_TIM_IRQ_SCHEDULER_TIMER;
  19. chipcfg.huart = &PC_DEBUG_UART;
  20. chipcfg.debuglight = PC_DEBUG_LIGHT_GPIO;
  21. chip_init(&chipcfg);
  22. zos_init(&zoscfg);
  23. zdevice_id_mgr_init();
  24. int32_t id = zdevice_id_mgr_get_device_id();
  25. ZEARLY_LOGI("SYS", "chip init ok");
  26. ZEARLY_LOGI("SYS", "= manufacturer : %s", PC_MANUFACTURER);
  27. ZEARLY_LOGI("SYS", "= project name : %s", PC_PROJECT_NAME);
  28. ZEARLY_LOGI("SYS", "= version : %s", PC_VERSION);
  29. ZEARLY_LOGI("SYS", "= freq : %d", HAL_RCC_GetSysClockFreq());
  30. ZEARLY_LOGI("SYS", "= build time : %s", __DATE__ " " __TIME__);
  31. ZEARLY_LOGI("SYS", "= device id : %d", id);
  32. ZLOGI(TAG, "zaf_flash_flush ok");
  33. while (true) {
  34. zos_delay(1);
  35. }
  36. }