main.c 730 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023-07-06 Supperthomas first version
  9. * 2023-12-03 Meco Man support nano version
  10. * 2024-04-13 yuanzihao adaptation for SkyStar STM32F407 version
  11. */
  12. #include <board.h>
  13. #include <rtthread.h>
  14. #include <drv_gpio.h>
  15. #ifndef RT_USING_NANO
  16. #include <rtdevice.h>
  17. #endif /* RT_USING_NANO */
  18. #define GPIO_LED GET_PIN(B, 2)
  19. int main(void)
  20. {
  21. rt_pin_mode(GPIO_LED, PIN_MODE_OUTPUT);
  22. while (1)
  23. {
  24. rt_pin_write(GPIO_LED, PIN_HIGH);
  25. rt_thread_mdelay(500);
  26. rt_pin_write(GPIO_LED, PIN_LOW);
  27. rt_thread_mdelay(500);
  28. }
  29. }