main.c 655 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-12-14 supperthomas first version
  9. */
  10. #include <rtthread.h>
  11. #include <rtdevice.h>
  12. #include <board.h>
  13. #define LED1_PIN GET_PIN(C, 0)
  14. int main(void)
  15. {
  16. /* set LED2 pin mode to output */
  17. rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
  18. #ifdef BSP_USING_USBD
  19. rt_console_set_device("vcom");
  20. #endif
  21. while (1)
  22. {
  23. rt_pin_write(LED1_PIN, PIN_HIGH);
  24. rt_thread_mdelay(2000);
  25. rt_pin_write(LED1_PIN, PIN_LOW);
  26. rt_thread_mdelay(2000);
  27. }
  28. }