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.

32 lines
892 B

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. #include "device.hpp"
  2. #include "iflytop_xsync/iflytop_xsync.h"
  3. #include "project_configs.h"
  4. using namespace iflytop;
  5. // extern DMA_HandleTypeDef PC_DEBUG_UART_DMA_HANDLER;
  6. #define TAG "Device"
  7. void Device::init() {
  8. XS_LOGI(TAG, "%s:%s", PC_PROJECT_NAME, PC_VERSION);
  9. xs_gpio_init_as_output(&m_debug_led, PC_DEBUG_LIGHT_GPIO, kxs_gpio_nopull, false, false);
  10. // chip_cfg_t chipcfg = {};
  11. // chipcfg.us_dleay_tim = &PC_SYS_DELAY_US_TIMER;
  12. // chipcfg.tim_irq_scheduler_tim = &PC_SYS_TIM_IRQ_SCHEDULER_TIMER;
  13. // chipcfg.huart = &PC_DEBUG_UART;
  14. // chipcfg.debuglight = PC_DEBUG_LIGHT_GPIO;
  15. // chip_init(&chipcfg);
  16. // zos_cfg_t zoscfg;
  17. // zos_init(&zoscfg);
  18. }
  19. void Device::loop() {
  20. while (1) {
  21. xs_gpio_write(&m_debug_led, true);
  22. xs_delay_ms(1000);
  23. xs_gpio_write(&m_debug_led, false);
  24. xs_delay_ms(1000);
  25. }
  26. }