main.c 825 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. * 2021-10-02 spaceman first version
  9. */
  10. #include <rtdbg.h>
  11. #include <stdio.h>
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. #include "board.h"
  15. #include "drv_gpio.h"
  16. #define LED0_PIN GET_PIN(B, 14)
  17. #define LED1_PIN GET_PIN(B, 15)
  18. int main(void)
  19. {
  20. /* set LED pin mode to output */
  21. rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
  22. rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
  23. rt_pin_write(LED0_PIN, PIN_LOW);
  24. rt_pin_write(LED1_PIN, PIN_LOW);
  25. while (1)
  26. {
  27. rt_pin_write(LED0_PIN, PIN_HIGH);
  28. rt_thread_mdelay(500);
  29. rt_pin_write(LED0_PIN, PIN_LOW);
  30. rt_thread_mdelay(500);
  31. }
  32. return RT_EOK;
  33. }