main.c 802 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-11-06 SummerGift change to new framework
  9. * 2019-01-12 whj add stm32f107-uc-Eval bsp
  10. * 2023-12-03 Meco Man support nano 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. /* defined the LED1 pin: PD13 */
  19. #define LED1_PIN GET_PIN(D, 13)
  20. int main(void)
  21. {
  22. /* set LED1 pin mode to output */
  23. rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
  24. while (1)
  25. {
  26. rt_pin_write(LED1_PIN, PIN_HIGH);
  27. rt_thread_mdelay(500);
  28. rt_pin_write(LED1_PIN, PIN_LOW);
  29. rt_thread_mdelay(500);
  30. }
  31. }