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.

53 lines
1.2 KiB

2 years 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
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
  1. #include <stddef.h>
  2. #include <stdio.h>
  3. #include "service/config_service.hpp"
  4. #include "zsdk/zsdk.hpp"
  5. #define TAG "main"
  6. using namespace iflytop;
  7. extern void umain();
  8. extern "C" {
  9. void StartDefaultTask(void const* argument) { umain(); }
  10. }
  11. /*******************************************************************************
  12. * MAIN *
  13. *******************************************************************************/
  14. extern "C" {
  15. // void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
  16. // }
  17. }
  18. ZGPIO m_debugled;
  19. void debug_light_ctrl() {
  20. static uint32_t lastcall = 0;
  21. static bool light_status = false;
  22. if (zhas_passedms(lastcall) > 100) {
  23. m_debugled.toggle();
  24. lastcall = zget_ticket();
  25. }
  26. }
  27. void umain() {
  28. int32_t count = 0;
  29. ZLOGI(TAG, "%s: %d.%d.%d", PROJECT, VERSION_MAIN(PC_VERSION), VERSION_SUB(PC_VERSION), VERSION_FIX(PC_VERSION));
  30. ZLOGI(TAG, "sn: %s", sn_get_str());
  31. config_init();
  32. m_debugled.initAsOutput(DEBUG_LIGHT_GPIO, kxs_gpio_nopull, false, false);
  33. ZLOGI(TAG, "system init done");
  34. SysMgr::ins()->regTaskId(osThreadGetId());
  35. SysMgr::ins()->dumpSysInfo();
  36. while (true) {
  37. osDelay(10);
  38. debug_light_ctrl();
  39. }
  40. }