main.c 779 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2006-2018, 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-1-10 e31207077 change to new framework
  10. */
  11. #include <rtthread.h>
  12. #include <rtdevice.h>
  13. #include <board.h>
  14. #include "drv_gpio.h"
  15. /* defined the LED1 pin: PB0 */
  16. #define LED1_PIN GET_PIN(B, 0)
  17. int main(void)
  18. {
  19. int count = 1;
  20. /* set LED1 pin mode to output */
  21. rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
  22. while (count++)
  23. {
  24. rt_pin_write(LED1_PIN, PIN_HIGH);
  25. rt_thread_mdelay(500);
  26. rt_pin_write(LED1_PIN, PIN_LOW);
  27. rt_thread_mdelay(500);
  28. }
  29. return RT_EOK;
  30. }